Logo-amall

Zephyr

Last active 2 months ago

17 replies

6 views

  • NI

    Zephyr

  • NI

    @uLipe we can discuss about it here.

  • UL

    Got ir

  • UL

    it**

  • NI

    third party integration seems to be really appropriate for Luos…

  • UL

    The modules structure of zephyr has the benefit of keep the responsibillity well decoupled

  • UL

    it may be the initial idea to move Luos into zephyr

  • UL

    I have been playing with FreeRTOS support, probably I will grab some ideas from there as well

  • NI

    is there any documentation about module management of Zephyr?

  • UL

    Hi @Nico 🤙 , sorry for the time to reply, here is the modules documentation:

    https://docs.zephyrproject.org/latest/develop/modules.html

  • UL

    In general you can use the module to place all zephyr build stuff and add the real code as a submodule

  • UL

    using the modules you can use the third party code public API directly from zephyr app.

  • UL

    I'm currently drafting something quick and dirty here.

  • NI

    Hi @uLipe,
    I'm currently working on the Native feature of Luos and have some treads running on my HAL. This is generating some race conditions mostly on msgalloc.c. We could have some other race condition on this specific location by having multiple thread running multiple services. So I will need to modify Luos to allow to deal with it by adding some mutex. My plan is to create some macros we could define at a HAL level allowing to lock and unlock mutex. We could also add a semaphore to trigger a luosloop execution in case of message reception.
    I will probably ask you some review or feedback about it…

  • UL

    Hi @Nico 🤙 , sure please let me know when you need some hints, I will be glad to review and test.

    Currently on Luos port for zephyr my solution is being to export the HAL/zephyr.h to the main application, here I defined a custom function to register a callback at every PTP event ( not sure if this is the best event to capture) when this occur a workqueue defer that callback allowing luos to execute asynchronously but at thread level that is it, no ISR context.

    One thing I'm using to mitigate the race conditions is to make the Luos loop to run nearly to atomic, by having the workqueue handler with high priority, so only a service at time would acess Luos internals at time.

  • NI

    Thank you @uLipe ,
    There is a lot of real-time constraints on the HAL. PTP are not really sensitive, they are 1ms critical so it could work, but byte reception is far more critical and I'm not sure you will be able to have the same strategy for it.
    This is what we want to change about network, right now it's so real time constrained that it is not very flexible.

  • UL

    The idea I'm using right now is to not touch on how luos hal is implemented.

    but since the edges of PTP are actually caught anyway, using this signal to schedule the Luos to spin gave me a good ( not the best) result and acceptable from application side.

    by the way, and sort of off-topic, robus remembers me an similar robot network with RT 1ms hyperperiod I implemented years ago, we did not have a PTP signal, our synchronisation mechanism was based using TDMA having each board a timeslot each 1ms to exchange data, for clockskew problem we developed a master beacon packet responsible to correct the joints clocks to avoid robot commands to be out of phase, nothing to worry, I just got interested on robus due to similarities 🙂

Last active 2 months ago

17 replies

6 views