cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable dual bank flash programming in STM32FlashProgrammer?

paolog
Associate III

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Houda GHABRI
ST Employee

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

View solution in original post

7 REPLIES 7
SofLit
ST Employee

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.

0693W00000JOp5SQAT.png

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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.

paolog
Associate III

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...

paolog
Associate III

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.

SofLit
ST Employee

Hello @Houda GHABRI​ ,

Could you please check this please :) ?

Thank you.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Houda GHABRI
ST Employee

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

Thank you, Houda.

Looking forward to see the update, then.

Paolo