-
Notifications
You must be signed in to change notification settings - Fork 112
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
STLINK_HIGH doesn't fit into flash #25
Comments
highboot branch uses start address but master uses Why? |
Hi @danielkucera, can you list the full version of the toolchain you're compiling with? I see that it's using 9.2.1 which is nominally the same version as the CI setup is using, but I'd like to eliminate it as a potential source of error if I can. For reference, the CI is using:
Can you rebuild libopencm3 to make sure it's recompiled with the appropriate optimizations, in case it didn't rebuild it after updating the compiler settings. The master branch is using a more size optimized version of the bootloader contributed by @dmsc which enables LTO and links against newlib-nano instead of newlib to reduce the size. I believe that @dmsc chose fairly tight margins on the space allocated to the high memory bootloader in order to maximize the amount of flash space available to the application. |
Hi @devanlai , after
My gcc version:
|
Hi @danielkucera ! As @devanlai said, you are using essentially the same toolchain as we are - here it is:
Can you post the dapboot.map file to investigate where the extra size is coming? Thanks! |
Hi. Sure, here. |
This is the main difference: .vectors 0x0000000008000000 0x150 /tmp/dapboot.elf.ltrans0.ltrans.o
0x0000000008000000 vector_table
-.text 0x000000000800e600 0x1980
+.text 0x000000000800e600 0x1ae8
*(.text*)
.text 0x000000000800e600 0x14f8 /tmp/dapboot.elf.ltrans0.ltrans.o
0x000000000800fa84 reset_handler
.text.startup 0x000000000800faf8 0x2ec /tmp/dapboot.elf.ltrans0.ltrans.o
- .text.memcpy 0x000000000800fde4 0x1c lib/thumb/v7-m/nofp/libc_nano.a(lib_a-memcpy-stub.o)
+ .text 0x000000000800fde4 0xec lib/thumb/v7-m/nofp/libc_nano.a(lib_a-memcpy.o)
0x000000000800fde4 memcpy
- .text 0x000000000800fe00 0x10 lib/thumb/v7-m/nofp/libc_nano.a(lib_a-strlen.o)
- 0x000000000800fe00 strlen
- .text.strncpy 0x000000000800fe10 0x26 lib/thumb/v7-m/nofp/libc_nano.a(lib_a-strncpy.o)
- 0x000000000800fe10 strncpy
- 0x000000000800fe38 . = ALIGN (0x4)
- *fill* 0x000000000800fe36 0x2
+ .text 0x000000000800fed0 0x5c lib/thumb/v7-m/nofp/libc_nano.a(lib_a-strlen-stub.o)
+ 0x000000000800fed0 strlen
+ .text 0x000000000800ff2c 0x74 lib/thumb/v7-m/nofp/libc_nano.a(lib_a-strncpy.o)
+ 0x000000000800ff2c strncpy
+ 0x000000000800ffa0 . = ALIGN (0x4) Your nano-libc is much larger than the original:
Total is 82 bytes in the original versus 444 bytes in your version. I would file a bug report to the ubuntu tracker, it seems that they miss-compiled the nano-libc; in the mean time, you could use a patch to include your own libc functions, see this: 5f160ec |
Which distro are you using? I can compile in container. |
even latest debian fails:
...
|
Hi, I use a prebuilt copy of the "gnu-rm" toolchain provided by ARM: You can see an example of the script I use to download the toolchain for CircleCI here: You can override the
edit: fixed wrong syntax for the PREFIX variable |
Hi!
Yes, same error, the nano-libc is too big, probably configured with -O2 instead of -Os. Also, the Debian package has not been updated in a while. I'm using the toolchain from ARM, downloaded from here: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads If you don't want to use the pre-compiled package (I use the 64bit Linux build), compiling yourself is easy: download the source, expand and the type:
First two will complete in about a minute, last will compile everything and take a lot more time, and the libraries will be built for 13 different profiles (each arch type and FP combination) and two flavors (normal and nano) each. The compiled toolchain is relocatable, so you can copy it on any folder and simply symlink the binaries to your PATH. |
Try to compile with GCC 8.3.1 it create smaller file than 9.2.1 / 9.3.1 (i don't know what of reason but different is about 10 kb and more ..) |
If this is still an issue, it should now be fixed by #51. |
The text was updated successfully, but these errors were encountered: