cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7743I-EVAL board, FLASH_SwapBank example code not swapping the code?

avulas76
Associate II

For the upcoming project planning to use the STM32H family of uC and try to run code from flash bank1 and use the bank2 for staging the new firmware.

Once staged firmware CRC check would like to swap the code from bank2 to bank1 and reboot the device to start booting from bank1.

To start with, got the STM32H7743I-EVAL board,  FLASH_SwapBank example code with the following order:

  1. Compiled FLASH_SwapBank1 code with the following changes:

     BSP_LED_Off(LED1);

     BSP_LED_On(LED2);

     BSP_LED_Off(LED3);

  1. Compiled FLASH_SwapBank2 code with the following changes:

     BSP_LED_On(LED1);

     BSP_LED_Off(LED2);

     BSP_LED_On(LED3);

  1. Erased the full chip using the STM32CubeProgramming
  2. Loaded the Bank2 .elf in 0x08100000 using the STM32CubeProgramming - (Bank2 start address)
  3. Loaded the Bank1 .elf in 0x08000000 using the STM32CubeProgramming - (Bank1 start address)
  4. Read the code from both bank1 and bank2 and made sure the code is loaded properly.

After rebooting the Eval board, found that the code running from bank1 by looking at the LEDs behavior. When I pressed the “Tamper�? button the assumption is the LED behavior will change.

But it is not happening.

Appreciated help on this.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @avulas76​,

An internal ticket has been reported to fix the issue in CubeIDE.

Internal ticket number: 134256(This is an internal tracking number and is not accessible or usable by customers).

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.

View solution in original post

13 REPLIES 13
Imen.D
ST Employee

Hello @avulas76​,

Which revision board are you using? V revision!

Please see the AN5312 Application note Migration from RevY to RevV for STM32H743/753 and STM32H750 Value line microcontrollers, page 6: "It is not possible to swap banks on the fly".

Clearing the instruction cash is required when the codes try to swap the banks on the fly.

Have a look at the RM0433, in the "Figure 12. Flash bank swapping sequence" and check your swap banks flow.

When your question is answered, please close this topic by choosing Select as Best.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
avulas76
Associate II

How do I confirm the revision of the board, The package I got says:

CPN: STM32H743I-EVAL2 and FG: VAH743I$AT1

How do I test the bank swap functionality using the ST-provided bank swap example code?

It's the version of the MCU

0693W00000WJFe2QAH.jpg

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
FBL
ST Employee

Hello @avulas76​,

I would like to add something, not detailed in readme file, but present in the sequence as mentioned @Imen DAHMEN​, in RM0433, which is, you have to Force a system reset (reset button), after each press user button (each swap) to mark the intended LED behavior.

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.

avulas76
Associate II

Thank you for your quick response. This morning I tried again and again, and not seeing the intended LED behavior with the example program. Attached is the binary read back from both banks using the Cube programmer. Any leads on this well appreciated and it takes us to finalize the use case of the uC in the schematic design.

avulas76
Associate II

The uC version we have "V"

FBL
ST Employee

Hello @avulas76​ ,

Could you please verify the configuration in your project flash bank 1? and make sure in the other flash Bank 2 there is no FLASH_BANK1

0693W00000WJRKTQA5.pngAlso verify, the vector table in Flash Bank 2 project should map to 0x0810 0000

and check the linker file is correctly set

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

avulas76
Associate II

Thank you for the information, @F.Belaid​.

I do see the same settings and re-tested the code several times by changing the swapping.

#ifdef FLASH_BANK2 to #ifdef FLASH_BANK1 in main.c file and confirmed the LED functionality working. But the swap functionality NOT works.

Attached are both the BANK1 and BANK2 source codes for your review.

avulas76
Associate II

Hello, we are stuck in finalizing the part. If we need to use a different example program for this evaluation board, please let us know.