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.

CC2540 secondary IEEE address erased during IAR debug

Other Parts Discussed in Thread: CC2540

Good morning everyone,

I haven't been able to find the answer to this question on here yet, but I'm sure others have encountered it.  Has anyone figured out a way in IAR to preserve the secondary IEEE address while debugging?

 When I debug in IAR, the address gets changed to all FF's, and I have to reprogram it with the SmartRF flash programmer.

This is in the "annoyance" category, but after several months of dealing with this I'm deciding to speak up.

I notice that there is an option in IAR to retain certain flash pages, but I'm not sure where this address resides in the CC2540 flash.

Has anyone figured it out?

Thanks much!

Chris Norris

  • Hi Chris,

    I just tried and the secondary is preserved after debug with my settings. Is your .xcl linker file set to fill all empty gaps in the hex file with 0xFFFF?

    Check for this line below in the linker file and try commenting it out so that other areas of flash remain untouched.

    // Fill code gaps with 0xFFFF so that the .hex image produced is full.
    -HFFFF

    By setting the secondary address and reading the memory into a hex file I was able to determine the secondary IEEE location from 0x3FFEA - 0x3FFEF (little endian)

    I am also interested in where the primary IEEE addresses resides in flash or otherwise. I posted this question a while back but have had no response.

  • Good afternoon,

    I didn't see the "fill code gaps" line in my linker file.  I am on a 128kB part, so I'm using this linker file from the BLE SDK:

    C:\Texas Instruments\BLE-CC254x-1.2\Projects\ble\common\cc2540\ti_51ew_cc2540f128b.xcl

    Thanks for sending that secondary IEEE location, I'll try to find out if I can protect them another way.

    Regarding the primary IEEE address, I was able to see that information when I view the flash information page in the SmartRF flash programmer software.  According to the manual, "The flash information page (2 KB) is mapped into the address range (0x7800–0x7FFF). This is a read-only area and contains various information about the device."  

    The manual also describes the primary IEEE address for CC2540 as "48-bit IEEE address stored with
    least-significant byte first at XDATA address 0x780E."

    When the secondary address gets wiped out during my IAR debug, I notice that the TI stack uses the primary instead.

    Regards,
    Chris 

  • Thanks Chris, don't know how I missed that....