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:
func main() {
arm.EnableIRQ(uint32(nrf.IRQ_RTC1)) // workaround to keep IRQs running, already fixed in dev
led := machine.P0_20
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
for {
led.Set(nrf.CLOCK.HFCLKSTAT.Get()>>16 == 1)
time.Sleep(10 * time.Millisecond)
led.Low()
time.Sleep(500 * time.Millisecond)
}
}
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:
0.34: led blinks, current 600uA+ (led uses minimal current compared to HF-clock)
0.33: no blinking, current under 1.5uA
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?
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?