Posts

Showing posts with the label bootloader

Secure Communication for Embedded Devices: Best Practices for Bootloader and Application

Image
Communication between the microcontroller's (MCU's) bootloader (BL) and server (SRV) that run at some online virtual machine can be secured. There is only one secret that needs to be properly secure and that is Preshared Key on both sides. Here I'll explain how we implemented secure communication between IMBootloader and our servers. I'll start with Preshared Key . It is a key that is stored at the SRV and the BL. It is only a preshared piece of information that will make sure both BL and SRV can communicate securely with each other. The Preshared Key is the same on both sides. On the SRV side, there are many different methods to secure the key, and only the person who has access to the server can get to it. The more problematic part is BL which will arrive to users at Hardware device. This is when Preshared Key is exposed. This is where FLASH read protections get in handy. For STM32 MCUs there is LEVEL2 protection that will make sure everything that is ...

How to read protect STM32 microcontrollers

Image
Pretty much all that is needed to enable RDP (read protection) is to enable level 1 of the protection by writing values between 0xAA - 0xCC to a specific register.   If you are using the STM32 HAL library you can check my integration as part of the function  FlashAdapter_setReadProtection  and function  ActivateProtection . After enabling RDP level 1 the whole flash will be read-protected. Once you decide to disable it the whole flash will be wiped out and no one will be able to read your binary. This is now part of the IMBootlaoder code. Once when you enable RDP protection all code is protected. The cool thing you can still update your firmware code by using the IMFlahser application, without disabling RDP .  You can ignore PCROP (Proprietary code readout protection). It is a cool feature that SMT32 also has, but I'll cover this in some future posts. 

IMBootloader got support for STM32F7

Image
 IMBootloader now has support for STM32F7 MCUs.  It was tested and developed at Pixhawk 4 board. Board has STM32F765II MCU.  Check the code here: https://github.com/IMProject/IMBootloader

IMBootloader - STM32H7xx / Mateksys H743-SLIM

Image
IMBootloader  is now supporting STM32H7xx microcontrollers. Development is done with  Mateksys H743-SLIM . IMBootlaoder has an IMLedBlink example for this board.   

Bootloader + Flashing App + Led blink example (opensource)

Image
Since almost every Embedded project needs a bootloader and application for flashing firmware, I've decided to open-source my solution. The idea is to have a universal bootloader for all microcontrollers and a single flasher application. Another idea is to have a flashing application that can run on all operating systems. This is where I open-sourced  IMBootloader ,  IMFlahser  together with the  IMLedBlink  example.  Let shortly explain them. IMBootloader Adapter functions For anyone who wants to port this bootloader, it needs to do it through adapter functions. The source file of adapter functions is here:  firmware_update_adapter.c Magic key IMBootlaoder is running at interrupt events from USB. In the beginning, it will check if firmware exists by checking the special part of flash and it will looking for the magic key. If the magic key exists bootloader will jump to the firmware. It is to keep booting time short as possible. If the magic key is not ...

SP Racing H7 Extreme - IMSSBL

Image
 This is a demonstration GUI application and second stage bootloader for SP Racing H7 Extreme board PX4 version.  It is designed as cloner protection for STM32 boars so if you are looking for a solution on how to protect your board you can contact me. For now, this is an application that can help PX4 developers or any other developer using the H7 Extreme board. It works with IMFlasher GUI and console applications.