adafruit / Adafruit_nRF52_Arduino

Adafruit code for the Nordic nRF52 BLE SoC on Arduino
Other
610 stars 494 forks source link

Adafruit ItsiBitsy nRF52840 Express hangs completely when using Fabrik2D library #638

Closed xchg-dot-ca closed 3 years ago

xchg-dot-ca commented 3 years ago

Describe the bug When using Fabrik2D library and trying to solve inverse kinematic scenario board hangs and requires hold reset procedure to reflsah. I assume board enters an infinite loop. I believe there is some kind of imperfection in double/float math library of the board. This issue is NOT happening on: Arduino UNO, Arduino Leonardo, Teensy 3.1, Arduino Due

Set up (mandatory)

To Reproduce Please install attached library or install it via the Library manager of the IDE Compile and Upload attached sketch example_3DOFToolAngle.zip Fabrik2D.zip

Screenshots n/a

Serial Log n/a

xchg-dot-ca commented 3 years ago

Disregard, issue was specifically with library not having return statement: https://github.com/henriksod/Fabrik2DArduino/pull/20

Still interesting to see different behaviour for Adafruit library that it getting lost if not return statement provided in the code In same time Arduino products work fine

hathach commented 3 years ago

I didn't look at the code, for this core, if you have

while(1) {}

it will entirely occupy the CPU and does not give any other task such as tinyusb to handle any printf, or touch1200. Making it is look like hanged. It is probably the case here. What you should do is adding either yield() or delay(1) in your blocking.

while(1) yield(); // or delay(1)
hathach commented 3 years ago

Could be closed now