AnsweredAssumed Answered

Compiling Standalone Program in LTIB

Question asked by vishnu prasad on Jun 4, 2016
Latest reply on Jun 5, 2016 by vishnu prasad

I am trying to compile and download standalone program on a custom MPC8309 development board. Uboot was ported successfully.Facing the problems during execution of the code.

I have written simple C code to write a letter to a 4 character display (same operations was done using MM command and it worked)

 

int main()

{

        volatile unsigned int *SET = (volatile unsigned int *)0xe0000c00;

    volatile unsigned int *DISP = (volatile unsigned int *)0xe0000c08;

    while(1)

     {       

    *SET = 0xf7ff0000;

     *DISP= 0x02910000;

     }

}

used the command ./ltib -m shell

LTIB> gcc -o test test.c   (This generated test.exe)

LTIB> readelf -a test   (Noted down start address 0x10000284)

Then I converted elf to bin using objcopy -O binary test test.bin.

I used loadb command from uboot, dumped the file using hyperterminal in kermit mode

Uboot returned start address as 0x02000000. I typed go 0x2000000. This lead to self reset of the system.

Please let me know what is wrong? Also I want to know how to determine the memory range occupied by uboot in DRAM and changing the relocatable address in C file

Outcomes