AnsweredAssumed Answered

how to compile the "device_program" in ATK R1.60 ?

Question asked by Federico Strati on May 11, 2016
Latest reply on May 11, 2016 by Federico Strati

Question: how to compile the "device_program" in ATK R1.60 ?

 

Context: "i.MX Platform Advanced Tool Kit (ATK) Standard R1.60"

 

I'm working with a legacy product based on a i.MX27 board.

As I understand the ram kernel mx27_nand.bin

may be obtained from this ATK R1.60.

 

As the old gnu toolchain is not available anymore

(ref. doc. "ATK Reference Guide Standard Version.pdf")

I'm working with a recent toolchain for gnu arm.

I modified accordingly the file "rules.make":

------rules.make----------

CC = arm-none-eabi-gcc

AS = arm-none-eabi-as

LD = arm-none-eabi-ld

NM = arm-none-eabi-nm

OBJDUMP = arm-none-eabi-objdump

OBJCOPY = arm-none-eabi-objcopy

READELF = arm-none-eabi-readelf

RM = rm -f

RN = mv

CP = cp

TOPDIR = $(shell pwd)

BIN  = arm-none-eabi-objcopy

LIBDIR = "/usr/lib/gcc/arm-none-eabi/5.2.1/"

SHELL = /bin/sh

 

 

CFLAGS = -Wall -Wstrict-prototypes -Wno-trigraphs  -nostartfiles -O0  -nostdlib \

         -static -feliminate-unused-debug-symbols -fno-strict-aliasing -fno-common \

         -pipe -fno-builtin  -g -mapcs -mlittle-endian \

         -msoft-float -mfpu=vfp

------rules.make----------

where the modifs are for CC & other variables and the option -mfpu=vfp for the floating point unit.

 

When I try to compile with:

"make MCU=mx27 flashlib FLASH_TYPE=NAND"

 

I get the following errors:

-------

ram_kernel/ramkernel.o: In function `pop_usb_dqh':

device_program/ram_kernel/src/platform/mx27/channel.c:559: undefined reference to `memcpy'

ram_kernel/ramkernel.o: In function `push_usb_dqh':

device_program/ram_kernel/src/platform/mx27/channel.c:566: undefined reference to `memcpy'

flash/flashlib.o: In function `write_bbt':

device_program/flash/nand_flash/src/nand_bbt.c:553: undefined reference to `memset'

device_program/flash/nand_flash/src/nand_bbt.c:557: undefined reference to `memcpy'

flash/flashlib.o: In function `nand_update_bbt':

device_program/flash/nand_flash/src/nand_bbt.c:728: undefined reference to `malloc'

device_program/flash/nand_flash/src/nand_bbt.c:760: undefined reference to `free'

flash/flashlib.o: In function `nand_scan_bbt':

device_program/flash/nand_flash/src/nand_bbt.c:844: undefined reference to `malloc'

device_program/flash/nand_flash/src/nand_bbt.c:859: undefined reference to `free'

flash/flashlib.o: In function `nand_init':

device_program/flash/nand_flash/src/nand_flash.c:128: undefined reference to `malloc'

device_program/flash/nand_flash/src/nand_flash.c:130: undefined reference to `memset'

flash/flashlib.o: In function `nand_erase_conditional':

device_program/flash/nand_flash/src/nand_flash.c:428: undefined reference to `free'

flash/flashlib.o: In function `nand_write_page':

device_program/flash/nand_flash/src/nfc_base.c:360: undefined reference to `memset'

collect2: error: ld returned 1 exit status

-------

 

It seems like the ram kernel should link with the std libc, but on the compile flags

we have "-nostartfiles -nostdlib", hence not the std libs asked...

 

My question is: what am I missing as a library to link to this ram kernel ?

Outcomes