Skip to main content
Visitor II
June 8, 2021
Question

How to change boot from the internal flash to SRAM in STM32H7 with FreeRTOS?

  • June 8, 2021
  • 2 replies
  • 1051 views

It is working firmware STM32H7-DISCO with freeRTOS using internal flash. Almost full my binary. I planned to develop my firmware internal flash to SRAM. I modified .ld file and able to boot SRAM. Please check the below changes.

/* Memories definition */

MEMORY

{

 DTCMRAM  (xrw)  : ORIGIN = 0x20000000,  LENGTH = 128K

 ITCMRAM  (xrw)  : ORIGIN = 0x00000000,  LENGTH = 64K

 RAM_D1  (xrw)  : ORIGIN = 0x24040000,  LENGTH = 256K

 RAM_D2  (xrw)  : ORIGIN = 0x30000000,  LENGTH = 288K

 RAM_D3  (xrw)  : ORIGIN = 0x38000000,  LENGTH = 64K

 FLASH  (rx)  : ORIGIN = 0x24000000,  LENGTH = 256K //change interflash to ram 0x08000000

}

But it is hanging in kernelstart() -> prvPortStartFirstTask() funtion (0xE000ED08 have 0x8000000 flash address) . I used STMCUBEID generate code. Even i tried external flash using QSPI . It is hanging same function.

It is working fine without FreeRTOS for external flash and internal ram.

Do i need to change any other setting for change FLASH?

    This topic has been closed for replies.

    2 replies

    ST Employee
    June 17, 2021

    Hello,

    Have you tried the STM32CubeH7 firmware examples ?

    The firmware packages provide several applications to demonstrate how to boot from internal Flash memory and how to configure the external memories and jump to user application (located on the external memory).

    Also, I advise you to have a look to AN5188 Maybe it can help you.

    Imen

    Visitor II
    June 29, 2021

    Hi ,

    It resolved the issue . I modified loader file and flash load in below header file.

    Drivers\CMSIS\Device\ST\STM32H7xx\Include\stm32h750xx.h

    #define FLASH_BASE               D1_AXISRAM_BASE //0x24000000

    Core/src/system_stm32h7xx.c

     SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */

    Thanks

    Rajesh Kannan

    Graduate II
    June 29, 2021

    In Keil

    extern void *__Vectors;

    SCB->VTOR = (uint32_t)&__Vectors; /* Vector Table Relocation */

    In GNU

    extern void *g_pfnVectors;

    SCB->VTOR = (uint32_t)&g_pfnVectors; /* Vector Table Relocation */

    Saves hours of time wasting, and makes the linker/compiler do the jobs they were assigned to do.