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.
Hello All,
I am developing a custom BSL with the user Application as one project. I am publishing the code here:
How can I get the compiler to add the BSL code to the BSL reginon? It is possible that the compiler is not adding the code because it does not believe that it needs it. So the following is the BSL430_ Low_Level_Init.asm
Take a look at the line #28, I am referencing c_BSL_main, but the compiler is still not adding the function into the memory. If you look in the otp directory, I am specifying to place code into the BSL area by using CODE_SECTION pragma, but once I load the code, I cannot find it.
Hi Silver Diamond,
Does the BSL code show up in the TI-Txt file that you generate when you build your project? You can generate a TI-txt binary file in CCS following the steps here: http://processors.wiki.ti.com/index.php/Generating_and_Loading_MSP430_Binary_Files?keyMatch=msp430 binary&tisearch=Search-EN#Using_CCS_v6.x
I'm wondering how you are viewing the BSL area after loading - if you use CCS to load the code and are then viewing this area in the Memory browser of a debug session, I think that you might only see 0x3FFF in that area because of the BSL protection being set by SYSBSLPE - I think you'd have to clear that bit before the actual values would show up. A better way to check that your BSL is properly loaded in the BSL area might be to use the Elprotronic Fet-Pro430 Lite software to read back the memory of the device, including the protected BSL memory. I think that this software will clear the SYSBSLPE bit before reading the area so that it reads back the actual stored values so you can compare.
Hope this helps,
Katie
Hi Kate,
First, I did generate the hex file it is here:
I thought of another way to infer what is in the BSL region by looking at the .map file:
It looks like the BSL has 0x7B1 bytes of code in it.
So to look at the code, I do use the MSP430-FET430UIF with the CCS6. The SYSBSLPE is off:
But can anything be wrong with the JTAG lock key which is set at the end of this file:
github.com/.../BSL430_Low_Level_Init.asm
Also, here is what I see using CCS, my code supposed to start at highlighted location:
OK so found the answer, in order for the linker to place a piece of code into the memory, it has to be somehow tied to main() function. Since I have two applications running on the system, one is the user application, the other one is the BSL, pragrma needs to be used, so adding:
#pragma RETAIN(cBSL_main)
told the compiler to include the cBSL_main function and everthing that the function needs.
(The new code has been pushed to github)
**Attention** This is a public forum