Finally I compiled offline but now I cannot link

online it is 103k flash
offline: `FLASH’ overflowed by 49k !

<>
(workspace) C:\workspace\v12>mbed config - - global GCC_ARM_PATH “C:\Program Files (x86)\GNU Tools ARM Embedded\5.3 2016q1\bin”
[mbed] C:\Program Files (x86)\GNU Tools ARM Embedded\5.3 2016q1\bin now set as global GCC_ARM_PATH

(workspace) C:\workspace\v12>mbed compile -t GCC_ARM -m NUCLEO_F072RB - - profile mbed-os/tools/profiles/small.json
Building project v12 (NUCLEO_F072RB, GCC_ARM)
Scan: .
Scan: FEATURE_BLE
Scan: FEATURE_COMMON_PAL
Scan: FEATURE_LWIP
Scan: FEATURE_UVISOR
Scan: FEATURE_LOWPAN_BORDER_ROUTER
Scan: FEATURE_LOWPAN_HOST
Scan: FEATURE_LOWPAN_ROUTER
Scan: FEATURE_NANOSTACK
Scan: FEATURE_NANOSTACK_FULL
Scan: FEATURE_THREAD_BORDER_ROUTER
Scan: FEATURE_THREAD_END_DEVICE
Scan: FEATURE_THREAD_ROUTER
Scan: FEATURE_STORAGE
Scan: mbed
Scan: env
Link: v12
c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: ./.build/NUCLEO_F072RB/GCC_ARM/v12.elf section .text' will not fit in region FLASH’
c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: ./.build/NUCLEO_F072RB/GCC_ARM/v12.elf section .bss' will not fit in region RAM’
c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: region RAM overflowed with stack
c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: region FLASH' overflowed by 48284 bytes c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/../lib/gcc/arm-none-eabi/5.3.1/../../../../arm-none-eabi/bin/ld.exe: region RAM’ overflowed by 352 bytes
./.build/NUCLEO_F072RB/GCC_ARM/Cairo_V10-072_GCC_ARM/main.o: In function main': main.cpp:(.text.startup.main+0x6c): undefined reference to Init_Usart2()’
collect2.exe: error: ld returned 1 exit status
[ERROR] c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: ./.build/NUCLEO_F072RB/GCC_ARM/v12.elf section .text' will not fit in region FLASH’
c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: ./.build/NUCLEO_F072RB/GCC_ARM/v12.elf section .bss' will not fit in region RAM’
c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: region RAM overflowed with stack
c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: region FLASH' overflowed by 48284 bytes c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/../lib/gcc/arm-none-eabi/5.3.1/../../../../arm-none-eabi/bin/ld.exe: region RAM’ overflowed by 352 bytes
./.build/NUCLEO_F072RB/GCC_ARM/Cairo_V10-072_GCC_ARM/main.o: In function main': main.cpp:(.text.startup.main+0x6c): undefined reference to Init_Usart2()’
collect2.exe: error: ld returned 1 exit status

[mbed] ERROR: “python” returned error code 1.
[mbed] ERROR: Command “python -u C:\workspace\v12\mbed-os\tools\make.py -t GCC_ARM -m NUCLEO_F072RB --source . --build ..build\NUCLEO_F072RB\GCC_ARM --profile mbed-os/tools/profiles/small.json” in “C:\workspace\v12”

(workspace) C:\workspace\v12>mbed compile -t GCC_ARM -m NUCLEO_F072RB --profile mbed-os/tools/profiles/small.json

<>

Hello,

Our online tools compile with the ARM toolchain. It does a better job of optimizing for size. Do you have a license for the Keil MDK? If so, you will be able to compile offline with ARM.

Cheers,
Sarah

Hi,
thanks for the response,

no I dont own a license for MKD… :frowning:

I refuse to crack a copy,

so, I have ordered a new board with more memory,
hopefully the code will still be stable.

Is this the most compact I can hope for from GCC_ARM ?

C:\workspace\v12>mbed compile -t GCC_ARM -m NUCLEO_F072RB - - profile mbed-os/tools/profiles/small.json

is the small.json profile 100% compatible with GCC_ARM compiler ?

are there any other flags/directives/methods for the GCC compiler that would help reduce the size ?

I have downloaded and installed MDK522 and licensed for the Cortex-M0

luckily my project is using the M0.

it compiles now, but still oversize :frowning:

online with 103k, with my CAN code and CANnucleo which is now depreciated in mbedOS
offline 112k. without any CAN code

are there other flags I can adjust ?
like:
<>
// Configuration parameters
MBED_CONF_EVENTS_PRESENT 1 // set by library:events
MBED_CONF_RTOS_PRESENT 1 // set by library:rtos
MBED_CONF_PLATFORM_STDIO_BAUD_RATE 9600 // set by library:platform
MBED_CONF_NSAPI_PRESENT 1 // set by library:nsapi
MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE 9600 // set by library:platform
MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT 1 // set by library:platform
MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES 0 // set by library:platform
// Macros
UNITY_INCLUDE_CONFIG_H // defined by library:utest
<
>

Are you still using the small build profile?

Yes, but if you check my other post, the RAM may be the problem,

There is only 1k free and its complaining about no stack being allocated.

I don’t expect my stack to go much over 0x100 bytes…