Skip to main content
Visitor II
September 27, 2019
Question

External flash loader for h7

  • September 27, 2019
  • 3 replies
  • 3225 views

I am trying to develop external flash loader, which will use the cubeprogrammer utility, I am facing the following error,

1) When I try to use cubeide for the project, If I remove the main and made necessary changes in startup.s and in linker, getting the following linker error "./arm-none-eabi/lib/crt0.o: In function `_start'"

2) When I try to use the atollocstudio, I am able to compile and run in target but the processor resets on executing the following line of HAL Init

 SystemCoreClock = HAL_RCC_GetSysClockFreq() >> ((D1CorePrescTable[(RCC->D1CFGR & RCC_D1CFGR_D1CPRE)>> RCC_D1CFGR_D1CPRE_Pos]) & 0x1FU);

Same code when ran from Flash memory executes without any issues.

3) Also I found that when I moved all the programs to RAM then the ISR's are being hit, the same code executing from flash works without any issues.

    This topic has been closed for replies.

    3 replies

    Graduate II
    September 27, 2019

    You're basically trying to build a free standing object file, the entry point can be defined as Init

    You do not want, and can't have, the vector table, and interrupts. So you'll need to lose SysTick, and implement timing, delay and timeout loops without using it.

    sivaramAuthor
    Visitor II
    September 27, 2019

    I did everything, but in stmcube ide library looks like it is expecting main to be present.

    Graduate II
    September 27, 2019

    Honestly don't know if the CubeIDE gets in the way here, perhaps you can use the compiler/linker more directly where you control the command line options, add the ones needed, remove the unnecessary ones, etc. You'll need to figure out how to drive your tools. You just need it to do a simple compile/link, and not drag in a lot of library and C run time code.

    What QSPI memory are you using? What pins/af settings is that using?

    Visitor II
    November 7, 2020

    Hello.

    did you manage to create the external loader for your stm32h.

    Yes, can you share your loader project with me.

    thank you

    sivaramAuthor
    Visitor II
    November 8, 2020

    We couldn't make it work, ended up writing our own loader which will execute from flash.