2/29/2024 – OPP STM32 now has a bootloader!

Good gosh. I started working on the bootloader it seems like multiple years ago. Well, I finally got around to finishing it this past month. You may wonder what a bootloader does for you? Well, you can now update the OPP firmware (from this version onward) without plugging in the debugger, moving jumpers, etc. All previous versions of OPP hardware supported a bootloader, but since the STM32 contains the USB within the processor, it was significantly more difficult to support.

So the first 4K of the processor flash is now reserved for the bootloader. The application then sits above the bootloader. The bootloader verifies that the application is valid (by calculating a CRC32 over the application) and then, if it matches the stored value, it jumps and starts running the application. I have seen other bootloader for the STM32 which take up to 20K of the flash. That seemed a little bit ludicrous, (and wasteful of resources), so I worked to make it as small as possible.

The newest version of OPP that contains the bootloader is 3.0.0.0. You can grab it from the repository, but to get this version onto your board you will need to load it through a ST-LINK V2. After that initial load, the python script located at repos/Python/Stm32UpdApp/updApp.py can update to newer versions of code.

While I was mucking around in python scripts, I updated Gen2Test.py to support both python 2.x and python 3.x. No more forcing people to load python 2.x just so they can program OPP firmware. (updApp.py also supports both python 2.x and python 3.x and has been tested on windows boxes and linux (ubuntu) boxes). Hopefully that is enough testing for most systems.

The last new python script is found in repos/Python/Stm32UpdApp/showMeTheCfg.py. This script jumps to the bootloader, reads the configuration sector, and then makes a report of the configuration in hopefully easy to read and understand descriptions for each pin. The script works on hardware, or can use the configuration file used to program the board with Gen2Test.py. It looks at the configuration and points out any configuration errors that it finds. The configuration is only for STM32 based OPP configurations (not PSOC4200 (Gen2) based or HCS08 (Gen1) based hardware).

At this point, I don’t know of any other features people have requested to be added to OPP. This code would allow MPF to automatically update hardware OPP STM32 if people so desire it. I don’t think there are any real plans for that, but hey, it is a possibility. That’s all I have.

Happy leap day everyone!

-H

Leave a comment