This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I have a non-banked CC2530 image that is linked so that it is loaded from 0xFFFF downwards.
I can load and run this HEX image from the IAR workbench just fine.
When I try to load using the SmartRF Flash Programmer (V1.7.1) it loads OK but the application fails.
If I read back both images using the SmartRF Flash Programmer and do a diff I can see that the top 2k page of the SmaerRF loaded image is all FFs.
If I move the image so that it loads from 0xF7FF (skip the top 2k) it runs fine when loaded from both IAR and SamrtRF.
Any ideas?
Cheers, Steve.
Hi Steve.
I am guessing you are using code banking for this chip. Your problem description sounds like the Intel HEX output file from IAR is built with incorrect linker setting. Please check the linker configuration file (.xcl file) you use in under Project options -> Linker -> Config (tab) settings, and inside that file look for a line (linker directive) that starts with "-M".
IAR and the debugger uses a logical memory map internally to handle code banking that is different from the physical memory map used/needed by the chip's flash memory. Whenever you want to build a Intel HEX file (.hex) as output from the linker, (and not just the IAR proprietary UBROF file format used by the IAR C-SPY debugger, .d51) you will need to enable an address translation/remapping which is done by an "-M" command in the .xcl file. If this option has been deactivated (commented out) in your linker file, you will need to activate it.
In earlier versions of IAR (v7.50 and earlier), you got an error when using "-M" address translation when building debug file format, so then you had to comment it in / out depending on your output file format. In v7.51 you can leave "-M" enabled all times, but you will get a warning (you can choose to ignore), and the addresses shown in the linker listing output file (a .map file, if you have enabled this -- it will show you the memory location of every function and global variable) will also become remapped/adjusted. [Alternatively, you can make a copy of the .xcl file, to have one for debugging and one for building Intel HEX files (without and with the -M option), and then configure each of the "debug" and "release" configurations in your IAR project to use the corresponding linker file.]
If you do not enable/use the "-M[...]" linker option (i.e. do not perform the address remapping) you will most likely get a several blocks of 32 kB without code inbetween each bank of 32 kB code. (This is typically seen as huge section of unprogrammed 0xFF bytes, if read back from the chip after programming with the .hex file).
I hope this helps :-)
---
PS: By the way, the CC2530 MCU always starts code execution from address 0x0000 upon a reset.
Hi,
I follow your mentions and uncomment the line "-M".
When I upgrade the HEX file with Flash Programmer, I got a message as bellow.
"Flash image overlaps with the bootloader"
I use the sample project that build from TIMAC-CC2530-1.3.0 and my target is SmartRF05EB with CC2530EM.
Does anyone meet this issue before?
Thanks.