cancel
Showing results for 
Search instead for 
Did you mean: 

debug OEMiRoT-Boot project on U083 possible?

Hans_W
Associate II

I'm aiming to use the OEMiRoT sample project as a concept for secure updating of a large single-slot application in STM32U083 (need application size at least 160kB for migration from STM32L071). For that I need to give the bootloader a driver for external SPI flash where the encrypted updates can reside that the application downloads. 

The How_to_start_with_OEMiRoT_on_STM32U0 manual doesn't address the concept of debugging OEMiRoT at all. The provisioning procedure works, using RDP level 0 (even with modified code, as I can see an error printout that I added in the bootloader init).
Starting a debugging session after this provisioning results in the debugger not being able to erase the sectors, on the other hand after erasing the chip beforehand (using ob_flash_programming.bat upto the erase part) it succeeds and I can debug, but immediately run into the protection mechanisms generating errors.

Is there any manual how to debug this project and which defines to disable/modify to debug the low level drivers before activating all protections again? To my surprise there isn't even a difference in preprocessor defines for the debug and release builds to automatically disable some of these protections in the debug build.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Jocelyn,

indeed I added a define in debug-build only to disable that line using an #ifdef as well as having the Error_Handler() return after a delay to continue as the boot lock isn't set either after chip erase and it whould hang a few lines later in LL_SECU_CheckStaticProtections().

Actually I was expecting something like that to be present in the project already to allow debugging while preventing the release build to miss some of the protections by automatically applying them in release.

I understand this project is a bit new.

Best Regards,

Hans

View solution in original post

3 REPLIES 3
Jocelyn RICARD
ST Employee

Hello @Hans_W ,

did you try disabling the write protection in boot_hal_cfg.h in the OEMiROT Boot project ?

Something like this

// #define WRP_PROTECT_ENABLE

Normally this should allow you to use debugger on the secure boot without issue, as if is was a simple application.

Best regards

Jocelyn

Hi Jocelyn,

indeed I added a define in debug-build only to disable that line using an #ifdef as well as having the Error_Handler() return after a delay to continue as the boot lock isn't set either after chip erase and it whould hang a few lines later in LL_SECU_CheckStaticProtections().

Actually I was expecting something like that to be present in the project already to allow debugging while preventing the release build to miss some of the protections by automatically applying them in release.

I understand this project is a bit new.

Best Regards,

Hans

Jocelyn RICARD
ST Employee

Hello @Hans_W ,

the debug/release configurations are unfortunately not used for enabling/disabling these protections.

So, you need to adapt your configuration manually.

Best regards

Jocelyn