C programming in M4 using linux

Discussion in 'UDOO NEO' started by Goutam bhat, Jan 11, 2017 at 2:55 PM.

  1. Goutam bhat

    Goutam bhat New Member

    Joined:
    Dec 29, 2016
    Messages:
    3
    Likes Received:
    0
    I have a c code , i need to execute that program in M4 processor using linux terminal. Can anyone please guide me how to do it?
     
  2. Andrea Rovai

    Andrea Rovai Administrator Staff Member

    Joined:
    Oct 27, 2014
    Messages:
    1,545
    Likes Received:
    189
  3. waltervl

    waltervl Well-Known Member

    Joined:
    Dec 12, 2015
    Messages:
    821
    Likes Received:
    254
  4. Goutam bhat

    Goutam bhat New Member

    Joined:
    Dec 29, 2016
    Messages:
    3
    Likes Received:
    0
    i dont want to use arduino sketch. Is there any way to execute C program without using arduino sketch using linux terminal only? Please give the solution
     
  5. waltervl

    waltervl Well-Known Member

    Joined:
    Dec 12, 2015
    Messages:
    821
    Likes Received:
    254
    In the documentation link Andrea gave is the following instruction which does exactly what you want:
    Precompiled binary

    It's possible to upload a precompiled binary firmware on the M4 using this command:

    udooneo-m4uploader.sh <BINARY_PATH>
     
  6. Goutam bhat

    Goutam bhat New Member

    Joined:
    Dec 29, 2016
    Messages:
    3
    Likes Received:
    0
    Can you please say me what is precompiled binary firmware? Is it the object file which we get after compilation of C program? If not then how to get precompiled binary firmware of C program. Please guide me
     
  7. waltervl

    waltervl Well-Known Member

    Joined:
    Dec 12, 2015
    Messages:
    821
    Likes Received:
    254
    Yes that is the object file after compilation. To get a compiled object file please follow the link I already gave you. If you have more questions about that please ask the questions in that thread.

    There is no guide available. There are some examples in the he NXP forum and documentation. The link is in the other thread.
     
  8. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    199
    Likes Received:
    65
    Walters/Andreas advice isn't all correct (and confusing), if want to run 'C' code on the M4 your options are to either develop your application using FreeRTOS or MQX. The compiled binary should only be loaded onto the M4 using uboot, if your attempting to do this after the A9 has booted Linux then your asking for problems. The bare metal approach for running code on the M4 isn't recommended for novices due to the complexity of initialising the M4 before running your application code. In fact all the approaches require you to get up to speed with the boot process for the i.mx6sx and understanding the heterogeneous architecture which can be found in the Reference Manual.

    If the above isn't making much sense then you have a steep learning curve to achieve your objective.
     
    Last edited: Jan 14, 2017 at 9:31 PM
    waltervl likes this.

Share This Page