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.

Hello world Linux application using CCS and deploying to EVMK2H, I have a couple questions..

Alright!

Well this is my first time deploying a Linux OS, I usually use an RTOS or plain code.  

I have gone through every document i could find. I have deployed Linux to the eval board through both TFTP server running in ram and now have the file system running on the NAND flash with the Linux kernel residing and booting from there.

The biggest questions I'm running into is how do I develop a simple hello world program to run on Linux using CCS. Or mostly what configurations are necessary to compile a simple hello program. 

I watched this video: https://www.youtube.com/watch?v=up05mdE7Mb4 "Linux Application Debug with Code Composer Studio". And as I understand that the best way to deploy the program is to switch the Linux from running on the NAND and move it to a network boot with NFS to effectively "share" the program one I get it compiled. 

What tool chain should I be using when I create the project? in the video he selects one tool chain and then later switches it to a different tool chain. as I understand the appropriate tool chain should be Linaro? or can I use Cross GCC? Also Cross GCC is the only tool chain option I am given for my platform configuration unless I deselect " show project types and tool chains only supported by platform". When I Deselect that the Linux GCC toolchain becomes available. 

Maybe there is an example that someone could point me to.

Any help would be greatly appreciated, I have been racking my head against the table over this and I know its something simple i'm missing.

Thanks!

Andrew

  • After more searching I started to look around to see how it was done for the BeagleBoards and i found this link here:

    http://processors.wiki.ti.com/index.php/How_to_create_GCC_projects_in_CCSv5 now this is an example for the sitara A8 Processor. In this example they are creating an "Cross-Compile Project", in CCS5.5 I cannot find that option. Instead I selected the "hello World ANSI C Project" and selected the Cross GCC toolchain as they selected in their example. The then refference the CodeSourcery g++ lite tools. That was from 2012.

    I'm using the latest http://www.ti.com/tool/bioslinuxmcsdk MCSDK for the DSP+ A15 and it apparently includes the latest Linaro toolchain, but I cannot find the toolchain in the MCSDK folders.

  • Hi, Andrew,

    The tool chain can be downloaded through the link in Chapter Tools of Keystone-II User's Guide, http://processors.wiki.ti.com/index.php/MCSDK_User_Guide_for_KeyStone_II

    You will need to set up the Prefix and Path for the Cross GCC to Linaro tool chain.

    Rex

  • Thanks Rex!

    Ok great, I have that part set correct I think. My next question is about the target related options for the arm and cross-compile. In the document for the Sitara it is spelling out the following:

    "Since this project type is for the generic GCC compiler, all target-related options typically used for ARM cross-compile (-march=armv7-a, -mtune=cortex-a8 and others, which would be dependent on the processor you are using) must be specified manually in the project build options under: GCC C++ Compiler or GCC C Compiler --> Miscellaneous --> Other flags. Note that if you have multiple build configurations that you want these options to apply to, be sure to select All Configurations before setting the options."

    So my question is what configurations should I set for the EVMK2H? Or is there a document listing all the available options that i can choose from and appropriate settings?

    Thanks for the help! much appreciated!

    Andrew

  • Hi, Andrew,

    I am not sure about the description for Sitara if that is for native build. It also uses generic GCC and I think that is GNU GCC(?). It won't work for K2H. I didn't set any of those you mentioned but the prefix and PATH in CCS and it pretty much set up for cross compile.

    Do you have to use CCS? Have you thought of developing on the linux machine using cross compiler?

    Rex

  • Hey Rex, 

    No I don't have to use ccs to develop the program. I was just using that based on the tutorials I had found. This is my first time developing and application for a Linux based system so I'm just becoming familiar with the tools and methods. How do you recommend going about this and/or can you point me to some tutorials for developing applications on embedded Linux. I plan to use GDB to do the debugging but I am open to suggestion on the IDE/Compiler or other tools.

    There is not really clear example of how to set all of this up for the first time. I'm used to writing an application and running it directly on the microprocessor without an OS running underneath it.

    Thanks for the help!

    Andrew

  • Hi, Andrew,

    I am not sure if you have gone through the Keystone-II User's Guide (link to wiki page provided below). Please take a look at the Tools chapter. It gives you the link to download Linaro cross-compiler, and how your host machine needs to be set up. You can write your own hello c file, or copy the one created by CCS. In your Linux terminal window, type "arm-linux-gnueabihf-gcc hello.c". Then tftp (or copy if using nfs mounted file system) the executable to the EVM to run. When I set up my CCS to compile helloworld, the prefix and path I mentioned in previous post was pretty much followed the tool chain setup in Tools chapter.

    http://processors.wiki.ti.com/index.php/MCSDK_User_Guide_for_KeyStone_II

    Either CCS or GDB works for debugging. I believe gdbserver is provided in the pre-build EVM file system, tisdk-rootfs.cpio.gz.

    Rex