← index #18076Issue #17047
Off-topic · high · value 0.418
QUERY · ISSUE

RP2: ADC pins does not work properly in XIAO RP2350

openby Lesordsopened 2025-09-15updated 2025-10-06
bug

Port, board and/or hardware

XIAO RP2350

MicroPython version

MicroPython v1.26.1 on 2025-09-11; Seeed XIAO RP2350 with RP2350

Reproduction

  1. Use the firmware in this interface XIAO_RP2350
  2. Use the following test code
import machine
machine.ADC(29).read_u16()

Expected behaviour

Using my own compiled firmware

MicroPython v1.27.0-preview.135.gd28844d11b.dirty on 2025-09-15; Seeed XIAO RP2350 with RP2350

Type "help()" for more information.

>>> import machine
>>> machine.ADC(4).read_u16()
13955

Observed behaviour

MicroPython v1.26.1 on 2025-09-11; Seeed XIAO RP2350 with RP2350

Type "help()" for more information.

>>> import machine
>>> machine.ADC(29).read_u16()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Pin doesn't have ADC capabilities
>>> 

Additional Information

The reason is that pico-sdk is not the latest.

The ADC function modified the judgment logic after this submission, and changed the range of the ADC pin to be specified by macro(ADC_BASE_PIN and NUM_ADC_CHANNELS).
See: https://github.com/micropython/micropython/commit/34e463d861c5ebb33ec317749a008d461616cfbc

These two macros were not used in pico-sdk until after this commit.
See: https://github.com/raspberrypi/pico-sdk/commit/c88bd53a68fe2199fa4a5e6473ba88278f339a2b

The following file is the xiao rp2350 header file in the pico-sdk used by the current version of micropython. This file does not include the changes submitted above.
See: https://github.com/raspberrypi/pico-sdk/blob/9a4113fbbae65ee82d8cd6537963bc3d3b14bcca/src/boards/include/boards/seeed_xiao_rp2350.h

Please update pico-sdk and release a new firmware version as soon as possible.

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

RP2350: PIO scripts fail, despite running on RP2040

closedby peterhinchopened 2025-03-30updated 2025-08-01
bugport-rp2

Port, board and/or hardware

Pico 2

MicroPython version

MicroPython v1.25.0-preview.408.gf315a376b on 2025-03-26; Raspberry Pi Pico2 with RP2350

Reproduction

It has proved hard to produce a minimum repro, what follows is my best shot. The repro is quite fragile - minimal changes cause its behaviour to vary between working and failing.

Link GPIO numbers 1-18 and 2-17 and run the following:

import rp2
from machine import Pin, SPI


@rp2.asm_pio(autopush=True, autopull=True)
def spi_count():
    out(x, 32)
    wait(0, pins, 2)  # CS/ True
    label("loop")
    jmp(pin, "good")
    jmp(x_dec, "loop")
    label("good")
    in_(x, 32)
    label("finish")
    jmp("finish")


class Test:

    def __init__(self, start_pin=0, sm_num=0):
        self._sm1 = rp2.StateMachine(
            sm_num,
            spi_count,
            in_base=start_pin,
            jmp_pin=start_pin + 1,
        )
        self._sm1.active(1)

    def go(self, cs, ck):
        sm = self._sm1
        sm.put(10_000_000)
        cs(0)  # Start
        ck(1)  # Stop
        
        assert sm.rx_fifo(), "Rx fifo is empty."
        print(sm.get())


cs = Pin(17, Pin.OUT, value=1)
ck = Pin(18, Pin.OUT, value=0)

t = Test()
t.go(cs, ck)

Expected behaviour

Result on RP2040 is to print a number around 9999759.

Observed behaviour

RP2350 produces an assertion fail. I assume that the RP2350 is failing to respond to the jump pin.

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied