Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


#include in linker script

Hello,

I would like to use a #include inside my linker script to set the origin address of the flash, something like :

FLASH (rx)  : ORIGIN = CURRENT_ADDRESS, LENGTH = 80K

CURRENT_ADDRESS is defined in a header file used by my source code :

#define CURRENT_ADDRESS 0x0800C000

I know it’s possible, I tried some things I found on google but without any success.
Do you know a way to do that with SW4STM32 ?

Thank you,

François

I finally found out how to proceed, I explain it for those who are interested :

You just have to follow the explanation number 3) of Giuseppe Guerrini on this thread with few modifications :

https://stackoverflow.com/questions/16986557/importing-a-symbol-from-c-file-into-linker-script/16994601

For b) I saved the script as linker_temp.c (you can either save it as linker_temp.ld)

For 3) c) go to Project > Properties > C/C++ Build > Settings > Build Steps and write the following command on Pre-build steps > Command :

arm-none-eabi-gcc -P -E ..\linker_temp.c -o ..\STM32F411RETx_FLASH.ld

See the picture attached.

Change the name of your input and output file (linker_temp.c and STM32F411RETx_FLASH.ld for me) according to your project.
And pay attention to the path of each file, even inside the linker_temp file when including your header file.

François


 

Newest Forum Posts

  1. Analog servomotors with nucleo f334r8 by SkelePaw, 2025-11-01 05:57
  2. So happy to finally meet you! by Danielrug, 2025-10-28 11:01
  3. STM32 MCU model shortlisting for Making RC remote by Palvish, 2025-07-07 15:05
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  6. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  7. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  8. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05

Last-Modified Blogs