Skip to main content
JPark.18
Visitor II
August 1, 2018
Question

Execution of code in SRAM of STM32F405

  • August 1, 2018
  • 1 reply
  • 520 views

Hi, I am using STM32F405.

I use the Flash Sector as follows.

 - Sector 0: IAP

 - Secotr 2: Data Save

 - Sector 5: Main Application

Main Save the data in APP. And Main_APP erases Sector2 before writing the data.

While erasing Sector2 from Main_APP, I noticed that Tiemr_Interrupt does not occur.

Checking the datasheet shows that you can not read during Flash Erase / Write.

So I want to copy the Main_APP code to SRAM. What should I do?

Best Regards

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
August 1, 2018

Will the entire application fit?

Typically one would place a subset into RAM, including the Vector Table (at the front and by setting SCB->VTOR), IRQ Handlers, and any subroutines/libraries those functions call.

I will note that the F405 can't run code out of the CCM RAM at 0x10000000

Your loader (IAP) code could copy the app to RAM and transfer control. You want the linker to build the app with the expectation it would operate in the 0x20000000 space.

You should make sure you understand how the processor functions, and how the linker works, and come up with a method to deliver the code to the IAP.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..