-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nRF52: update from 0.33 -> 0.34 causes 500x idle-current #4597
Comments
@aykevl Please give some hints. |
How do I reproduce this issue? I have the following test code, flashed on a PCA10056: package main
import (
"device/nrf"
"machine"
"time"
)
func main() {
led := machine.LED
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
for {
led.Set(nrf.CLOCK.HFCLKSTAT.Get()>>16 == 1)
time.Sleep(500 * time.Millisecond)
led.Low()
time.Sleep(500 * time.Millisecond)
}
} It blinks in both v0.33.0 and v0.34.0. |
What do you mean by this? After running |
You must use option -serial=none to test actual consumption. Default setting with UART always requires HF-clock and hides a problem. I just tried to find issues with gdb, no luck. Actual tests were done in standard-mode with option -serial=none |
For ultra-low power applications where all peripherials are disabled and usually under 1.5uA SystemON currents, update to 0.34 was a bad mistake which caused 600uA idle current. After debugging, something keeps requesting HF-clock.
I tried to check diffs between 0.33 and 0.34 and I can't find any changes related to nRF52-parts. The problem is caused under initAll()-code. I tried to dig that part also but no luck as it goes to compiler-part.
Example code:
Serial, GC and scheduler disabled, flashing with command:
tinygo flash -size=short -scheduler=none -gc=none -serial=none -target=pca10040 -programmer command main.go
Output:
Also tried to play with -opt values, no effect. Except -opt=0 which keeps current under 1.5uA but code is not running either. Any ideas which causes this issue?
The text was updated successfully, but these errors were encountered: