Arduino micros() function broken for Longan Nano?

I tried to use the Arduino Stepper library with the Longan Nano, and it doesn’t work. The Stepper library uses the Arduino micros() function internally for timing purposes, and to me it looks like this function is broken in the Arduino framework. The values returned by the function are monotonically decreasing, until the value -1 is returned continuously.

This can be reproduced with a test sketch for the micros() function.

Is there a place where bugs can be reported against the Arduino framework for the Longan Nano?

I suggest that you open an issue on the Arduino Github Repository for the Longan Nano. https://github.com/sipeed/Longduino/issues

Perhaps you should also try to use the current master branch. I saw that there are numerous changes since the last official release.

2 Likes

@mouseclicker: Thanks for the pointer to repository, I wasn’t aware of this.

And after looking at the commits, I think the problem is already solved in the following commit:

fix millis and micros

Great to see that it helped. I hope they will push a new release of the Arduino framework soon. There are important changes like SPI support.

With the Arduino framework directly from GitHub and with a slightly modified Arduino Stepper library I can successfully control a 28BYJ-48 stepper motor now.