cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected CCM state after using the STM32F4 boot loader

Richard Braun
Associate II
Posted on July 03, 2018 at 12:06

Hello,

We use the STM32F4 boot loader to load a firmware directly to RAM and run from there, and we noticed that, for an unknown reason, the CCMDATARAMEN bit of RCC_AHB1ENR is not set, making the CCM unusable for very early initialization. Setting the bit manually before any access solves the problem. I'm not sure if this is expected behavior (in which case it ought to be documented in the boot loader application note) or a boot loader bug. Our MCU is an STM32F427.

Thanks.

9 REPLIES 9
Posted on July 03, 2018 at 14:18

>>I'm not sure if this is expected behavior (in which case it ought to be documented in the boot loader application note) or a boot loader bug.

The Boot Loader doesn't use the CCM, why would it initialize clocks for it, or any other peripheral it is not using?

Like the External Loaders (ST-LINK Utilities, Cube Programmer), you need to initialize clocks, pins, peripherals and functionality you expect to use, on your specific board, as implemented.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 03, 2018 at 18:43

But Clive,

0690X0000060Lb0QAE.png

I'd say the bootloader upon exit attempts to do housekeeping and restore registers to their reset values; and this is a bug in the bootloader.

JW

Posted on July 03, 2018 at 19:05

Pretty sure it just blind writes the values it wants in RCC_AHB1ENR, which might be inconvenient

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 06, 2018 at 17:59

That's what I suppose as well, I'm just reporting it in case ST devs are interested in setting that bit / making it explicit in the doc that it's cleared, and also for other people who may hit the issue to quickly find some knowledge about it.

Posted on July 10, 2018 at 12:47

Hello,

We confirm, the reset value in the reference manual RM0390 for the RCC_AHB1ENR register is wrong (0x0010 0000) and will be fixed soon to

(0x0000 0000)

With Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on July 10, 2018 at 13:48

Hi Imen,

No, no, the reset value for RCC_AHB1ENR register IS CORRECT! The CCM memory *is* enabled after reset.

The problem is in the bootloader - when the bootloader exits, it appears to do some housekeeping and stores zero into all RCC_AxByENR registers - but this is incorrect for the RCC_AHB1ENR register. The bootloader ought to store 0x0010'0000 unto it upon exit.

JW

Posted on July 10, 2018 at 15:41

Hi 

Waclawek.Jan

,

You are right. In fact, th

e reset value 

error is for the RM0390 and NOT RM0090.

I will raise the 

bootloader issue

 to the appropriate team for check and fix.

With Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on July 10, 2018 at 16:00

Imen,

Ah, so it's a separate issue... I didn't realize you've mentioned RM0390 (i.e. 'F446 - that does not have CCR so it's just logical the reset value is 0 there).

Thanks for the clarification.

Jan

Posted on July 11, 2018 at 14:10

Hello

Waclawek.Jan

,

CCM RAM should be re-enabled by user code at startup. This will be mentioned in AN26

With Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen