Skip to content
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

Ticker.Reset is broken on RP2350 #4688

Open
tdunning opened this issue Jan 5, 2025 · 3 comments
Open

Ticker.Reset is broken on RP2350 #4688

tdunning opened this issue Jan 5, 2025 · 3 comments
Labels

Comments

@tdunning
Copy link

tdunning commented Jan 5, 2025

I wrote a small program that was using a Ticker as a timeout and found that resetting the Ticker exposed a missing bit in the runtime.

Here is a tiny program that illustrates this:

package main

import (
	"time"
)

func main() {
	t := time.NewTicker(10 * time.Millisecond)
	t.Reset(time.Duration(100) * time.Millisecond)
}

Attempting to compile and flash this results in this output:

$  tinygo flash -target=pico2 -scheduler=tasks -gc=conservative -size=full -stack-size=20kb -monitor TickerBug/main.go
/usr/local/go/src/time/tick.go:58: linker could not find symbol time.modTimer
$
@tdunning
Copy link
Author

tdunning commented Jan 6, 2025

Ref to @soypat @deadprogram @aykevl @cibomahto

@tdunning
Copy link
Author

tdunning commented Jan 8, 2025

I think that this is more widespread than just the RP2350. I just tried it with -target=pico and got the same results. Tinygo never even got to flashing the board.

@tdunning
Copy link
Author

tdunning commented Jan 8, 2025

Changing to -target=nodemcu causes a very similar error message. I think that this issue is much more widespread than just the RP boards.

% **tinygo flash -target=nodemcu -scheduler=tasks -gc=conservative -size=full -stack-size=20kb -monitor** TickerBug/main.go
ld.lld: error: undefined symbol: time.modTimer
>>> referenced by main
>>>               /var/folders/9_/dgh8c17j1ln5q9x8jqb5x3yh0000gp/T/tinygo1875079224/main.lto.main.o:(.literal.runtime.run$1$gowrapper+0x20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants