tingox / rp2040-blink

0 stars 0 forks source link

pi pico - the LED stops blinking after a while #1

Open tingox opened 1 year ago

tingox commented 1 year ago

cargo run --release works, and the output works as long as the terminal is connected to the com port

[C:\Users\torfinn.ingolfsen\OneDrive - Inventas AS\Documents\Inventas\0_faglig\utvikling\rust\embedded\rp2040-blink] $ cargo run --release
    Finished release [optimized] target(s) in 0.07s
     Running `elf2uf2-rs -d -s target\thumbv6m-none-eabi\release\blink`
Found pico uf2 disk D:\
Transfering program to pico
63.50 KB / 63.50 KB [=======================================================================================] 100.00 % 148.48 KB/s
Found pico serial on COM6
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off
On
Off

If I connect the Pico without running cargo run --release (it has the code already), the LED stops blinking after a while. Perhaps a buffer for the usb serial port fills up?

tingox commented 1 year ago

leaving out '--release' also works, in a way

[C:\Users\torfinn.ingolfsen\OneDrive - Inventas AS\Documents\Inventas\0_faglig\utvikling\rust\embedded\rp2040-blink] $ cargo run        Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `elf2uf2-rs -d -s target\thumbv6m-none-eabi\debug\blink`
Found pico uf2 disk D:\
Transfering program to pico
242.00 KB / 242.00 KB [=====================================================================================] 100.00 % 153.55 KB/s

but the LED stops blinking quicker. also, I get a Windows Explorer error message "USB device not recognized".

tingox commented 1 year ago

ok, if I comment out the write!() calls in main.rs, the code works with cargo run, and also standalone (connecting the Pi Pico without running anything).