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 am working on developing a bootloader for our MSP430F6659 MCU and consider to use custom BSL.
We found application note SLAA450.
I tried to use the example project SLAA450/5xx_6xx_BSL_Source/MSP430F552x_USB.The linker file I used is lnk430F5529_BSL_AREA.xcl. and change device to MSP430F6659. When I compile the project, got an error"
Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment CODE. Unable to place 18 block(s) (0x734 byte(s) total) in 0x72d byte(s) of memory. The problem occurred while processing the segment
placement command "-P(CODE)CODE=1010-17FF", where at the moment of placement the available memory ranges were "CODE:10d3-17ff"
Error while running Linker
So I comment "#define RAM_WRITE_ONLY_BSL 0x80" line 141 in BSL_Device_File.h, compiled without problem.
To try the BSL function I did the followed process.
1. Compile BSL project code and download via IAR
2. Inside application code, implement an invoke function,
__disable_interrupt();
((void(*)())0x1000)();
3. Compile application project and download via CCS.
4. During application running, call that invoke function to run BSL.
But when the application jump to 0x1000, I didn't see windows find the usb device. While before I program BSL, I tried the same way, Windows detect the usb device. So I believe after program custom BSL, it didn't work properly.
Can you please give me some advice to debug it?
Regards,
Jonathan
Jonathan,
do you want your custom USB BSL to always reside in Flash? If yes, this might be very difficult due the BSL Flash memory size limitation (<2KB). How the USB BSL works is basically as follows:
In the BSL flash memory, there is just a mini BSL which is then used to download the full size BSL to the SRAM (after receiving correct password) and run it from there. The real work is done then by the full size BSL.
What I am thinking is that you can just leave the default flash BSL in the memory, and instead create your RAM based custom BSL.
Thanks, Leo
As per your reply, do I need to do the following step:
1. Compile the RAM based custom BSL
2. Keep the default mini BSL, and invoke the BSL
3. Use a download tool eg. scripter.exe to download the custom BSL binary file to RAM
4. After custom BSL running, use download tool to program application code
Is my understanding correct? If yes, how can I recovery the default BSL since it is programmed and doesn't work?
Regards,
Jonathan
Yes,
basically that is the basic idea. The tricky part is that between step 3. and 4. mentioned by you above, you need to use the BSL_Scripter to do a jump to the starting point of the Custom BSL which has been copied into the RAM.
Regarding recovery of the default BSL image, you can find the copy in the SLAA450 associated files:
http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/CustomBSL/latest/index_FDS.html
You can download it using MSP430Flasher or Elprotronic Pro430 Lite:
but make sure the access is enabled, since the BSL Flash is per default protected:
**Attention** This is a public forum