ChibiOS/RT 2.6.7 STM32F407 CCM linker error

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

fjb
Posts: 11
Joined: Tue Dec 07, 2010 9:49 pm

ChibiOS/RT 2.6.7 STM32F407 CCM linker error

Postby fjb » Tue Aug 18, 2015 8:44 pm

Hello,

when my project was small I used used the $(PORTLD)/STM32F407xG_CCM.ld linker script. Everything worked nicely. But when my project grew linking with that script started to fail. Disabling the debug features of ChibiOS/RT helped at first, but now even that doesn't help. And the debug features are way too useful to disable them anyway. The only way to link my project now is to use the $(PORTLD)/STM32F407xG.ld script. But that wastes precious RAM.

The linker errors I get are:


arm-none-eabi-g++ ../build/obj/crt0.o ../build/obj/vectors.o ../build/obj/chcore.o ../build/obj/chcore_v7m.o ../build/obj/nvic.o ../build/obj/chsys.o ../build/obj/chdebug.o ../build/obj/chlists.o ../build/obj/chvt.o ../build/obj/chschd.o ../build/obj/chthreads.o ../build/obj/chdynamic.o ../build/obj/chregistry.o ../build/obj/chsem.o ../build/obj/chmtx.o ../build/obj/chcond.o ../build/obj/chevents.o ../build/obj/chmsg.o ../build/obj/chmboxes.o ../build/obj/chqueues.o ../build/obj/chmemcore.o ../build/obj/chheap.o ../build/obj/chmempools.o ../build/obj/hal.o ../build/obj/adc.o ../build/obj/can.o ../build/obj/ext.o ../build/obj/gpt.o ../build/obj/i2c.o ../build/obj/icu.o ../build/obj/mac.o ../build/obj/mmc_spi.o ../build/obj/mmcsd.o ../build/obj/pal.o ../build/obj/pwm.o ../build/obj/rtc.o ../build/obj/sdc.o ../build/obj/serial.o ../build/obj/serial_usb.o ../build/obj/spi.o ../build/obj/tm.o ../build/obj/uart.o ../build/obj/usb.o ../build/obj/stm32_dma.o ../build/obj/hal_lld.o ../build/obj/adc_lld.o ../build/obj/ext_lld_isr.o ../build/obj/can_lld.o ../build/obj/ext_lld.o ../build/obj/mac_lld.o ../build/obj/sdc_lld.o ../build/obj/pal_lld.o ../build/obj/i2c_lld.o ../build/obj/usb_lld.o ../build/obj/rtc_lld.o ../build/obj/spi_lld.o ../build/obj/gpt_lld.o ../build/obj/icu_lld.o ../build/obj/pwm_lld.o ../build/obj/serial_lld.o ../build/obj/uart_lld.o ../build/obj/board.o ../build/obj/lwipthread.o ../build/obj/sys_arch.o ../build/obj/etharp.o ../build/obj/dhcp.o ../build/obj/dns.o ../build/obj/init.o ../build/obj/mem.o ../build/obj/memp.o ../build/obj/netif.o ../build/obj/pbuf.o ../build/obj/raw.o ../build/obj/stats.o ../build/obj/sys.o ../build/obj/tcp.o ../build/obj/tcp_in.o ../build/obj/tcp_out.o ../build/obj/udp.o ../build/obj/autoip.o ../build/obj/icmp.o ../build/obj/igmp.o ../build/obj/inet.o ../build/obj/inet_chksum.o ../build/obj/ip.o ../build/obj/ip_addr.o ../build/obj/ip_frag.o ../build/obj/def.o ../build/obj/timers.o ../build/obj/api_lib.o ../build/obj/api_msg.o ../build/obj/err.o ../build/obj/netbuf.o ../build/obj/netdb.o ../build/obj/netifapi.o ../build/obj/sockets.o ../build/obj/tcpip.o ../build/obj/nonstd.o ../build/obj/stubs.o ../build/obj/rng_afm.o ../build/obj/chprintf.o ../build/obj/evtimer.o ../build/obj/syscalls.o ../build/obj/ch.o ../build/obj/list.o ../build/obj/dataBuffer.o ../build/obj/debugPrinter.o ../build/obj/connector.o ../build/obj/connection.o ../build/obj/connectionKey.o ../build/obj/lwipRawTcpConnector.o ../build/obj/lwipRawTcpConnection.o ../build/obj/lwipRawTcpBufferManager.o ../build/obj/jump.o ../build/obj/module.o ../build/obj/segment.o ../build/obj/base.o ../build/obj/message.o ../build/obj/state.o ../build/obj/worker.o ../build/obj/workerTicket.o ../build/obj/workerTimer.o ../build/obj/master.o ../build/obj/main.o -mcpu=cortex-m3 -O0 -ggdb -fomit-frame-pointer -falign-functions=16 -ffunction-sections -fdata-sections -fno-common -nostartfiles -Wl,-Map=../build/upm.map,--cref,--no-warn-mismatch,--library-path=,--script=../ChibiOS/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld,--gc-sections -mno-thumb-interwork -mthumb -o ../build/upm.elf
c:/users/frank/chibi-eclipse/tools/gcc-arm-none-eabi-4_9-2015q2-20150609/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: address 0x10001220 of ../build/upm.elf section `.data' is not within region `ram'
c:/users/frank/chibi-eclipse/tools/gcc-arm-none-eabi-4_9-2015q2-20150609/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: address 0x1001740c of ../build/upm.elf section `.bss' is not within region `ram'
c:/users/frank/chibi-eclipse/tools/gcc-arm-none-eabi-4_9-2015q2-20150609/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: address 0x10001220 of ../build/upm.elf section `.data' is not within region `ram'
c:/users/frank/chibi-eclipse/tools/gcc-arm-none-eabi-4_9-2015q2-20150609/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: address 0x1001740c of ../build/upm.elf section `.bss' is not within region `ram'
c:/users/frank/chibi-eclipse/tools/gcc-arm-none-eabi-4_9-2015q2-20150609/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: address 0x10001220 of ../build/upm.elf section `.data' is not within region `ram'
c:/users/frank/chibi-eclipse/tools/gcc-arm-none-eabi-4_9-2015q2-20150609/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: address 0x1001740c of ../build/upm.elf section `.bss' is not within region `ram'
collect2.exe: error: ld returned 1 exit status
make: *** [../build/upm.elf] Error 1


The .data sections are ending up in the CCM.

I don't know much about linker scripts so any help would be appreciated. I could switch to ChibiOS/RT 3.0 if that will solve my problem.

Greetings
Frank

User avatar
Giovanni
Site Admin
Posts: 14056
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 990 times
Been thanked: 839 times
Contact:

Re: ChibiOS/RT 2.6.7 STM32F407 CCM linker error

Postby Giovanni » Tue Aug 18, 2015 9:29 pm

Hi,

3.0 linker script allow for a more flexible allocation of objects in the various memory areas.

Giovanni

fjb
Posts: 11
Joined: Tue Dec 07, 2010 9:49 pm

Re: ChibiOS/RT 2.6.7 STM32F407 CCM linker error

Postby fjb » Sun Feb 21, 2016 11:56 pm

Switching to 3.1 made it the CCM work. Thank you very much.


Return to “STM32 Support”

Who is online

Users browsing this forum: Google [Bot] and 10 guests