How to use Heterogeneous Processing on Udoo Neo?

Discussion in 'UDOO NEO' started by compEng, Oct 25, 2017.

  1. compEng

    compEng New Member

    Joined:
    Oct 25, 2017
    Messages:
    5
    Likes Received:
    0
    Can anyone give me some example code on how to use udoo neo heterogeneous processor effectively? Or maybe some references about it.
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    What do you mean with heterogeneous use?
     
  3. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    A simple example would be to run code on the M4 ie a simple LED blinking example via the Arduino IDE and the equivalent code on the A9 side as a Linux application (see link). You extend this by introducing communication between the 2 core see link.
     
  4. compEng

    compEng New Member

    Joined:
    Oct 25, 2017
    Messages:
    5
    Likes Received:
    0
    What I mean by that is that I can use the power of both M4 and A9 for spesific task that need to be powerful and real-time. That was the benefit of having them right?
     
  5. compEng

    compEng New Member

    Joined:
    Oct 25, 2017
    Messages:
    5
    Likes Received:
    0
    Thanks. It was useful. But isn't that only using M4 and A9 on different process. I thought the power of this Udoo Neo is its heterogeneous processor that enable us to use M4 and A9 on same process (that neeed it) so it can be powerful yet real time.

    But understanding the communication on the link is quite useful. Sorry for the demand but how I can do that in Linux program. I can see on the tutorial is only for Arduino IDE and it is mentioning minicom. Is it possible to program on it? This is what I want to achieve : get data from arduino and do some little heavy computation on the A9 then send the result back to arduino. How I can do that?
     
  6. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    You have to see the Udoo Neo as a combination of for example a Raspberry Pi and a Arduino Uno connected with USB all on one board.
    The M4 part does the real time computing and sensor/actuator I/O, the A9 part the non real time computing , display to HDMI interface, running a webserver, network connection etc.

    The A9 part is running Udoobuntu (a customized Lubuntu), the M4 part is running a compiled binary that can be created by the Arduino IDE on the A9 or from your own computer.

    See my examples for some basic introduction:
    Howto Neo IoT Sensors
    ,
    Howto Neo Webcontrol
     
  7. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    For the NEO heterogeneous is referring to a multicore system, where the SOC has two or more cores that differ in architecture or micro architecture.
     
  8. TomAR

    TomAR New Member

    Joined:
    Nov 10, 2017
    Messages:
    2
    Likes Received:
    0
    I have the same question. I am acquiring 8kb of samples over the SPI in a time critical manner every 6mS so I would like to use DMA on the M4. I don't necessarily need an RTOS but the tasks are time critical and must be deterministic. I want to place this sensor data after some processing by the M4 in a shared memory space on the SOC so the Linux OS running on the A9 can access it. I also want to be able to send commands that originate in the Linux user space to the M4 to action. Is there any support for this or does the data exchange have to take place via external interfaces?. e.g Serial or some other method. I believe there is a hardware semaphore SEMA4 which can be used to avoid shared memory access collisions on the SOC. Is what I am trying to do possible using the Arduino IDE or do I have to look at a ARM DS or eclipse/gcc environment?
     
  9. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    Realistically your requirements on the M4 side can only be met either using an RTOS or bare metal, if your planning to use bare metal then the effort is greater. You would need to use ARM DS or eclipse/gcc for the M4 side. If want to use SEMA4 to share memory then you will need to developme a kernel driver in order to expose the data to user space, alternatively if you use FreeRTOS can you use rpmsg although you need to ensure the throughput meets your requirements.
     
    TomAR likes this.
  10. compEng

    compEng New Member

    Joined:
    Oct 25, 2017
    Messages:
    5
    Likes Received:
    0
    Thanks for your answer. So I can confirm from your answer that it is not possible to have one system using both the A9 and M4 together. They have to be on separated or different kind of process. Right?
     
  11. compEng

    compEng New Member

    Joined:
    Oct 25, 2017
    Messages:
    5
    Likes Received:
    0
    So actually udoo neo doesn't have any method to share data between A9 and M4 that already being provided by Udoo itself (not by external program such as rpmsg)? And in order to do that we have to add either SEMA4 or RTOS?

    But I found on this https://www.nxp.com/docs/en/reference-manual/IMX6SXRM.pdf on chapter 42 about Messaging Unit that by hardware it should have the ability to communicate between two processors.
     
  12. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    Not sure what question your trying to ask or address, udoo provide a simplified mechanism for sending data between the cores using a virtual serial port (ttyMCC) see link , however there are issues with it.

    You can roll your own code on both cores to use the Messaging Unit directly if that is what you prefer to do. However since Linux is running on the A9 this most likely requires a kernel driver.
     
  13. TomAR

    TomAR New Member

    Joined:
    Nov 10, 2017
    Messages:
    2
    Likes Received:
    0
    @compEng The IMX6 has the capability to do hardware messaging an conflict resolution but as Jas-Mx has said this, is not a easy thing to implement. You have 2 operating systems that need to run concurrently and that can share (or fight over) resources. I see the Jtag port is brought out on the board so I am going to have a go at using a J-Link to bare metal program the M4 using GCC/Eclipse. I'm still trying to get my head around how to debug when it looks like the A9 code has to run in order to start the M4.
    I have to compliment Udoo for bring out something that's only a fraction of the cost of the NXP sabre platform and will fit my use case perfectly if I can get it running.
     

Share This Page