User Tools

Site Tools


 Porting PX4 to the Sparky2 flight controller




Since the Sparky2 doesn't use the same pin as the PX4 boards, some hacking is required to disable VBUS sensing (if I recall correctly). I forked the repository and made a small patch to the bootloader. It seems to be working fine.




The PX4 fork of NuttX is a little bit old and some drivers are not available. ie: the M25P16 flash is not supported, so I backported the patch from the original repository. It's enough to be able to use the flash, but it stil l doesn't work (yet); more details below.


  • Serial (57600, 8N1)
  • MPU9250
Not Working
  • MTD

    The M25P16 is only page erasable (64 kiB) and the MTD subsystem tries to kmalloc enough memory to be able to copy the whole page in RAM before erasing (and re-writing). Since PX4 uses two partitions, it requires 128 kiB of RAM only for the MTD subsystem. The Sparky2 only has 192 kiB of RAM, it's not possible to waste 128kiB for just nothing.

    Possible workaround is to use M25PE16 flash, which is subsector erasable (4 kiB). The Flash ID is not the same (80h instead of 20h), so going back to TauLabs will be a bit tricky but it's worth a try (the chips are not really expensive).

    libuavcan does not compile with current stable PX4 firmware, some C++-related issue
  • F4by THis board uses a M25P16 flash as well, but I don't know if/how they got it working with the MTD subsystem
/home/share/www/ · Last modified: 2019/12/25 15:40 (external edit)