pico-sdk
pico-sdk copied to clipboard
pio_sm_set_pindirs_with_mask misbehaves if OUT_STICKY is set
We fixed an issue in the rust rp2040 support which is also present in the C SDK: https://github.com/rp-rs/rp-hal/pull/432
If the OUT_STICKY bit is set, pio_sm_set_pindirs_with_mask and similar functions will change the out or outdir values of unrelated pins.
The values written using the injected SET instruction will be sticky, ie. they will be applied again each PIO cycle.
This still happens after resetting pinctrl with pio->sm[sm].pinctrl = pinctrl_saved. At this point, depending on the previous value of pinctrl, the values will be written to some other unintended pin.
assign to @Wren6991 to think about
was fixed in 1.5.0