Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world.
And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download two short videos (registration required) highlighting:

System Workbench for STM32


Bootloader, linker and application start address

Hello everyone,

I have a problem setting the start address of an application.
I am using an STM32F429 with 2MB of Flash.

In the flash there is a custom bootloader (@0x8000000) that will performs some basic operations, then it will jump at a specified address (e.g. 0x8030000).

The source code of custom bootloader is not accessible.
The generation of the elf file is successful and the map file seems correct (also using objdump).
However when loaded, it meets an hard fault and it does not start.

In main.c file, I execute:
1) HAL_Init();
2) SystemClock_Config()
3) Interrupt Vector remap (I copy g_pfnVectors into a variable, disable irq, make SCB->VTOR poit to the variable, re-enable irq)
4)SystemCoreClockUpdate()


In the linker script of my application, I defined the memory layout like this:
*********************************************************
MEMORY
{
bootloader (rx)  : ORIGIN = 0x08000000, LENGTH = 192K
flash (rx)  : ORIGIN = 0x08030000, LENGTH = 2048K - 192K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K
}
************************************************************

while the sections like this:

************************************************************
SECTIONS
{
.bootloader :
{
. = ALIGN(4);
KEEP(*(.bootloader))
FILL(0xFFFFFF)
. = ALIGN(4);
} >bootloader


/* Reset and ISR vectors */
.isr_vector :
{
isr_vector_start = .;
KEEP(*(.isr_vector))
} >flash
....
************************************************************



Do you have any idea? Could you please help me?
Thanks in advance.


Hello,

thank you for your reply.

Yes, I am sure.
I haven’t specified that I load the bootloader (custom, closed, just .hex file) through openocd, while the application is loaded with a software (custom and closed) that allows me to specify the address in the flash where the application is copied.
I observed with ST-Link Utility the whole flash before and after writing the binary of the application: the .bin file I generate does not overlap the bootloader in the flash memory.


Hi

For relocation of the application I do the change in LinkerScript.ld in MEMORY section as you did.
Also I change in system_stm32xxxx.c, system_stm32l4xx.c for example, the line

#define VECT_TAB_OFFSET offset

where offset would be 0x30000 in your case.

Nothing else and no change within the application at all.

This works, but overwrites the bootloader.. So I have to flash the bootloader thereafter.

Dieter

Thank you for your help Dieter, however it still does not work.

For the linker, I used the configuration posted above.
Then, I opened the file “system_stm32f4xx.c” and changed the line from

  1. define VECT_TAB_OFFSET 0x00

to

  1. define VECT_TAB_OFFSET 0x30000


But no results.
Before doing this I erase the whole flash, then loaded the bootlader (.hex) file with openocd and finally loaded the application binary with the software setting the start address as in the linker script.
If it may helps, the bootloader (.hex file) is generated with Keil, while my application with Eclipse, Ac6 Tool and SW4STM32.

Do you have any other idea?
Would you advise to create a simpler custom bootloader? If so, do you have any resources on how I can build that?

Thank you
a.


Thank you very much Dieter.
I’ll try building the bootloader and see if I can find any error.


Do somebody know how to avoid stlink erase bootloader?