AnsweredAssumed Answered

Creating bare project with GCC toolchain

Question asked by ritesh unde on Mar 11, 2019
Latest reply on Mar 13, 2019 by Kerry Zhou

Hi,

I am creating bare project for MIMXRT1050-EVK with GCC toolchain, for this I have taken reference from "led_blinky" demo app from SDK "SDK_2.5.0_EVKB-IMXRT1050" and using "gcc-arm-none-eabi-8-2018-q4-major-win32" toolchain.

 

I copied all dependent source files, libraries and compiled them using command

"arm-none-eabi-gcc -Wall -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16  -Qn -Os -c led_blinky.c -o led_blinky.o"

 

Linked all object files and added in program code section of link file "MIMXRT1052xxxxx_flexspi_nor.ld"

 

/* The program code and other data goes into internal RAM */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
MPLCthree.o (*.text)
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
} > m_text

 

added SEARCH_DIR path for toolchain

 

SEARCH_DIR("D:\ToolchainM7\lib\gcc\arm-none-eabi\8.2.1\thumb\v7e-m+dp\hard")

SEARCH_DIR("D:\ToolchainM7\arm-none-eabi\lib\thumb\v7e-m+dp\hard")

linked file with command 

 

ld -cref -Map map.txt -S -T MIMXRT1052xxxxx_flexspi_nor.ld -lm -lc -lgcc -lnosys

 

it gives me error

 

undefined reference to `_start'

Outcomes