This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G3507: In system programming.

Part Number: MSPM0G3507

Tool/software:

I had looking into this a while ago and am now just coming back to the project, so i still have to bring myself up to speed, but wanted to ask this before i went too far.

in my application, i'd like to be able to program my device in system, with a failsafe, so if programming did not finish or fails that the safe boot occurs.
i communicate to it from software->fpga->spi->mspm0

i think i remember seeing a boot loader that could verify images and load failsafes, but i wasn't sure how that is beneficial. I need my spi protocol in order to gather data, i've tested this where i can send a block of data into a ram buffer, just need to write it into flash.  i was hoping that i could use the same code for my factory and latest image to not have to maintain different code.  i wans't sure how to make different configurations and make sure that each configuration was located in different halves of flash, how they know if they are the factory or latest (probably can know where their program is located), and how to fall back to the other if they fail or corruption of image is detected.

any things you can point at or recommend would be helpful.  i'll follow up with more questions after i get back into it.

thanks.

  • Hi,

    What you said is seems a security boot requirement. You could take a hash verification of the image after the image has been loaded before you run the program. And also if there is any fail occurs, you could select to run from a older version program. 

    You could check the below example for a boot management on M0G3507:

    And also if you want to know more about MSPM0 default bootloader protocol, you could refer the application note:MSPM0 Bootloader User's Guide

  • first, i dont need security, i want the ability to down-rev firmware, i only want to prevent from bricking devices in the field.  as long as they can boot into programming mode on a bad flash i'm happy.

    i first impliemented my own protocol, so i have communications from software to the micro... i'm using SPI running at 15mhz
    everything is functioning but now i'm looking to work on in system programming.

    i'm not sure what direction i should be going.
    i was hoping that i could just compile 2 different programs located at different locations in flash and jump to the factory image in order to reprogram the latest image.  is this feasible?

    i'm guessing you are trying to guide me to using the boot manager, can i modify the boot loader to use my spi configuration and protocol?

    do i have to remove all my working SPI communication and replace with I2C to my fpga in order to use the boot application?

  • Hi,

    Understood that you have your own SPI communication protocol and just want to migrate it to MCU to achieve a reliable bootloader function.

    Firstly, of course you could keep you current SPI configuration as your boot loader, actually bootloader is just another application program that achieves a communication to program a application image to a point address. We provide a ROM bootloader and some example for reference, but if you have your own protocol, you could achieve the whole communication protocol as you desired. It has the same purpose: make sure the image is well placed in target address after bootloader.

    And for your desired down-rev firmware function, I understood you do not need security function, but I think the hash is a good way to achieve your requirement. Image that, every time the MCU power on, it firstly check the hash of the new version image, if it is not matched (caused by some unexpected behavior during bootloader), the program will not jump to the new version image and directly go to the older version image instead. I do not need the signature verification function, just hash is enough for your requirement to check whether the image is "good".

    Best Regards,

    Pengfei