Hello,
I have recently tried to create a custom BSL for the MSP430F5342 device using the template found in the MSP430 Custom BSL Package.
I used the template for the MSP430F543xA device and changed the memory map to a) adapt it to my device and b) load the BSL code into the BSL section (according to the .map file in the template, the code is loaded into flash starting at 0x10000 instead of the BSL area starting at 0x1000.) When trying to load the sample BSL code into the BSL area, there is not enough space and so an overflow area is needed. To accommodate this, I made the following modifications to lnk_msp430f5342.cmd:
In the MEMORY section:
/* Get rid of INFO MEM sections INFOA : origin = 0x1980, length = 0x0080 INFOB : origin = 0x1900, length = 0x0080 INFOC : origin = 0x1880, length = 0x0080 INFOD : origin = 0x1800, length = 0x0080 //Use this area for BSL OverFlow */ // Added BSL & BSLOF (overflow) section ------------------------------- BSL : origin = 0x1042, length = 0x7AE BSLOF : origin = 0x1880, length = 0x200 // --------------------------------------------------------------------
in the SECTIONS section:
//Place all output sections into newly defined memory sections .text : {} >> BSL | BSLOF // Code .text:_isr : {} >> BSL | BSLOF // ISR code space .cinit : {} > BSL | BSLOF // Initialization tables .const : {} >> BSL | BSLOF // Constant data .cio : {} > RAM // C I/O Buffer .pinit : {} > BSL | BSLOF // C++ Constructor tables .binit : {} > BSL | BSLOF // Boot-time Initialization tables .init_array : {} > BSL | BSLOF // C++ Constructor tables .mspabi.exidx : {} > BSL | BSLOF // C++ Constructor tables .mspabi.extab : {} > BSL | BSLOF // C++ Constructor tables #ifdef __TI_COMPILER_VERSION__ #if __TI_COMPILER_VERSION__ >= 15009000 .TI.ramfunc : {} load=BSL | BSLOF, run=RAM, table(BINIT) #endif #endif
The project compiled successfully and I was able to load it into the device. However, after loading it a few more times I am no longer able to access the device and get the message that
"Error connecting to the target:
The Debug Interface to the device has been secured"
I do not understand why this happened. I checked the BSL430_API.c file and the lock key is still 0xFFFFFFFF in my project so the JTAG fuse should not have blown. What is causing this behavior? Is it possible to unlock the device?
Thank you,
svl123