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

Can't compile bmp for stlinkv2 target #1800

Closed
tixlegeek opened this issue Apr 17, 2024 · 4 comments
Closed

Can't compile bmp for stlinkv2 target #1800

tixlegeek opened this issue Apr 17, 2024 · 4 comments
Labels
Build system Build system Foreign Host Board Non Native hardware to runing Black Magic firmware on

Comments

@tixlegeek
Copy link

tixlegeek commented Apr 17, 2024

Hi,
I'm trying to update the formware of a stlinkv2 clone as the README says, on Debian11.

Issue:

The linking fails with this error message:

/opt/arm/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: address 0x8020820 of blackmagic.elf section `.text' is not within region `rom'
/opt/arm/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: blackmagic.elf section `.data' will not fit in region `rom'
/opt/arm/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: address 0x8020820 of blackmagic.elf section `.text' is not within region `rom'
/opt/arm/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: region `rom' overflowed by 2436 bytes
Memory region         Used Size  Region Size  %age Used
             rom:      133508 B       128 KB    101.86%
             ram:       12140 B        20 KB     59.28%
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:170 : blackmagic.elf] Erreur 1

Reproduce:

various toolchain's version tests

  1. try 1: install debian's official repo version of none-eabi-arm-gcc [ERROR can't link]
  2. try 2: install ARM's official toolchain version 8 of the toolchain [ERROR can't link]
  3. try 3: install ARM's official toolchain version 12.2-rel1 [ERROR can't link]
    (hope based on this issue: ST-Link v2 with SWIM as UART configured is too big to fit #1579 )

build

  1. Recursively clone the bmp repo.
  2. make clean
  3. make PROBE_HOST=stlink ST_BOOTLOADER=1

I tryed multiple none-eabi toolchains as mentioned in multiple topics on the subject, those 102% of rom are the best i got.

Can someone help me with this?

Thanks for your great work, and have a nice day.

@dragonmux
Copy link
Member

dragonmux commented Apr 17, 2024

This is a known issue. Please either use the Meson build system and disable a target or two you're not planning to use, or edit src/Makefile to disable a target or two by deleting a target's .c from the main SRC += block. For example, if you're not planning to use the EFM32 support, then delete the efm32.c line from the block.

There's nothing in particular the project can do about this as we're just simply reaching the limits of the Flash on these devices, and keeping a complete list of all the permutations and combinations of probes the firwmare has been ported to completely updated with what targets need disabling to make it fit (and hoping those aren't the ones the user wants(!)) is not something we've got the bandwidth to do. The Meson option is by far the best on this score because you can so easily customise what set of targets you want your build to support with -Dtargets= and chip/chop + change that trivially.

@dragonmux dragonmux added Foreign Host Board Non Native hardware to runing Black Magic firmware on Build system Build system labels Apr 17, 2024
@tixlegeek
Copy link
Author

well, that worked perfectly fine. Thank's a lot. I understand the limitations. Maybe it would be a good idea to add a note to the readme about that? I guess a lot of people could fancy this tip while using these cheap debuggers.

@dragonmux
Copy link
Member

Yes, having a note in the README would be a good idea - you'd be welcome to contribute that if you'd like, or it'll go on our pile to fix when we get a moment to address it. Happy to hear you're up and working now though.

@tixlegeek
Copy link
Author

It'll be my pleasure. I'lldo this tonight, after work 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build system Build system Foreign Host Board Non Native hardware to runing Black Magic firmware on
Projects
None yet
Development

No branches or pull requests

2 participants