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 (registration required) various documents highlighting:

System Workbench for STM32


Move .rodata section in Linker

Hi all,

Not sure if this is the place to ask this, but I’m busy with a custom bootloader for the STM32F411RE (512K FLASH, 128K RAM) using OpenSTM32 eclipse IDE.

For the bootloader, its only function is to check a few CRC’s and copy data from one point to another, so a few flash writes. As such the actual code is very small.

I’m trying to keep it all in the first sector of flash, Sector 0 (0x08000000-0x08003FFF), 16KB.

In the linker file I reduced the size from 512K to 16K just to make sure its within size, and even though all the code could fit within 5K even (I looked at the map file), it ALWAYS tries to put the .rodata section at 0x08004000 (Sector 1), regardless of what I do in the linker. This is obviously outside my 16K boundary, so the build fails.

My linker just looks like this - snippets of it, very standard (I have a version number I’m putting at the end of the bootloader space):

VERSION_ADR = 0x08003FFC;
/* Specify the memory areas */
MEMORY
{
FLASH (rx)  : ORIGIN = 0x08000000, LENGTH = 16K
RAM (xrw)  : ORIGIN = 0x20000000, LENGTH = 128K
}

.version (VERSION_ADR):
{
KEEP(*(.version))
} > FLASH

/* Constant data goes into FLASH */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} > FLASH

The map output looks like this:

.fini 0x08000f60 0x8 c:/eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/crtn.o
0x08000f68 . = ALIGN (0x4)
0x08000f68 _etext = .

.vfp11_veneer 0x08000f68 0x0
.vfp11_veneer 0x00000000 0x0 linker stubs

.v4_bx 0x08000f68 0x0
.v4_bx 0x00000000 0x0 linker stubs

.iplt 0x08000f68 0x0
.iplt 0x00000000 0x0 c:/eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/crtbegin.o

.version 0x08003ffc 0x1
*(.version)
.version 0x08003ffc 0x1 src\main.o
0x08003ffc version

.rodata 0x08004000 0x318
0x08004000 . = ALIGN (0x4)
*(.rodata)
.rodata 0x08004000 0x10 HAL_Driver\Src\stm32f4xx_hal_rcc.o
0x08004000 APBAHBPrescTable
.rodata 0x08004010 0x300 src\crc.o
0x08004010 crc_tbl
0x08004110 crc_CCITT_Table
*(.rodata*)
.rodata.str1.4
0x08004310 0x4 c:/eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-impure.o)
.rodata._global_impure_ptr
0x08004314 0x4 c:/eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-impure.o)
0x08004314 _global_impure_ptr
0x08004318 . = ALIGN (0x4)

.rel.dyn 0x08004318 0x0
.rel.iplt 0x00000000 0x0 c:/eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/crtbegin.o

.ARM.extab
*(.ARM.extab* .gnu.linkonce.armextab.*)

.ARM 0x08000f68 0x0
0x08000f68 __exidx_start = .
*(.ARM.exidx*)
0x08000f68 __exidx_end = .

.preinit_array 0x08000f68 0x0
0x08000f68 PROVIDE (__preinit_array_start, .)
*(.preinit_array*)
0x08000f68 PROVIDE (__preinit_array_end, .)

.init_array 0x08000f68 0x8
0x08000f68 PROVIDE (__init_array_start, .)
*(SORT(.init_array.*))
.init_array.00000
0x08000f68 0x4 c:/eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-__call_atexit.o)
*(.init_array*)
.init_array 0x08000f6c 0x4 c:/eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/crtbegin.o
0x08000f70 PROVIDE (__init_array_end, .)

.fini_array 0x08000f70 0x4
0x08000f70 PROVIDE (__fini_array_start, .)
*(SORT(.fini_array.*))
*(.fini_array*)
.fini_array 0x08000f70 0x4 c:/eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/crtbegin.o
0x08000f74 PROVIDE (__fini_array_end, .)
0x08000f74 _sidata = LOADADDR (.data)

Anyone know how I can make the rodata section just follow on after the text section instead of defaulting to 0x08004000?

Never mind, I’m being stupid. It does this because of my VERSION being put at 0x08003FFE, then it aligns to 4 above that.

Stupid user error, apologies for the question.


France

Hi,

Yes, the order of output sections does matter: you’ve placed your .rodata section after the .version section, that is located in 0x3ff8, so with th econtent of the version, your .rodata section will go after that, which finish by being 0x4000...

Bernard (Ac6)