Compiling Standalone Program in LTIB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compiling Standalone Program in LTIB

462 Views
garimella
Contributor I

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

0 Kudos
2 Replies

258 Views
garimella
Contributor I

Hi,

Can you please elaborate what it means writing to proper memory location? Are the commands correct? . I do not understand how to relocate the code to specific memory location?. Practical advice will be greatly appreciated.

0 Kudos

258 Views
alexander_yakov
NXP Employee
NXP Employee

Are you sure you are writing to proper memory location? Have you tried to write to the same locations, but using U-boot console commands?


Have a great day,
Alexander

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos