cancel
Showing results for 
Search instead for 
Did you mean: 

Where and how are some SYSCFG registers stored?

Mr_M_from_G
Senior II

Hello,

I read ref manual part about SYSCFG (STM32H7 in my case). There are some regs that have an undefined reset value and the meaning of the regs is so that the contents is important at HW reset (BOOT_ADDx, BANK_SWAP). These regs are marked read only.

I couldn't find anything, how to set the values and where they are stored. Can I change them somehow from my software, ie change the boot address or swap the banks for the next reset?

General topic is to design a custom bootloader that will also be called after reset when BOOT0 is set. Also a fall back to the previous version after a corrupted firmware upload would be nice.

Thanks a lot

Martin

11 REPLIES 11
Andreas Bolsch
Lead II

Cross check with flash option bytes/registers: You will see the bits in question (with unspecified reset value) are duplicated in the option bytes (well, havent't check this for every bit, but at least most of them). Possible reason: For security reasons, it might be useful to block accesses to the whole flash controller (and consequently option bytes) but still being able to access some of these bits.

If you want to modify the read-only bits in SYSCFG, modify the corresponding option bits via the flash controller (and initiate a reload of the option byte registers). Whether the writable bits "survive" reset, see table 41 in the RM: For a power-on reset there is FL_OPTB, so the option byte *registers* (and the corresponding SYSCFG bits) are loaded from the option bytes *in flash*. However, for a reset by NRST pin, there is no FL_OPTB, so the registers retain their current setting. Makes sense: You can temporarily change the boot address, issue a reset, and the new/alternative firmware starts cleanly ...

Regarding BKS in SYSCFG_UR0: see SWAP_BANK_OPT

Mr_M_from_G
Senior II

Thanks Andreas for this information, I wasn't aware of that link between SYSCFG and FLASH