Jump to content

Bootloader for MSP430

Recommended Posts

Hello guys,

I don't know how many of yous have watched this by Simpleavr quoting:


boot430 usb bootloader capability demonstration. 1. flashing of bootloader via TI launchpad. 2. RGB blinky app via bootloader. 3. LED digit counter via bootloader.


I feel quite excited, that means we will have similar functionality to Arduinos, with a simple serial bootloader!

Link to post
Share on other sites
I feel quite excited, that means we will have similar functionality to Arduinos, with a simple serial bootloader!


this is just a patch up use case for the bbusb bit-bang usb framework done by mathias and oPossum. it has it's potentials, but i won't compare it w/ arduinos, arduinos are a complete ecosystem (don't know if i use the word right) that includes libraries, h/w, tutorials, support channels, etc.


the bootloader u saw comes from a reference project from v-usb. in some ways it's more useful than arduino as u don't need usb / uart circuit. but than the application also cannot communicate w/ PC via uart / acm.cdc etc.


my intention is to try various use cases for bbusb and harden the framework for general use. i had tried mouse, keyboard and others had try joy-stick type setups. it is just nature for me to try a bootloader use case as they are also popular in v-usb usages. i am also very interested to get a bootloader working so that i can build "everything on an usb key" type of projects. 


there are still works be done on this bootloader before i intend to check it in github. i will provide a brief description here for the time being.


current features:

. supports g2553, up to 12k applications (just for addressing convenience, bootloader actually taking only 2.4k)

. linux and windows w/ cygwin tested.

. transfer is reasonably reliable. (via some checking and avoiding a bug / deficiency in bbusb)

. port 1 interrupt does not work at the moment. (more on that)

. support only no-crystal version of bbusb.

. bootloader init() checks for D- pull-up, if not present, runs application immediately.

. if D- pull-up present, wait 1 second for usb reset from host, if that does not happen, runs app.


at the moment the bootloading is not done in a "right" way, no bulk transfers and code hacked to avoid a bug / deficiency in bbusb. i (and may be others) are trying to fix bbusb so that things can be done right.


the other bigger issue is that unlike some other high-end chips, the g series does not support interrupt vector table re-location. so i am faced w/. this problem.


. the bootloader uses bbusb which in turn uses port1 interrupt to work the usb. this is the only interrupt the bootloader uses.

. upon firmware update request, the target application's interrupt vectors are "mapped" w. the bootloader's.

. so the final interrupt vector on the device is "mostly" of the app's, except for RESET which points to the bootloader init() and port1 which we need for usb.


i currently do not have a very good way to handle the port1 interrupt. if u have any idea, please reply and see if we can make it work.








Link to post
Share on other sites

At least back it up to bitbucket, they have free private git repos then you can flick it up to github in one commit history squash.

it's really messy now. i can't show all my messy work and comments (will definitely introduce a lot of WTFs :-o ). will try and clean it up a bit this week and upload.

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

changes since releasing video.


  • supports both 8k and 16k devices
  • fixed bug in assembler code regarding SE0 checks (fixes from Mecrimus-B).
  • loaded application can share same port 1 interrupt w/ bootloader (w/ a slight delay).
  • include two example apps as show on video.


thanks Mecrimus-B, oPossum, Christian Starkjohann for the ground works.


source code now available for the adventurous.




please see README on github project page for more detail.

Link to post
Share on other sites

Join the conversation

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

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...