Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker script doesn't get preprocessed #280

Closed
kalle16lab opened this issue May 17, 2021 · 1 comment
Closed

Linker script doesn't get preprocessed #280

kalle16lab opened this issue May 17, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@kalle16lab
Copy link

Describe the bug
Our device has a custom bootloader and thus needs the ability to modify "MBED_APP_START" and "MBED_APP_SIZE" definitions in the linker script.

Using mbed studio 1.4.1 this worked when adding

"target.mbed_app_start" : "0x2e000",

to the mbed_app.json target overrides section.

but when using mbed-tools the linker script in cmake_build/<our custom target>/develop/GCC_ARM/mbed-os/targets/TARGET_<vendor>/TARGET_<family>/mbed-<family>.link_script.ld begins with

ENTRY(Reset_Handler)
MEMORY
{
  FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
  RAM_NVIC (rwx) : ORIGIN = MBED_RAM_START, LENGTH = 0x100
  RAM (rwx) : ORIGIN = (MBED_RAM_START + 0x100), LENGTH = (384K - (0x100))
}

Seemingly no preprocessing has been done. Adding

add_definitions("-DMBED_APP_START=0x0002e000")
add_definitions("-DMBED_APP_SIZE=0x000D2000")

to the CMakeListst.txt in app folder makes no diference.

To Reproduce
Have target with preproccesing directives in the linker script and attempt to compile using mbed-tools. Verify that the linker script hasn't been modified.

Expected behavior
Linker script preproccessing directives should be replaced with correct values.

Desktop (please complete the following information):

  • OS: Windows 10

Mbed (please complete the following information):

  • Mbed CLI 2 Version: 7.15.0
@kalle16lab kalle16lab added the bug Something isn't working label May 17, 2021
@kalle16lab
Copy link
Author

This is a duplicate of #156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant