Open Sistrum opened 4 years ago
We are also experiencing sometimes irregular timer behavior when using multiple timers. We had numerous code reviews, but nobody can pinpoint the cause. In our case the timer callback is also sometimes called to early, however it is hard to find a reproducible situation. In our timer callbacks we only set a global flag and wake up the processor (flag is polled and handled from loop()). Recently we found a reproducible situation that after an external interrupt occurs, the timer callback is called too early. This suggests that it is maybe not only timer handling related. When the external interrupts do no occur, timer behavior returns to normal....
Is this on the downloadable version, or the latest code directly off GitHub ?
Release 0.0.10 via Arduino Board Manager. Which is/looks identical to 0.0.10 from GitHub Releases (https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/releases)
I meant the sources off GitHub directly.
On Fri, Nov 27, 2020, 6:25 AM nelisse notifications@github.com wrote:
Release 0.0.10 via Arduino Board Manager. Which is/looks identical to 0.0.10 from GitHub Releases (https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/releases) https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/releases
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/issues/162#issuecomment-734833899, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXBA7GNFNHL34JGJO6EP5LSR6SEVANCNFSM4SZYWBTQ .
The current GitHub state is incompatible on an application level with the 0.0.10 release, so I have not been doing much testing with the current GitHub state.
I will need to have some way in my applications, to be able to distinguish between the 2 code lines (therefore my other question regarding the version literals).
Furthermore the Arduino IDE/CLI unfortunately does not have an easy way to switch between various package releases, so it requires some careful administration on my side….
I will come back to this later with updates!
Martin
From: Thomas Roell notifications@github.com Sent: Friday, 27 November, 2020 14:27 To: GrumpyOldPizza/ArduinoCore-stm32l0 ArduinoCore-stm32l0@noreply.github.com Cc: nelisse mwnelisse@gmail.com; Comment comment@noreply.github.com Subject: Re: [GrumpyOldPizza/ArduinoCore-stm32l0] TimerMillis doesn't seem to work properly with 2 timers (#162)
I meant the sources off GitHub directly.
On Fri, Nov 27, 2020, 6:25 AM nelisse <notifications@github.com mailto:notifications@github.com > wrote:
Release 0.0.10 via Arduino Board Manager. Which is/looks identical to 0.0.10 from GitHub Releases (https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/releases) https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/releases
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/issues/162#issuecomment-734833899, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXBA7GNFNHL34JGJO6EP5LSR6SEVANCNFSM4SZYWBTQ .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/issues/162#issuecomment-734834464 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMXJOHQJUNA5YPFJKWAGQTSR6SKBANCNFSM4SZYWBTQ . https://github.com/notifications/beacon/AEMXJOBX7CTSQMSVGYVQ7S3SR6SKBA5CNFSM4SZYWBT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFPGK6IA.gif
I already faced out this, here what I've done (on mac os so may be you need to adjust some folder names) to switch between version.
Assuming you installed the repo from arduino IDE the package on MacOs are under
~/Library/Arduino15/packages/TleraCorp/hardware/stm32l0/0.0.10
Then I got on my home dir both version named 0.0.10-git
and 0.0.10-release
and a script to switch from one to other
charles@mac-office:stm32l0$ pwd
/Users/charles/Devt/stm32l0
charles@mac-office:stm32l0$ ls -lA
total 24
-rw-r--r--@ 1 charles staff 10244 13 jul 14:27 .DS_Store
drwxr-xr-x 15 charles staff 480 4 mai 2020 0.0.10-git
drwxrwxr-x@ 14 charles staff 448 13 jul 11:24 0.0.10-release
lrwxr-xr-x 1 charles staff 39 4 jui 2020 set_stm.sh -> /Users/charles/OneDrive/devt/set_stm.sh
charles@mac-office:stm32l0$
The trick is to link in the packages
folder the git version or release version, it's done by a basic script
#/bin/bash
echo "Select environement for STM32L0"
echo "1) latest release"
echo "2) git"
echo -n "Input Selection : "
read version
if [ "$version" = "1" ]; then
folder="release/"
elif [ "$version" = "2" ]; then
folder="git/"
else
echo "You have entered an invalid selection!"
fi
echo "Setting folder to $folder"
if [ "$folder" != "" ]; then
echo "unlink ~/Library/Arduino15/packages/TleraCorp/hardware/stm32l0/0.0.10"
unlink ~/Library/Arduino15/packages/TleraCorp/hardware/stm32l0/0.0.10
echo "linking ~/devt/stm32l0/0.0.10-$folder to ~/Library/Arduino15/packages/TleraCorp/hardware/stm32l0/0.0.10"
ln -sFf ~/devt/stm32l0/0.0.10-$folder ~/Library/Arduino15/packages/TleraCorp/hardware/stm32l0/0.0.10
fi
Of course close Arduino IDE before switching and open back after
Hope this helps
Hello,
First, thanks for this useful work!
I have an issue with the TimerMillis library when I used 2 timers at the same time and restart those timers with different timing. Here a minimal sketch who shows the error:
And here the Serial output:
I tried to replace "restart" with "stop" and "start" functions but it doesn't solve the issue. I tried to stop timer1 and start a new timer instance (like timer3) but it's doesn't solve the issue.
If I set "n2" to "5" in place of "3", everything works perfectly. The issue seems to occur when "timer2.restart()" runs after "timer1.restart()" but before the first interrupt of timer1 (with his new time values) occurs.
Moreover, the issue doesn't seem to come from the Arduino Serial timestamp.
Have someone an idea of what I can do to solve that or what I'm doing wrong?
Thanks