i2c+timer+work keeps getting -22 or -128 and keep crashing

Hi,

I am using i2c to get sensor data. At first the client write a value to the service. In the service on write callback it trigger's a timer, in the timer, it submit a work. In the work handler, it reads data and then notify the client.

but the notify keeps returning -22 or -128, the bluetooth is connected, and the notify data is correct.

When the client disconnect, the chip crashed and auto restarted.

How should I fix this?

Thanks,

Parents Reply
  • Hi 

    The development platform for the nRF52811 is the nRF52840DK, and it is recommended to get one of those so you can debug the application when needed. 

    There are board files in the SDK allowing you to build for the nRF52811 on the nRF52840DK. 

    Thanks for sharing the code. I can't spot any issues in the code you shared that would explain the problem, but the code you shared doesn't show the whole application either. For instance it doesn't show where you call the fetch_and_display(..) function, which could be relevant to the issue. 

    Would you be able to share the entire project so I can try to run it on my end and reproduce the problem? 

    I can make the case private if you don't want to share your code in a public ticket. 

    Best regards
    Torbjørn

Children
Related