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


Strange Error While Compiling

‘Building target: STM32F401RE-Nucleo_Application.elf’
‘Invoking: MCU GCC Linker’
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostdlib -specs=nano.specs -T”C:\temp\AC6\Path_to_Linker_Script\LinkerScript.ld” -Wl,-Map=output.map -Wl,minus minus gc-sections -lm -o “STM32F401RE-Nucleo_Application.elf” @”objects.list” -lm -lc--
c:/ac6/systemworkbench/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_nano.a(lib_a-init.o): In function `__libc_init_array’:
init.c:(.text.__libc_init_array+0x1c): undefined reference to `_init’
c:/ac6/systemworkbench/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_nano.a(lib_a-sbrkr.o): In function `_sbrk_r’:
sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk’
c:/ac6/systemworkbench/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_nano.a(lib_a-writer.o): In function `_write_r’:
writer.c:(.text._write_r+0x10): undefined reference to `_write’
c:/ac6/systemworkbench/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_nano.a(lib_a-closer.o): In function `_close_r’:
closer.c:(.text._close_r+0xc): undefined reference to `_close’
c:/ac6/systemworkbench/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_nano.a(lib_a-fstatr.o): In function `_fstat_r’:
fstatr.c:(.text._fstat_r+0xe): undefined reference to `_fstat’
c:/ac6/systemworkbench/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_nano.a(lib_a-isattyr.o): In function `_isatty_r’:
isattyr.c:(.text._isatty_r+0xc): undefined reference to `_isatty’
c:/ac6/systemworkbench/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_nano.a(lib_a-lseekr.o): In function `_lseek_r’:
lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek’
c:/ac6/systemworkbench/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_nano.a(lib_a-readr.o): In function `_read_r’:
readr.c:(.text._read_r+0x10): undefined reference to `_read’
collect2.exe: error: ld returned 1 exit status
make: *** STM32F401RE-Nucleo_Application.elf Error 1

Ask me for any information !

I have put “minus minus gc-sections..” above because putting two minus together was striking all the text infront of it.

Tunisia

Not that strange,
You need to add “-specs=nano.specs” “-specs=nosys.specs” in your miscellaneous linker flags or add syscalls.c to your project


-specs=nano.specs
can this be put in the any GUI Setting TAB? Where?

Tunisia
sorry, it is “-specs=nosys.specs” and it can be added in : Project, Properties, C/C++ Build, Settings, MCU GCC Linker, Miscellaneous, Linker flags

Now I get this error in the syscall.c


‘end’ undeclared (first use in this function) syscalls.c /STM32F401RE-Nucleo_Application/Projects/Multi/Applications/STM32_Nucleo_Application/User line 103 C/C++ Problem
‘stack_ptr’ undeclared (first use in this function) syscalls.c /STM32F401RE-Nucleo_Application/Projects/Multi/Applications/STM32_Nucleo_Application/User line 106 C/C++ Problem
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘asm’ syscalls.c /STM32F401RE-Nucleo_Application/Projects/Multi/Applications/STM32_Nucleo_Application/User line 45 C/C++ Problem
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘asm’ syscalls.c /STM32F401RE-Nucleo_Application/Projects/Multi/Applications/STM32_Nucleo_Application/User line 98 C/C++ Problem
make: *** Projects/Multi/Applications/STM32_Nucleo_Application/User/syscalls.o Error 1 STM32F401RE-Nucleo_Application C/C++ Problem


Thanks for the comments !!
I resolved it.
register char * stack_ptr asm(“sp”);
has to be
register char * stack_ptr __asm(“sp”);


and

extern char end asm(“end”);

has to be

extern char end __asm(“end”);


I have to prepend __(double underscores) before asm() references.!

Tunisia

Strange ! the double underscore are not mandatory.
You can check UART_printf example (CubeF4\Projects\STM32F401RE-Nucleo\Examples\UART\UART_Printf\SW4STM32\syscalls.c).

Note: If you are not using FreeRTOS, you do not need the stack_ptr (comment #define FreeRTOS)


I pretty much got the same error and had to comment out any printf statements and the error went away.