TI E2E Community
MSP430 Ultra-Low Power 16-bit Microcontroller Forum
Separate BSL and application codes
I like to implement the ‘Overall guidelines for ROM-based BSL (1xx, 2xx and 4xx Devices)’, from the TI wiki:
However it is not clear to me how to separate the BSL code and the application code, and how to protect the BSL code from being erased.
Is there any code example that I can start with? Or is there a suitable application report that you can recommend?
I am working on a 4xx unit, if that matters.
If you are working on a 4xx, BSL is in the BSL-ROM of the chip. Application code can only reside in Flash or RAM. Both Flash and RAM are separated from the BSL-ROM. And ROM cannot be erased.
Yes I know, the BSL code is on the ROM, see wiki link above. I would like to do what's in the wiki, and I don't know how to separate 'myBSL code' (invoking the BSL from software) and the application code on the flash. Perhaps this is a bit more to the point. Please read the wiki, it's no point of having me reciting it.
I did not read the wiki before. I think the entire Section 3: Overall Guidelines for ROM-based BSL (1xx,2xx and 4xx Devices) does not make any sense under that heading. I think they should be under the heading: Custom MSP430 BSL for 1xx/2xx/4xx Devices.
For 1xx, 2xx and 4xx, there is a ROM-based BSL in ROM. It is already protected and it is already separated from the application. If you want to implement a Custom BSL in Flash, then you have to think about how to protect it and how to separate form the application.
I just like to implement what's in the wiki, Section 3: Overall Guidelines for ROM-based BSL (1xx,2xx and 4xx Devices). Any suggestions how to do this?
I am currently trying to do this as well.
I am using a 2619 and have a very limited pin out.
From what I gather from the wiki, is that you make a custom bsl section in the linker command file, then when (lets say the UART) recieves the command "Firmware Update" it starts the users firmware update code: ie you make some protocol and erase the flash that you want and reprogram it from the .hex file information streaming in from the UART.
At least that it what it seems like...
If I get anywhere with this today I will post up my code.
Ok well after reading the program "appl.c" it is a little more appearent how to impliment this.
If you download the CUSTOM_BSL_APP.zip and CUSTOM_BSL.zip. files from the wiki page it goes through everything.
I will attempt this again when I am actually at my desk for the day.
I have played with this quite a bit and cant seem to get a working version.
I set up a system like in appl.c in which I separate the flash memory (f2419-two flash memory sections) and go to the address where the "bootloader" is located.
In the bootloader I manually put in a string that contains the contents of a ti-hex file.
The problem with this is that when you erase the flash you loose the c_int00 information. I tried a few ways around this but I could not get it to cooporate.
There is also a bug of some sort in the rts library, since I could not install manually a c_int00 section into the linker file without getting errors.
Then I found some one on the e2e forum saying that you needed to make the "bootloader" into two seperate projects. http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/47205.aspx
I did this and found that when I would jump to my custom "bootloader" it would not execute the code.
There seems to be quite a few threads on this, but there are no concrete examples anywhere to be found.
Anyone have any comments on this?
The immediate problem you are facing is the limitation (or "feature") of the tool you are using. What are you using? And in c or assembly? The limitation (or "feature") can be worked around.
Once you managed to load both your Application and your BSL in Flash (at separated segments), how do you decide which one to run after Reset? And how to switch to the other one?
I have been pondering this as well. My immediate thought is that I make a custom reset vector for the BSL that is called by software. Then have get the run time enviroment up and running. That seems to be the tricky part. Oh and I am writing in C.
The only other issue with that I am finding so far is syntax. I can not seem to get it to work in the Linker file. (With the C2000 I can do this, but I get an error with the 430)
I wonder why people would want to follow the ‘Overall guidelines for ROM-based BSL (1xx, 2xx and 4xx Devices)’, from the TI wiki: http://processors.wiki.ti.com/index.php/BSL_(MSP430)That guideline essentially says:(1) Those devices have a ROM-based BSL But ignore that BSL and roll your own BSL.(2) Your own BSL will only start if the CRC check of your Application is incorrect. Otherwise your Application will automatically start.This seems to mean:(a) Overall speaking, the ROM-bases BSL is worthless.(b) The CRC check of our Application may corrupt and at that time your BSL can reload your Application.(c) Other than that situation, if you want to run your BSL, you have to wait (or cause) a CRC check of your Application.
I will post up a more thorough post later, but I got two seperate projects running on one chip. Now I just have to implement the UART to the bootloader/monitor project to load the data into the sections that are being reflashed.
I will post my code when I get the custom BSL finished.
old_cow_yellowOverall speaking, the ROM-bases BSL is worthless.
old_cow_yellowOther than that situation, if you want to run your BSL, you have to wait (or cause) a CRC check of your Application.
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.
The whole section should be rewritten, since as it stands there's no mention of actually using the ROM BSL anywhere. And the "guidelines " seem to be a hodgepodge of things for ROM and custom BSL.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.