Skip to main content
Associate
Apr 15, 2024 8:56 AM UTC
Question

STM32G0B1CBT6 Dual Bank Upgrade, Unable to Write Flash when running on Bank2

Using Dual Bank for upgrade feature and the last 2K section of Flash is used to store configuration data.
When the program is running in Bank1, reading and writing the configuration data work. But when the program is running in Bank2, Cannot write the flash configuration data correctly.

This topic has been closed for replies.

3 replies

ST Technical Moderator
Apr 15, 2024 12:32 PM UTC

Hello @fsc1121 

Which setting used for Prefetch and Cache? Do you have PREFETCH_ENABLE?

Maybe you have encountered the issue in Section 2.2.10 in this STM32G0B1xB/xC/xE device errata which says that prefetch on STM32G0B1 has a hard fault if dual bank is enabled. 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
fsc1121Author
Associate
Apr 24, 2024 6:11 AM UTC

Hello Imen.D

      Thanks For your help, Cache and Prefetch  all enbaled. And I think my problem is not the same as in Section 2.2.10 in this STM32G0B1xB/xC/xE device errata .  Because if do use some areas of Flash for storage configuration functions (such as EEPROM used), upgrading with dual bank works. My question is that;

1. Does G0 dual bank mode supports using a portion of the bank area for storing real-time data which can be read and written during program running.

2. If point 1 support. What is the code difference between erasing, reading, and writing Flash between dual bank and  single bank. I do not find any information about it from the documents and demo.

 

 

fsc1121Author
Associate
Apr 24, 2024 6:11 AM UTC

Hello Imen.D

      Thanks For your help, Cache and Prefetch  all enbaled. And I think my problem is not the same as in Section 2.2.10 in this STM32G0B1xB/xC/xE device errata .  Because if do use some areas of Flash for storage configuration functions (such as EEPROM used), upgrading with dual bank works. My question is that;

1. Does G0 dual bank mode supports using a portion of the bank area for storing real-time data which can be read and written during program running.

2. If point 1 support. What is the code difference between erasing, reading, and writing Flash between dual bank and  single bank. I do not find any information about it from the documents and demo.