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.

Linux/LAUNCHXL2-TMS57012: Problem uploading elf file into the TMS57012 microcontroller

Part Number: LAUNCHXL2-TMS57012
Other Parts Discussed in Thread: UNIFLASH

Tool/software: Linux

Hello, 

Trying to upload my own .elf file into the TMS57012 board using the uniFlash Linux CLI tool but I get this error from the Linux shell: 

DSLite version 8.1.0.1275
Configuring Debugger (may take a few minutes on first launch)...
Initializing Register Database...
Initializing: IcePick
Executing Startup Scripts: IcePick
Initializing: Dap
Executing Startup Scripts: Dap
Initializing: CortexR4
Executing Startup Scripts: CortexR4
Connecting...
CortexR4: GEL Output: Memory Map Setup for Flash @ Address 0x0Failed: Unable to open file: flash

The command I entered in the Linux shell is: 

dslite.sh flash -c /home/saeed/Desktop/TMS57012_Kernel/TMS570LS12_Configuration.ccxml -e -f -v /home/saeed/Desktop/kernel.elf

When the endianess flag is set to -mlittle-endian and I try to upload my .efl file into the cloud-based uniflash tool (dev.ti.com/uniflash), the uniFlash tool throws a different error: Does not match the target endianness, not loaded. Check project build options and target configuration file (ccxml). 

If I try to set the endianess flag to be -mbig-endian in the Makefile and then try make kernel.elf I get this error from Linux shell: arm-linux-gnueabi-ld: kernel.o: compiled for a big endian system and target is little endian

Right now, I'm trying to get myself started by uploading a very simple compiled code into the board. I am not using the TI ARM compiler, but I'm using the open source arm-linux-gnueabi-gcc compiler. I suspect the issue could be with the Makefile I've written so I've attached my Makefile, file.ccxml and the simple .C file I've mentioned (all files in a zip folder).

0564.proj.zip

Update: Actually, it would be nice if I can get guidance on creating the Makefile for this simple program using arm-linux-gnueabi-gcc tool.  The binary image I get when I compile does not seem to work because I think there is a problem with the CFLAGS, LDFLAGS, and the endianess.  Also, I'm not sure if the uniFlash tool automatically provides the startup.asm for properly reading the bin image I upload into the board.

  • Hello Saeed,

    TMS570LS012x belongs to a big endian family and GCC does not support big endian. You will not be able to load a little endian executable to a big endian device.
  • Hi Wang, 

    Not sure what you are saying is accurate because this thread (https://answers.launchpad.net/gcc-arm-embedded/+question/189066) suggest there was a patch for big-endian support.

    Also, this is the unofficial patch to get gcc big-endian working on the TMS570 platform: 

    https://github.com/FreddieChopin/bleeding-edge-toolchain/commit/c8911853738dd5e1fa0d833c317da3806a92464b 

  • Hi Wang,

    I was able to patch the GCC toolchain to produce big-endiean file.bin image. I also produced a linker script from HAL code generator (sys_link.ld), which I intergated into my Makefile for compile-linking. Do you know whether if the startup.asm code is automaticlly integrated into my file.bin by UniFlash tool or do I have to create my own startup file and link it with my image?

    Thanks,
    Saeed
  • Hello Saeed,

    The unflash is used to erase the flash and prorgam the image to flash. It is not able to integrate startup.asm into your file.bin file. The startup.asm is part of your project, and it should be in compiled/linked into your file.bin.