STM32F437 can't start ChibiOS after enabling/disabling RDP

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
trepidacious
Posts: 58
Joined: Mon Jan 21, 2013 3:36 pm
Been thanked: 1 time

STM32F437 can't start ChibiOS after enabling/disabling RDP

Post by trepidacious »

We’ve run into an odd issue with flash read-out protection (the RDP bits in OPTCR), on an STM32F437, ChibiOS 2.7. We have firmware that runs fine on a board with an MCU on with default settings (as supplied by ST), however if we enable RDP protection level 1 and then return to level 0 (erasing the device), we cannot get the firmware to run again, even after apparently reflashing the firmware correctly. The firmware seems to hang at:

Code: Select all

ResetHandler () at ../ChibiOS-RT261/os/ports/GCC/ARMCMx/crt0.c:274
274          asm volatile ("cpsid   i");

We’ve checked all the user option bytes, and they seem to be the same on an MCU direct from the factory and the device that has been read-out protected and then unprotected, at least according to the ST STLink utility under windows (we’ve used this for all stages).

It seems very likely that we’re just missing some STLink setting or operation, but I thought someone might have run into this before, or that there might be some interaction between RDP and ChibiOS. We can certainly run some more tests if anyone has any suggestions - we're cautious about enabling read-out protection on any more boards, since we've bricked several so far!
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F437 can't start ChibiOS after enabling/disabling R

Post by Giovanni »

hi,

That is a privileged instruction, is it possible that the device is running in user mode for some reason? it is not even related to ChibiOS, it is in the startup file.

Giovanni
trepidacious
Posts: 58
Joined: Mon Jan 21, 2013 3:36 pm
Been thanked: 1 time

Re: STM32F437 can't start ChibiOS after enabling/disabling R

Post by trepidacious »

Many apologies - we've now repeated all stages of the process on another PC, and this time the board boots fine. I think we may have had an issue with utility settings and/or Windows drivers, and ended up with incorrect flash contents. The odd thing is that verification worked fine, and the contents looked ok, the boards just wouldn't boot. I'll report back if I work out what the exact issue was, but it's clear it's not ChibiOS! Thanks for your response :)
Post Reply