2018-07-03 03:06 AM
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.
2018-07-03 05:18 AM
>>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.
2018-07-03 11:43 AM
But Clive,
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
2018-07-03 12:05 PM
Pretty sure it just blind writes the values it wants in RCC_AHB1ENR, which might be inconvenient
2018-07-06 10:59 AM
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.
2018-07-10 05:47 AM
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
2018-07-10 06:48 AM
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
2018-07-10 08:41 AM
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
2018-07-10 09:00 AM
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
2018-07-11 07:10 AM
Hello
Waclawek.Jan
,CCM RAM should be re-enabled by user code at startup. This will be mentioned in AN26
With Regards,
Imen