2 years, 9 months ago.

App Slowdown

Hi,

I'm creating an application for the nRF52832 platform using mbed-os. My device runs several threads alongside each other, including a bluetooth event handling thread/eventqueue

After a while, the device seems to become unresponsive, however it is now apparent the device is still running the application. However, it is running very slowly (for example: a long button press that is supposed to be 3 seconds is 20 seconds).

Any tips on where to look for the cause of this slowdown?

I had a problem a while back with the rtos idle thread calling sleep(). The hal system ticks were being disrupted and it was slowing everything down. But it was only like a 20% slowdown, but the orders of magnitude you are seeing. Worth checking though.

Obviously you could have something blocking in a loop somewhere preventing other code from executing. You could have some sort of repeat interrupt firing constantly hogging all cpu cycles. Suppose you could have accidentally changed the PLL registers and actually slowed the clock down.

posted by Graham S. 21 Feb 2018

See this issue in github: https://github.com/ARMmbed/mbed-os/issues/6207

I have confirmed that it was the I2C driver (i2c_api.c for the NRF5 targets) causing this slowdown. For some reason, the default timeout is 1 second! So at some point, an error would occur on the I2C bus and then every transaction after that would cause timeouts as well causing 1 second blocking delays in every thread that uses I2C at some point....

As per the discussion in the linked github issue, the current I2C driver has "several issues" and there's an update in the works to bring the nRF528XX devices up to Nordic SDK 14.2 (current it's at version 11). Not sure when the fix is coming to the master release...

posted by George Beckstein 26 Feb 2018
Be the first to answer this question.