tml 19 Posted June 13, 2014 Share Posted June 13, 2014 Hi,I have spent quite a significant amount of time to figure out how and then write a simple bootloader for MSP430F5529 that I would like to share with you.It was written for mspgcc (4.6.3) and uses small memory model; for accessing high flash (20-bit addressed) I use some simple assembler inlines. It won't work out of the box in CCS.This project is fully functional and I use it to remotely reflash my weather station (https://plus.google.com/u/0/photos/102121325118286323880/albums/5936572393229426625?authkey=CJ3N8Y2CtJiOIQ). I just push the new application image onto the web server, then the application working on the target device downloads it, parses and puts onto the flash and then lets the bootloader do the rest of the work.The methods used for reflashing are kinda primitive (e.g. word access, while the block write would be way more efficient), anyway, I had to have this up and running in reasonable time.I think making the code CCS-compatibile is not a big deal, the main part is flash access enclosed in flash.c. Moving code to RAM is even simpler in CCS with LOAD and RUN directives.Anyway, any issue reports and comments are welcome!repo url: https://bitbucket.org/eltomek/msp430bootloaderBest Regards,Tomek EDIT: fixed the link to the repo. Automate, GeekDoc, reaper7 and 3 others 6 Quote Link to post Share on other sites
zlalanne 37 Posted June 13, 2014 Share Posted June 13, 2014 Thanks for sharing Tomek! You should post more details about the weather station, the pictures of it look pretty nice! Quote Link to post Share on other sites
tml 19 Posted June 16, 2014 Author Share Posted June 16, 2014 Thanks for sharing Tomek! You should post more details about the weather station, the pictures of it look pretty nice! Hi, I will definitely share all the details about my project when only it gets done, deployed in the field and the code is polished to the minimum extent needed for it to be shown to the people ;-) Right now it's full of todos and hacks. I plan to release it as an open hardware and open software project, the first will be easier though. Best Regards, tml Quote Link to post Share on other sites
rockets4kids 204 Posted June 17, 2014 Share Posted June 17, 2014 Why did you choose this route over the internal BSL? Quote Link to post Share on other sites
tml 19 Posted June 18, 2014 Author Share Posted June 18, 2014 Why did you choose this route over the internal BSL? When I started thinking about doing the bootloader I indeed got interested in the BSL but then I found out over the websites that: 1. invoking BSL requires a physical reset (source: http://processors.wiki.ti.com/index.php/Custom_MSP430_BSL#Device_Startup_Sequence - " NOTE: The boot code will be only executed on hardware reset (pulling down the /RST signal). Software reset such as using watchdog timer, setting the PMMSWBOR or PMMSWPOR of PMMCTL0 will not trigger the boot code.") 2. it needs to be written in plain asm (source unknown). I still don't know whether this is true and don't understand why can't this be written in C. I did not dig into this question as I decided to go with the current form of the bootloader. If you can put more light onto this I'd be more than happy! Best Regards, tml bluehash 1 Quote Link to post Share on other sites
iOperator 0 Posted June 27, 2014 Share Posted June 27, 2014 Hi Tomek, cool weather station project! Btw, you can always invoke the TI BSL by jumping to 0x1000 from your application, without any physical reset... The project you are linking to (Custom MSP430 BSL) is not the official TI BSL. The official one is written almost completely in C. You can find more info on this here and here. Good luck with your project and best regards, Max Quote Link to post Share on other sites
tml 19 Posted June 27, 2014 Author Share Posted June 27, 2014 Hi Tomek, cool weather station project! Btw, you can always invoke the TI BSL by jumping to 0x1000 from your application, without any physical reset... The project you are linking to (Custom MSP430 BSL) is not the official TI BSL. The official one is written almost completely in C. You can find more info on this here and here. Good luck with your project and best regards, Max Thanks for good words! As for jumping to 0x1000 it's ok but it needs a sane application - if a damaged one gets flashed it will be unable to jump to BSL for recovery. Best Regards, Tomek Quote Link to post Share on other sites
iOperator 0 Posted June 27, 2014 Share Posted June 27, 2014 You are right with the sane application. A CRC check in your start up code, a update mechanism that would copy the new firmware, checks it, the marks it for safe execution or similar could probably help... Quote Link to post Share on other sites
martenskyle51 0 Posted February 5, 2015 Share Posted February 5, 2015 The repo link is bad and I am working on a very similar project and would love to see it Quote Link to post Share on other sites
tml 19 Posted February 5, 2015 Author Share Posted February 5, 2015 The repo link is bad and I am working on a very similar project and would love to see it Fixed the link in the main post, sorry! I will need to rework the bootloader to add PetitFs + microSD supportso that it makes backup and reflashes from the SD, not the MCU flash. This way the working image size can be extended to MCU flash size minus bootloader coode size. So if you planned similar functionality and can open the source that'd be great! :-) Quote Link to post Share on other sites
martenskyle51 0 Posted February 5, 2015 Share Posted February 5, 2015 you don't know how happy this makes me. My College senior design project is using the same LP and needs to do remote firmware updates over satellite communication. Thanks for sharing Quote Link to post Share on other sites
tml 19 Posted February 5, 2015 Author Share Posted February 5, 2015 you don't know how happy this makes me You don't know how happy this makes me that my 1st open source project is useful for somebody! All you need to do is from the host application to store the proper image on the download area of the MCU's flash and then manage the bootloader flags. If you had any problems please let me know. Quote Link to post Share on other sites
martenskyle51 0 Posted February 10, 2015 Share Posted February 10, 2015 So if I create a program all i need to do is store it and the vector table in the proper location, set the image status flag and reset the device correct? Quote Link to post Share on other sites
Mach1 0 Posted February 3, 2019 Share Posted February 3, 2019 Take a look at this http://www.ti.com/lit/an/slaa600d/slaa600d.pdf regards Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.