2022-02-07 03:12 AM
I'm trying to program firmware of more than 1Mb into an STM32L4R5 that has 2Mbyte flash in dual bank. The STM32FlashProgrammer reports a device with 2Mbytes, but during programming only 1Mbyte is reported, and firmware is not transferred.
DBANK bit in OPTR register is set, and I couldn't find any help on documentation and websites.
Thank you for any suggestions!
Solved! Go to Solution.
2022-02-14 05:03 AM
Hi @paolog ,
Thanks for your feedback.
We are already aware about this issue , it will be fixed in next CubeProgrammer release 2.10.0 .
Ticket number: 121361 (PS: This is an internal tracking number and is not accessible or usable by customers).
Hope this helps you.
Houda
2022-02-07 04:12 AM
Dear @paolog ,
Dual bank is configurable by option bytes. Option bytes settings are available in STM32CubeProgrammer. Click on "OB" button as indicated in the following photo and you will access to all option bytes settings.
2022-02-07 05:29 AM
Thank you for the prompt reply, @Community member
As I wrote, the DBANK bit in OPTR register is set but still the programmer reports 1Mbyte of flash to program (while under the ST-Link windows reports 2MBytes). Is there any other flag I should check?
I didn't mention that the board is a NUCLEO-L4R5ZI.
2022-02-08 01:52 AM
Ok, on STM32L4+ reference manual RM0432 I found out at 3.3.1, table 7, that setting DBANK=0 the main flash memory is seen as contiguous 2Mb addresses (256 pages of 8kb), exactly what I need. Clearing the DBANK using the STM32 Cube Programmer shows me in erasing and programming screen a list of 256 pages with contiguous addresses.
But programming the firmware gives a size error:
10:47:13 : Memory Programming ...
10:47:13 : Opening and parsing file: firmware.bin
10:47:13 : File : firmware.bin
10:47:13 : Size : 1881756 Bytes
10:47:13 : Address : 0x08000000
10:47:13 : Erasing memory corresponding to segment 0:
10:47:13 : Erasing internal memory sectors [0 229]
10:47:23 : Download in Progress:
10:47:23 : Error: file size is bigger than the flash memory size.
10:47:23 : Error: failed to download Segment[0]
10:47:23 : Error: failed to download the File
Where could be the problem?
Edit: Interesting. I finally found a post about the same problem, solution seems to downgrade STM32CubeIDE to 1.7 (even if I have an error from STM32CubeProgrammer 2.9.0-RC01). I'll try downgrading the flash programmer...
2022-02-08 05:37 AM
Nevermind. It's definitely a bug of the STM32 Cube Programmer, flashing the firmware using another toolchain works as expected. I hope this bug is going to be solved (I found out this happening with other MCU's) as it prevents from using the flash programmed and the Cube IDE.
2022-02-14 04:02 AM
Hello @Houda GHABRI ,
Could you please check this please :) ?
Thank you.
2022-02-14 05:03 AM
Hi @paolog ,
Thanks for your feedback.
We are already aware about this issue , it will be fixed in next CubeProgrammer release 2.10.0 .
Ticket number: 121361 (PS: This is an internal tracking number and is not accessible or usable by customers).
Hope this helps you.
Houda
2022-02-14 06:08 AM
Thank you, Houda.
Looking forward to see the update, then.
Paolo