cameron

How to program a CC1310F64RHBT in Energia

21 posts in this topic

The CC1310 board option in Energia assumes that I am using the CC1310 Launchpad. The launchpad uses the CC1310F128RGZ, but I actually am using the CC1310F64RHBT. This means that the board is assuming it has more flash and RAM than it actually does. I want to edit the boards.txt file to match with the specs of my chip but I cannot find the correct numbers for my chip. There is also an issue with the pin mapping, because the F128RGZ has 48 pins while the F64RHBT has 32.

Here the boards.txt for the CC1310 launchpad that needs to be adapted for the CC1310F64RHBT:

menu.cpu=Processor
LAUNCHXL_CC1310.vid.0=0x2341
LAUNCHXL_CC1310.pid.0=0x0c9f
LAUNCHXL_CC1310.name=LaunchPad w/ cc13xx EMT (48MHz)
LAUNCHXL_CC1310.upload.maximum_size=16384
LAUNCHXL_CC1310.upload.maximum_ram_size=2560
LAUNCHXL_CC1310.build.mcu=cortex-m3
LAUNCHXL_CC1310.build.f_cpu=48000000L
LAUNCHXL_CC1310.build.core=cc13xx
LAUNCHXL_CC1310.build.variant=LAUNCHXL_CC1310
LAUNCHXL_CC1310.build.board=LAUNCHXL_CC1310
LAUNCHXL_CC1310.build.ldscript=ti/runtime/wiring/cc13xx/linker.cmd
LAUNCHXL_CC1310.upload.tool=dslite
LAUNCHXL_CC1310.upload.protocol=dslite
LAUNCHXL_CC1310.upload.maximum_size=131072
LAUNCHXL_CC1310.upload.maximum_data_size=8192

 

If anyone could help me adapt my boards.txt file or let me know where I can get these numbers, let me know. I have tried inputting 64kb for flash and the other appropriate values, but it didn't work because I assume the values have to line up perfectly with the chip's memory sectors and the memory map.

 

Thanks,

Cameron

Share this post


Link to post
Share on other sites

I'm not familiar with Energia, but you'll need to change the linker file for the appropriate one, and you can easily change 131072 to 65536.  If you don't have the linker file, I can send you one that comes from TI-RTOS.  It probably works.

Share this post


Link to post
Share on other sites

Where would I place this linker file?

 

On some path that Energia config script finds.  Looks like you can change this path (see below).  Maybe just call it linker-64KB.cmd and toss it in the same directory -- up to you.

 

LAUNCHXL_CC1310.build.ldscript=ti/runtime/wiring/cc13xx/linker.cmd

Share this post


Link to post
Share on other sites

Here is the package of 64KB linker files from the TI-RTOS distro.  Give these a try.  Most likely you want the .cmd variant.

 

On some path that Energia config script finds.  Looks like you can change this path (see below).  Maybe just call it linker-64KB.cmd and toss it in the same directory -- up to you.

 

LAUNCHXL_CC1310.build.ldscript=ti/runtime/wiring/cc13xx/linker.cmd

 

I have tried this. It yields the error which can be found at this gist: 

https://gist.github.com/cameronus/5abd654d14445c8dc76f9665d14463c1

 

Any help would be greatly appreciated as I have still not been able to program my chip.

 

Thanks,

Cameron

Share this post


Link to post
Share on other sites

Do a comparison of the two linker files: the one from the Energia distribution and the one from the TI-RTOS distro (I attached this one).

 

1. Do quick visual inspection.

 

2. Run a diff on the files if they are mostly similar.  Filemerge is on OS X, there are others on Linux and Windows.  You should learn how to use diff in any case.

Share this post


Link to post
Share on other sites

@@jpnorair I don't think you sent the correct files. They are completely and entirely different. Here is a gist for the linker you sent: https://gist.github.com/cameronus/dfb95b369ac8d6aa5885458d8dbe512d (I removed the comment header to keep it shorter), and here is the one found in the Energia CC1310 Launchpad files: https://gist.github.com/cameronus/ee26a3e9df5565adcd2fabf48e7cf80f. If you could please help, I would appreciate it.

Share this post


Link to post
Share on other sites

TI-RTOS is such a mess.  The files are different because some people go out of their way to try to hook-up everything in a build interdependently rather than to have some redundancies, and you're suffering because you don't know much about building code.  Sorry about that, but it's not my doing.

 

Try looking at the file included in your linker command.

 

INCLUDE "ti/platforms/emt13xx//include_gnu/CC1310.lds"

 

You need to change the memory areas from 128KB to 64KB.  I'm not going to do this for you, and it might be a journey for you that takes some time to figure out (for the first time).  

 

Another option is to replace your 64KB chip with a 128KB chip.  Assuming you know what you're doing and have a hot-air rework kit, that's a 30 minute job, max.  Assuming you don't want to do this, I recommend taking a look at the "memory map" section of the CC1310 Technical Reference Manual to make sure all your sections are declared properly.  Welcome to embedded!

Share this post


Link to post
Share on other sites

I personally won't touch anything other than the F128 model.  I think it was a mistake for TI to produce them (especially the CC1310F32, like, wtf?)... with the RTOS being an integral part of the solution.

Share this post


Link to post
Share on other sites

@@spirilis @@jpnorair I could move to the F128 for prototyping, but I have already spent way way too much money on proto-advantage SMT to DIP adapters. I most likely will put the 128 in my final design and just stick with the F64 for prototyping. At least I know the chip will work on the final product. I have gone through and fixed about 7 errors now by renaming files changing flash size values and creating configurations. Now I am stuck on this, when I upload I get this error: 

"/Users/cameron/Library/Energia15/packages/energia/tools/arm-none-eabi-gcc/4.8.4-20140725/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld:/Applications/Energia.app/Contents/Java/hardware/cc13xx/ion/cores/cc13xx/ti/runtime/wiring/cc13xx/linker.cmd:39: warning: memory region `REGION_TEXT' not declared/Users/cameron/Library/Energia15/packages/energia/tools/arm-none-eabi-gcc/4.8.4-20140725/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld:/Applications/Energia.app/Contents/Java/hardware/cc13xx/ion/cores/cc13xx/ti/runtime/wiring/cc13xx/linker.cmd:39: warning: memory region `REGION_DATA' not declared
/Applications/Energia.app/Contents/Java/hardware/cc13xx/ion/cores/cc13xx/ti/runtime/wiring/cc13xx/linker.cmd:39: undefined symbol `__data_start__' referenced in expression
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Ion.

I don't get why it can't find these regions as I have not deleted anything that I know of. Any ideas?

 

I also agree, 32kb, with RTOS, wtf?

Share this post


Link to post
Share on other sites

@@spirilis @@jpnorair I have gotten past that error as well by comparing and modifying the .lds @@jpnorair sent me and the one found in the CC1310F128 folder. TI-RTOS is really a pain in the ass. I finally got this error which appears to be hardware related and not software:

Loading Program: /var/folders/wg/8ffwz6257k98qp1rmrrxwcj40000gq/T/builda6b0f927fed067f49cbe57f1047efa14.tmp/CC1310Blink.ino.elfPreparing ... 
.text: 0 of 29872 at 0x0
.text: 28672 of 29872 at 0x0: 85%
.data: 0 of 88 at 0xffa8: 98%
.data: 0 of 200 at 0x20000000: 98%
.data: 0 of 244 at 0x20001ff0: 99%
Finished: 99%
Setting PC to entry point.: 99%
Running...
error: Cortex_M3_0: Can't Run Target CPU: (Error -2134 @ 0x0) Unable to control device execution state. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 6.0.222.0) 
Success

I am using regular jumper cables to connect the MSP432 programmer to the CC1310F64 which is on a breadboard. Does this have to do with the resistance of the wires or other properties? I would also be happy to share this so others like me wouldn't be in this bad situation.

Share this post


Link to post
Share on other sites

Without having any way of seeing your breadboard adapter socket soldering job and where the passives are, my first assumption is you probably did something wrong with the chip's layout; FYI this isn't a chip you can casually "solder to an adapter" and expect it to work.  It has several passives including an inductor, multiple values of decoupling capacitors, a 24MHz XTAL without load caps (load caps are internal) along with a 32.768KHz XTAL with load caps that are expected (earlier revisions of the CC1310 chip couldn't run without the 32.768KHz XTAL).  I've been successful in rolling my own boards by designing them from scratch but closely following the layout decisions demonstrated by TI's own reference designs.

jpnorair likes this

Share this post


Link to post
Share on other sites

Yeah, with RF devices you don't just wire-em-up.  Frankly, you don't even go with 2-layer PCB, you really need an internal ground plane (so 4-layer).  The CC13xx has a lot more electrical requirements, as well.  For one thing, there's a DC-DC converter on it that will be radiating a ton of noise if you're not ultra-miniaturizing the component layout (and paying attention to trace design & component selection).  

 

Everything is a learning experience.  In this case, I'd say you should try to sell-off as much of your breadboarding kits to some makers, and buy a bunch of launchpads instead.  RF circuit prototyping requires a good soldering iron, a microscope, and a lot of proto boards you can destroy in the name of analog network analysis.  It's not a huge expense once you figure it out, but it's more than makers tend to want to spend.  And at the end of the day, radio waves are invisible and make for a lousy demo!  So it's usually a lot more practical to buy someone else's dev kit.  FWIW, wireless SoC dev kits used to be like $1000.  They would get delivered in a custom case from your local TI (or ST, Semtech, etc) rep!  Now, $80 for 4 launchpads.  INSANELY GREAT.

Share this post


Link to post
Share on other sites

Thanks for the pointers. I already have a 4-layer PCB design which has been built from TI reference designs and part datasheets. It has all the necessary components for the radio to work such as ground/power planes and the required decoupling caps/inductors. I wanted to be able to use it with a breadboard on the side without using the radio to test code that interacts with sensors. It seems like that will be a lot of work to pull off so I think I'll stick with debugging on my final board.

 

Thanks,

Cameron

Share this post


Link to post
Share on other sites

@jpnorair @spirilis

Hello! I am back quite a few months later with a finished 4 layer PCB which uses the CC1310F128RHBT. I currently using the programmer on the MSP432 LP to flash code to the chip. Uploading code from Energia while selecting the CC1310 LP board works just fine, but the code never executes properly. I have narrowed this down to an issue within the CC1310 LP board files. If I try to blink an LED on the board with some simple code, it uploads fine, but it doesn't blink the LED. In fact, using any kind of simple digitalWrite commands does not work. I think this is because the CC1310 LP has 48 pins while the CC1310F128RHBT has only 32. I need to be able to select the correct pin number and digitalWrite to it for any basic needs. Would either of you know where I could find the board files for my chip?

 

Thanks so much,

Cameron

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now