Interrupts with flymaple HAL

I am developing my own flight controller board using the STM32f103RE, the same CPU that the flymaple board uses.

However, I am using an MPU6000 on SPI so I am using the AP_InertialSensor_MPU6000.cpp file. Monitoring the output using UART, everything looks fine, but when I connect to mission planner I am unable to change any parameters. I get 3 retries and a fail.

I've determined that the GCS_MAVLink messages received by the flight controller are not passing a crc check because there are missing bytes in the messges.

I know the _poll_data() interrupt in the MPU6000.cpp file is the problem because if I instead just read the sensor from the main code and not an interrupt, I don't get the Mavlink issue.

My theory is that I am in the _poll_data() function and then I am unable to be interrupted away to put the uart byte in the buffer to be read later, causing me to then fail a crc check.

Does anyone know how to get around this issue? I would like to poll the sensor at 1kHz and it seems an interrupt is the only way to do it.

Thanks

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity

DIY Robocars via Twitter
RT @chr1sa: Hey, @a1k0n's amazing "localize by the ceiling lights" @diyrobocars made @hackaday! It's consistently been the fastest in our…
yesterday
DIY Robocars via Twitter
RT @IMS: It’s only fitting that @BostonDynamics Spot is waving the green flag for today’s @IndyAChallenge! Watch LIVE 👉 https://t.co/NtKnO…
Sunday
DIY Robocars via Twitter
RT @IndyAChallenge: Congratulations to @TU_Muenchen the winners of the historic @IndyAChallenge and $1M. The first autonomous racecar comp…
Sunday
DIY Robocars via Twitter
RT @JoeSpeeds: 🏎@TU_Muenchen #ROS 2 @EclipseCyclone #DDS #Zenoh 137mph. Saturday 10am EDT @IndyAChallenge @Twitch http://indyautonomouschallenge.com/stream
Sunday
DIY Robocars via Twitter
RT @DAVGtech: Another incident: https://t.co/G1pTxQug6B
Sunday
DIY Robocars via Twitter
RT @DAVGtech: What a great way to connect why @diyrobocars community is so valuable and important! Have to start somewhere @IndyAChallenge…
Sunday
DIY Robocars via Twitter
RT @DAVGtech: https://t.co/GwkbSBjdGa
Saturday
DIY Robocars via Twitter
RT @DAVGtech: Good morning from @IndyAChallenge at @IMS. It was a late night, but worth it. Come see for yourself how the pass ended and ch…
Saturday
DIY Robocars via Twitter
RT @circuitlaunch: Robot fun this Saturday (23) at Circuit Launch! From 10am to 4pm. Lots of robots, autonomous car racing training, tech t…
Friday
DIY Robocars via Twitter
RT @chr1sa: 10 of these autonomous racecars will be competing tomorrow at the Indianapolis raceway
Friday
DIY Robocars via Twitter
RT @a1k0n: Sync'd @joshu's GoPro w/ my datalogging; video is 2.5X speed, Google imagery upper-right. Found out my track boundaries are WAY…
Oct 18
DIY Robocars via Twitter
RT @a1k0n: Also, at 45mph, the front tires literally blow up like a balloon and it doesn't have much front traction, so the car becomes fai…
Oct 18
DIY Robocars via Twitter
RT @a1k0n: Okay, some datalogs! Green dots are precalculated racing line (from my crummy optimizer -- it veers to the middle after 2 for Re…
Oct 18
DIY Robocars via Twitter
RT @a1k0n: Welp my @selfracingcars entry, hastily conceived heading filter and all, actually worked! Heading home, datalogs and videos to f…
Oct 18
DIY Robocars via Twitter
Oct 18
DIY Robocars via Twitter
Oct 15
More…