cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong file name for linker script

MikeStrom
Associate II

When generating code for Makefile, the MacOS version 6.15 succeeds while the Linux version 6.15 fails.

I have the same version of firmware packages installed on both OS.

MacOS STM32CubeMX produce this following snippet in the Makefile

#######################################
# LDFLAGS
#######################################
# link script
LDSCRIPT = STM32U5a5xx_FLASH.ld

and do copy the correct file to the project directory. 

However, the Linux version fail to define linker script file and does not copy required script to the project folder. 

#######################################
# LDFLAGS
#######################################
# link script
LDSCRIPT = 

The log explains why, the file does not exists.

No such linker file: /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5a5xx_FLASH.ld
No such linker file: /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5a5xx_RAM.ld

However, it appears the files exists, but has different case, like so (note "U5A5" not "U5a5"):

mike@mabox:~$ ll /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5A5xx_*
-rw-r--r-- 1 mike mike 4959 Aug 27 01:25 /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5A5xx_FLASH.ld
-rw-r--r-- 1 mike mike 5123 Aug 27 01:25 /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5A5xx_FLASH_ns.ld
-rw-r--r-- 1 mike mike 5347 Aug 27 01:25 /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5A5xx_FLASH_s.ld
-rw-r--r-- 1 mike mike 4859 Aug 27 01:25 /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5A5xx_RAM.ld
-rw-r--r-- 1 mike mike 4941 Aug 27 01:25 /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5A5xx_RAM_ns.ld
-rw-r--r-- 1 mike mike 5157 Aug 27 01:25 /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5A5xx_RAM_s.ld

Likely, this works on Windows and MacOS disks that are not case sensitive, but not on Linux.

A workaround that do work is to create symbolic links, like so:

$ cd ~/STM32Cube/Repository/STM32Cube_FW_U5_V1.8.0/Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker
$ ln -s STM32U5A5xx_FLASH.ld STM32U5a5xx_FLASH.ld
$ ln -s STM32U5A5xx_RAM.ld STM32U5a5xx_RAM.ld

 After this, Makefile is correctly generated and the linker script files are copied to the project directory.

0 REPLIES 0