Jump to content
43oh

Simple MSP430F5529 bootloader


Recommended Posts

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/msp430bootloader

Best Regards,
Tomek

 

EDIT: fixed the link to the repo.

Link to post
Share on other sites

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

Link to post
Share on other sites

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

Link to post
Share on other sites
  • 2 weeks later...

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

Link to post
Share on other sites

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

Link to post
Share on other sites
  • 7 months later...

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! :-)

Link to post
Share on other sites

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!  :biggrin: 

 

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.

Link to post
Share on other sites
  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...