This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SD Card Boot and Flashing tool fails to recompile

When compiling the SD card boot and flashing tool, I get several errors:

DM35x/selfcopy.o:(.ARM.exidx.selfcopy+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/boot.o:(.ARM.exidx.boot+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/device.o:(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/device.o:(.ARM.exidx+0x68): undefined reference to `__aeabi_unwind_cpp_pr1'
DM35x/debug.o:(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr1'
DM35x/debug.o:(.ARM.exidx+0x8): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/uart.o:(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/uart.o:(.ARM.exidx+0x18): undefined reference to `__aeabi_unwind_cpp_pr1'
DM35x/util.o:(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/memory_test.o:(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/sdcard_flash.o:(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/mmcsd_protocol.o:(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/mmcsd_evm.o:(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
DM35x/nand.o:(.ARM.exidx+0x0): more undefined references to `__aeabi_unwind_cpp_pr0' follow
collect2: ld returned 1 exit status
make[1]: *** [DM35x/sdcard_flash] Error 1

The toolchain from CodeSourcery was installed as described in GSG: DVEVM Software Setup for DM3xx Platforms . I changed the Makefile to point to the correct compiler as follows:

#CROSSCOMPILE?= arm_v5t_le-
CROSSCOMPILE?= arm-none-linux-gnueabi-
CC= $(CROSSCOMPILE)gcc

Does anybody know why I get the above listed errors?

Thank you.

  • Please use MonatVista toolchain arm_v5t_le-*

  • I tried and get a different message.

    /tmp/ccfuzTfg.s: Assembler messages:
    /tmp/ccfuzTfg.s:43: Error: bad expression -- `mrc p15,#0,r0,c1,c0,#0'
    /tmp/ccfuzTfg.s:53: Error: bad expression -- `mcr p15,#0,r0,c1,c0,#0'
    make: *** [DM35x/boot.o] Error 1

  • What is the context?

    It seems is UBL, actually it should be excluded from compilation. Just ignore.

  • Here is the whole thing with command prompts:

    vmplanet@ubuntu:~/Downloads/dm3xx_sd_boot-6.1/sdcard_flash$ make
    arm_v5t_le-gcc -DUBL_NAND=1 -Os -IDM35x -DDM35x -g -DANSI_COLORS --include sdc_debug.h -I../flash_utils/Common/include -I../flash_utils/DM35x/Common/include -I../flash_utils/Common/arch/arm926ejs/include -I../flash_utils/Common/sft/include -I../flash_utils/Common/gnu/include -I../flash_utils/Common/drivers/include -I ../flash_utils/Common/ubl/include ../flash_utils/Common/arch/arm926ejs/src/boot.c -c -o DM35x/boot.o     
    /tmp/ccgMEv3X.s: Assembler messages:
    /tmp/ccgMEv3X.s:43: Error: bad expression -- `mrc p15,#0,r0,c1,c0,#0'
    /tmp/ccgMEv3X.s:53: Error: bad expression -- `mcr p15,#0,r0,c1,c0,#0'
    make: *** [DM35x/boot.o] Error 1
    vmplanet@ubuntu:~/Downloads/dm3xx_sd_boot-6.1/sdcard_flash$

  • I was able to recompile without errors after editing boot.c and selfcopy.c under

    dm3xx_sd_boot-6.1/flash_utils/Common/arch/arm926ejs/src

    In the lines that generate errors I just deleted '#' symbols. Somehow, MV toolchain does not know what to do with those symbols.

    I still need to test and make sure the tool works after the file are modified.

  • A little update to the error with __aeabi_unwind_cpp_pr0.

    Some other post on this forum mentioned that __aeabi_unwind_cpp_pr0 was used in handling exceptions. The function is defined in a libgcc_eh.a (some kind of library)

    I also noticed that the error was happening during linking. I  tried to figure out a way to add that file to my linking process. That did not work. I tried to make sence out of the "undefined  __aeabi_unwind_cpp_pr0" errors. So, the linker comes across some function (in particular __aeabi_unwind_cpp_pr0) that is no where to be found. The linker is told to not use stdlib (there is a -nostdlib flag in the sdcard_flash/Makefile). Also, the error lines say that the calls are present in my .o (object files). My code did not call that function. So, it mist have come from somewhere else. Maybe compiler was adding calls to that function. Then I noticed that compiler did not have -nostdlib flag. So...

    ...here is what I have done to compile SD card  flashing tool using CodeSourcery toolchain.

    I changed one line in sdcard_flash/Makefile by adding -nostdlib at the end of the line:

    CFLAGS+= -DUBL_NAND=1 -nostdlib

    I also modified my crosscompiler line to use CodeSourcery toolchain:
    CROSSCOMPILE?= arm-none-linux-gnueabi-
    After running make clean and then make the code compiled without errors.
    It also reduced the size of my binary from 29280 down to 26956 bytes.

  • You are really a good guy, thank you!