Sunday, August 27, 2017

CleanFlight update to Linux

Making slow progress, on updating CleanFlight to access SPI, I2C and serial port on Linux.

Progress:
  • Updating bus_spi_linux.c to support SPI.
    • Still updating access functions based on previous work using LinuxFlight
  • Update scheduler to use libevent
    • Some of the issues with the current scheduler:
      • Does not use events, but polling for status for event block
      • Uses it's own timer framework
    • Created a new scheduler based on libevent
      • Using libevent timer framework
      • Adding a way for HW events and SW events to trigger a fc_task to wake.
        • Need some way to schedule based on priority, but will put this off, due progessing loop will not pause very long to progress a event, execept for I2C and SPI events.  Will change this next round to have another HW scheduling thread.
  • Need to branch LinuxFlight and push the new round of changes to to github.  With the support of SITL in cleanflight, minimal changes are needed. 
IO Board:
  • UDP via USB is not the fastest, about 500us for a 512 byte packet.  The main issue is full speed USB uses 64 bytes per interrupt.  So, it takes 8 USB packets to transfer one UDP 512 packet.  Once micro-controllers move to high speed USB, then USB packet is 512 bytes. 
  • Able to decode PWM signals
  • logging framework is done.

No comments:

Post a Comment