Friday, December 7, 2012

USB mass storage bootloader for the Stellaris Launchpad


Edit: prebuilt binaries now available at github!

I wrote a a bootloader for the Stellaris Launchpad (and other Stellaris boards/chips) that acts as a USB mass storage device.
It's inspired by the bootloader found on some NXP LPC microcontrollers.


Just plug in your board while holding SW2, it shows up as a tiny external drive, copy your firmware.bin to it and *bam!* your board has new firmware!
You can also download the current firmware from the drive.

It takes up 16kB of flash memory.
Please test it and report any issues!
Usage instructions at github.

Source code and prebuilt binaries: https://github.com/Emeryth/Stellaris-mass-storage-bootloader

 

6 comments:

  1. This is nice!
    Could you post this over at Stellarisiti ARM forums(http://forum.stellarisiti.com/)
    ... i know many will be interested.

    ReplyDelete
  2. Hi Andrzej, nice work!
    Will spend more time for free on "your tools" next time to thank you for supporting my hobby ;-)
    Greets, FSE

    ReplyDelete
  3. recommend that you change line 118 from if (ROM_GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_0)) to

    if (ROM_GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_0) && ((HWREG(HIB_RIS) & 0x1f) == 0x00))

    That way we can wake from hibernate with button 2 without accidentally going into bootloader MODE!

    Great work nonetheless!

    ReplyDelete
    Replies
    1. tested the code, this is the correct implementation

      if (ROM_GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_0) || ((HWREG(HIB_RIS) & (HIBERNATE_INT_PIN_WAKE)))){
      //Not pressed
      CallApplication(USER_PROGRAM_START);
      }

      Delete