cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to change the address of the Flash Bank2 starting address in Flash Swap Banking?

Monika_02
Associate II

Hi,

I am working on Flash swap Banking.

From STM32CubeProgrammer I wanted to change the SECWM1_End value and start address of Bank2 from 0x8100000 to 0x8040000 but it is giving me error.  Is there any possible way to change this configuration? And change the Bank2 swap address?

Monika_02_1-1706598421794.png

Thanks.

 

4 REPLIES 4
Pierre_Paris
ST Employee

Hello @Monika_02,

All right, so you have set the SWAP_BANK option bit in the user configuration. It modifies the address of each bank in the memory map.

Q : Is there any possible way to change this configuration? And change the Bank2 swap address?

A : Bank 2 base address is 0x08100000 for STM32u575/585 (what is your STM32 ?) You cannot declare the bank 2 with SECWM2_STRT & SECWM2_END in the bank 1 at the address 0x8040000. Here are the two flash area definition for a 2-Mbyte dual-bank on a STM32U5 :

Pierre_P_0-1706617134198.png

Can you explain why you are trying that and more about your application ? 

Kind Regards,

Pierre

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.

Monika_02
Associate II

Hello @Pierre_Paris 

Thank you for responding.

As the device has 2MB embedded flash memory I wanted to make 4 partition for storing some configurations.

That's the purpose of changing the address.  If I could change the end and starting address to the swap banks into 500KB each.  There will be 1MB left for storing configuration or other files.  If there is any option for that I can use the swap banking method itself or else there needs to be a dedicated application created for swap method.  That's the reason for it. 

 

Thanks,

Monika.

Pierre_Paris
ST Employee

Hello @Monika_02,

Again, what is your STM32 ?

If you want to make 4 partition for storing configurations, the best option is to edit the linker file. (You can also use the memory management tool in CubeMX, click here for more information)

You can check the FLASH_SwapBank of STM32CubeH7 program under the root : "STM32Cube_FW_H7_V1.10.0\Projects\NUCLEO-H743ZI\Examples\FLASH\FLASH_SwapBank" .

This example load two projects : the first in the bank1 at the address 0x08000000 and the second in the bank2 at the address 0x08100000. You can swap between those two banks (projects) using the FLASH HAL API.

Best Regards,

Pierre

 

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.

Monika_02
Associate II

Hi @Pierre_Paris 

Q: what is your STM32 ?

A: I am using STM32H563ZI nucleo board.

Thanks.