Jump to content
cameron

How to program a CC1310F64RHBT in Energia

Recommended Posts

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

@@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

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

×