These are chat archives for PX4/Hardware

23rd
Feb 2016
Andrew Tridgell
@tridge
Feb 23 2016 01:59
hi All, some ArduPilot users have reported parameter corruption on Pixracer after a reboot. I have reproduced it on my board. I have also reproduced FRAM write failures using "mtd rwtest" but only when the ms5611 driver is running. I have also reproduced it on px4 master, so it is not ardupilot specific
for anyone who is interested, the way I reproduced it in px4 master is
1) replace rcS with just "sercon" and "nshterm /dev/ttyACM0 &", so I get a convenient nsh shell on usb on startup (I don't have a debug cable setup)
2) on boot, connect with terminal program on usb, run "uorb start" followed by "mtd start /fs/mtd", followed by "mtd rwtest /fs/mtd"
I find that rwtest is reliable. I then start ms5611 using "ms5611 start"
and after that mtd rwtest /fs/mtd is no longer reliable. It fails some runs
this indicates a likely failure of communication with the FRAM
interestingly, it is failing in a write test, like this: "mtd: write failed"
that indicates the FRAM drivers knows it fails the write, it isn't just silent corruption
I also noticed that px4 is not running the mtd rwtest on startup.
Andrew Tridgell
@tridge
Feb 23 2016 02:14
@pkocmoud how difficult would it be to get a SPI bus trace on a Pixracer on the FRAM/ms5611 bus? We would need the two chip select pins plus MISO and MOSI.
Mark Whitehorn
@kd0aij
Feb 23 2016 03:43
It looks like "mtd rwtest" isn't locking the SPI bus, so there would definitely be collisions with the MS5611. But the code in param.c looks OK to me.
Mark Whitehorn
@kd0aij
Feb 23 2016 04:25
@tridge I have run into problems in the past with fs/mtd/params being corrupted on cycling power (likely due to a write being interrupted on power-down), but I've cycled power on my PixRacer dozens of times in the past week without encountering any problems running PX4 master.
Andrew Tridgell
@tridge
Feb 23 2016 05:02
@kd0aij I hadn't noticed the special case for blocking interrupts in param.c on FMUv4. That indeed explains the difference. Not nice
Andrew Tridgell
@tridge
Feb 23 2016 05:37
i've put the same workaround in ArduPilot now, although we really should fix the SPI locking to work with ramtron properly in future
Nick Arsov
@nickarsov
Feb 23 2016 07:13
Hi Andrew, here's the picture with test points. All test point labels correspond to the STM32F427VIT6 pin names:
This message was deleted
Pixracer_RC12_DEC052015_BOT.png
...for example C2 means FMU PC2 pin