This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

code stuck with nrf52-mpu-easydma-using-timers-and-drivers

Hello Everyone,

I am using /nrf5-mpu-examples nrf52-mpu-easydma-using-timers-and-drivers. When I tried to change the TWIM_RX_BUF_WIDTH to get the gyro data, the code stuck in while loop and no event come. After experimenting with TWIM_RX_BUF_LENGTH when I change the length to 3, the code runs smoothly. changing TWIM_RX_BUF_LENGTH to even 4 and then no event come and thus no data at all. I think it is stack size issue and I even change that in arm_startups from 8192 bytes to even 30KB but no improvement. I want to use sensor fusion library along with it and it is a small library but the code stuck issue is really a pain. 

Kindly help me if you ever come across this problem.

Thank you

Parents
  • Hi,

    There seems to be a weird relationship between the timer used to trigger the TWI transfers and the size of the buffer. If you use 20 ms intervals and a >82 bytes long buffer the timer doesn't seem to trigger any interrupts (or TWI transfers) at all. And even stranger, if you use a buffer of 75 bytes, the timer seems to trigger events at ~4 ms intervals even though it is configured for 20 ms intervals. If you decrease the intervals to 50 ms you can use 14x7 bytes buffers. I'll have to do some further debugging on this one. 

Reply
  • Hi,

    There seems to be a weird relationship between the timer used to trigger the TWI transfers and the size of the buffer. If you use 20 ms intervals and a >82 bytes long buffer the timer doesn't seem to trigger any interrupts (or TWI transfers) at all. And even stranger, if you use a buffer of 75 bytes, the timer seems to trigger events at ~4 ms intervals even though it is configured for 20 ms intervals. If you decrease the intervals to 50 ms you can use 14x7 bytes buffers. I'll have to do some further debugging on this one. 

Children
Related