Will nano lib report when it can't fullfill requests?

Asked by Uwe Bonnes

Hallo,

compiling some application (blackmagic debug probe) for the STM32F103C8 with 56 kiByte Flash available, as 8 kiBytes are used for the bootloader, will result in binaries too big if all latest features of blackmagic are used. Using older versions will fit in the flash and run as expected. Linking with -specs=nano.specs results in a much smaller executable, but the program behaves unexpected.

If a program uses features that nanolib doesn't offer, will there be some kind of warning or will it fail silent?
Is there some way to scan the source for nanolib-unimplemented features?
Is there some list what to check?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
chengbin
Solved:
Last query:
Last reply:
Revision history for this message
Best chengbin (can-finner) said :
#1

Hi,
Since nano is just an implementation of C library, the linking process is in compliance with gnu liner's rule. In other words, there is no special linking time check with nano.

But you can refer to nano/newlib/README.nano in source package for differences between nano and Newlib. Hopefully you will find what's the unimplemented feature causing the unexpected behavior.

Thanks.

Revision history for this message
Uwe Bonnes (bon) said :
#2

Thanks chengbin, that solved my question.

Revision history for this message
Uwe Bonnes (bon) said :
#3

Thankfully Paul Fertser had a look at the problem in our project and replaced the offending %X printf formating commands with %x. The program now fits again.

Revision history for this message
Uwe Bonnes (bon) said :
#4

Just another remark:
I installed from
https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q1-update/+download/gcc-arm-none-eabi-4_7-2013q1-20130313-src.tar.bz2
and nano/newlib/README.nano is not included:
> find /opt/cross/gcc-arm-none-eabi-4_7-2013q1/ | grep -r readme
/opt/cross/gcc-arm-none-eabi-4_7-2013q1/share/doc/gcc-arm-none-eabi/readme.txt
/opt/cross/gcc-arm-none-eabi-4_7-2013q1/share/gcc-arm-none-eabi/samples/readme.txt

Please consider including in future releases. Thanks

Revision history for this message
chengbin (can-finner) said :
#5

Hi,
The /opt/cross/gcc-arm-none-eabi-4_7-2013q1/share/doc/gcc-arm-none-eabi/readme.txt contains information about the binary toolchain.
The /opt/cross/gcc-arm-none-eabi-4_7-2013q1/share/gcc-arm-none-eabi/samples/readme.txt contains information about the sample projects.

But README.nano is about the nano library's code, it should be in nano's source code along with newlib's original README, rather than in installer package.