cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 dual bank random RWW stalls

Tomas Jirinec
Associate II
Posted on June 28, 2017 at 11:13

Hello everyone,

I am having very weird problem using RWW functionality on STM32F767VIT6. I have searched through various places and found no hints to my issue. Any pointers are welcome.

My flash organization is following:

  • Bank1:
  • sectors <0-4> bootloader
  • sectors <5-11> app1
  • Bank2:
  • sectors <17-23> app2

The trouble I am having is when I am upgrading application during runtime. The simplified process is following:

  • erase the second application image (if in app1, delete app2. if in app2 delete app1).
  • program the received image in the erased space.
  • if all is good - restart the mcu. bootloader will boot the newer app image.

Problem is following: Sometimes the whole MCU freezes during the erase phase. This happens like 20% of time. These freezes range from approximately 150ms to over 1s. This of course forces the watchdog to reset the whole MCU.

How is that possible? The whole dual bank concept is designed to allow RWW without any stalls at all. The weirdest thing is, that it happens only from time to time. I flash 5 times in a row without any issue and during the sixth attempt I get the stall and MCU restarts.

Thank you for your time.

Tomas

#stalling #dual-bank #stm32f767-iap
3 REPLIES 3
Tilen MAJERLE
ST Employee
Posted on June 28, 2017 at 12:03

Hello

tomas

‌,

up to 1second takes time to erase sectors. My questions are these:

  • When you erase app2 (bank 2), are you doing it from app1 or from bootloader?
  • When you erase app1 (bank 1), are you doing it from app2 or from bootloader?

Keep in mind that when you execute code from bank (let's say bank 1) and if you also erase/write/read this part, execution will slow down because of memory matrix designed on STM32F7.

To get maximal performance, erase memory from another bank (eg. erase app1 from bank 2 and app 2 from bank 1).

Tomas Jirinec
Associate II
Posted on June 28, 2017 at 12:45

Hi Tilen,

thanks for quick reply.

All flash erase/write operations are done in application code. App1 is erasing/writing app2 and vice versa.

stefan gustavsson
Associate
Posted on September 05, 2017 at 17:26

Hello

Tomas, did you solve this problem?

I see same issues on a STM32F765VGT. I have it configured in dual bank mode. The application code in BANK1 erase BANK2 and most of the times MCU freezes until erase is finished, but not always. No code what I can see is accessing BANK2 during the time. I have also setup the Memory Protection Unit to detect acceses to BANK2 areas and it dosent trigger.

Best regards

Stefan