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.

TMDSLCDK138: Getting Started with a Hello World Program Running on OMAP-L138 with Linux

Part Number: TMDSLCDK138
Other Parts Discussed in Thread: OMAP-L138

Hello,

I'm working with the TMDSLCDK138 development pcb and trying to learn Linux as a beginner.

The board boots Linux ok and I can see the serial output in a terminal program on my host PC.

I have CCS v10 and the Linux SDK v6.03 installed on my computer.

I've gone through sections 1.1.4. Download and Install the SDK to 1.1.6. Run Setup Scripts, but after that the documentation seems to only describe how to continue with other boards, and not in a generic sense.

If I want to run a program on the ARM CPU which is also running Linux, I believe my next steps are the following.

1. Learn how to build a program in CCS for a cross compile and reference libraries that are only present in the environment the program will be running (some king of runtime link takes place?)

2. Get the program on the file system of the ARM CPU running Linux.

3. Tell the ARM CPU running Linux to execute the program.

4. Now learn how to debug a program running on the ARM CPU running Linux, I believe I have to look into gdbserver for this?

If anyone knows of any documentation, tutorials, or examples that would help in accomplishing these goals that would be great.

Thanks!

  • Hi, Benjamin,

    1. I assume you are writing user space app on Linux, not kernel development. There are 2 ways of doing that.

    a. you can develop natively meaining on omap-l138 linux console. The tool chain is included in the filesystem. You can type "which gcc" and see it is in /usr/bin.

    b. you can cross-compile on Ubuntu Linux machine. The tool chain is included in Linux_sdk/linux-devkit folder. The cross-compiler is in linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi. set the PATH to include this directory. You will need to modify the compiler to use arm-oe-linux-gnueabi-gcc, not gcc, in makefile or use it directly. The set up should be similar to building Linux Kernel in 

    http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components_Kernel_Users_Guide.html

    but adjust the path and CROSS_COMPILE for omap-l138..

    2. You can either mount the SD card to your linux development machine and copy your executable to SD card, or scp directly to the omap-l138 evm if you have netowrk either with static IP configuration or hdcp served IP address to the EVM.

    3. Once the executable is in the filesystem, you can run it like on any linux system.

    4. I usually use printf to debug. You can use gdbserver, but I have not used it so I can't provide more info on this.

    Rex

  • Hi Rex,

    Thank you for the response.

    Yes, I will be building a program to run in user space.

    I'm sure your response answers my question, unfortunately my knowledge in this area is so scarce the response went right over my head.

    It looks like I'm going to have to take a step back to try and learn more of the basics behind developing for Linux, and learning about the OS in general.

    Thanks

  • Hi, Benjamin,

    Actually, you can start with 1a, and in the terminal console, write a hello.c file. Then compile it on omap-l138 with "gcc hello.c". It will have the executable a.out. Then execute it "./a.out", it will print the hello message on the console screen. 

    If doing 1b, you need to have PATH setup on Linux machine, you can then compile on Ubuntu with "arm-oe-linux-gnueabi-gcc hello.c". that should generate a.out. Then copy/scp a.out to omap-l138, then execute it the same way. 

    I may be off a bit on the exact command syntax to use. There should be a lot of info on internet on doing user space development which I won't be able to go through them, and user space is not in TI's support scope. If you have TI related kernel issue, please submit a new thread for it.

    Thanks!

    Rex

     

  • Hi Rex,

    I attempted to perform route 1a, but I am unable to copy the file to my micro SD card.

    For some reason the host Linux machine won't let me put it on the SD card in the rootfs partition, perhaps this entire section is read only?

    Another thing, even navigating the file system in the OMAP dev board seems odd, as the system does not recognize the dir command, nor is it even listed in the help menu.

    How are you supposed to be able to navigate the file system over the serial port?

    Ben

  • Ben,

    Are you using a linux machine or windows to read the SD card? If  windows machine, it doesn't work well with SD card with ext4 partition. Try use a Linux machine.

    This is Linux environment, use linux commands which "dir" is not one of them.

    Rex

  • Hi Rex,

    I was able to eventually get a simple hello world on the SD card, but I needed to enter my host pc's password to alter the contents of the SD card.

    I would be asked for credentials after trying to access the rootfs->home->root folder (see picture).

    After I supplied the credentials I could then put files on the SD card.

    Using the gcc hello.c generated a file a.out which if ran showed me the printf output in the console.

    Now I just have to learn how to generate the programs in Code Composer.

    Thanks!

  • Hi, Ben,

    Great and glad to hear you got it working.

    Rex