@@ -683,8 +683,10 @@ static mp_obj_t rp2_state_machine_init_helper(const rp2_state_machine_obj_t *sel
683
683
}
684
684
685
685
// Configure jmp pin, if needed.
686
+ int jmp_pin = -1 ;
686
687
if (args [ARG_jmp_pin ].u_obj != mp_const_none ) {
687
- sm_config_set_jmp_pin (& config , mp_hal_get_pin_obj (args [ARG_jmp_pin ].u_obj ));
688
+ jmp_pin = mp_hal_get_pin_obj (args [ARG_jmp_pin ].u_obj );
689
+ sm_config_set_jmp_pin (& config , jmp_pin );
688
690
}
689
691
690
692
// Configure sideset pin, if needed.
@@ -716,6 +718,18 @@ static mp_obj_t rp2_state_machine_init_helper(const rp2_state_machine_obj_t *sel
716
718
if (set_config .base >= 0 ) {
717
719
asm_pio_init_gpio (self -> pio , self -> sm , & set_config );
718
720
}
721
+ #if !PICO_RP2040
722
+ if (jmp_pin >= 0 ) {
723
+ // On RP2350 pins by default have their isolation enabled. This means they will
724
+ // not work as input to a PIO without further configuration. That's different to
725
+ // RP2040 where pins can work as PIO input from a reset. To make RP2350 have
726
+ // similar behaviour as RP2040, configure the jmp pin for PIO use if it's isolation
727
+ // is enabled (which means it's probably unconfigured from reset).
728
+ if (pads_bank0_hw -> io [jmp_pin ] & PADS_BANK0_GPIO0_ISO_BITS ) {
729
+ pio_gpio_init (self -> pio , jmp_pin );
730
+ }
731
+ }
732
+ #endif
719
733
if (sideset_config .base >= 0 ) {
720
734
asm_pio_init_gpio (self -> pio , self -> sm , & sideset_config );
721
735
}
0 commit comments