Hello! I am trying to toggle a GPIO pin using ARM assembly on the new Pico 2 (with Rp2350), for learning purposes. I also tried to debug the program with a debug probe, and every bit I expected to be 1, was 1. I also tried to make the equivalent in RISC-V assembly, and it worked.Maybe I'm missing something.
Thank you!
Code:
.syntax unified.cpu cortex-m33.thumb.equ IO_BANK0_BASE, 0x40028000.equ SIO_BASE, 0xD0000000.equ GPIO16_STATUS, IO_BANK0_BASE + 0x080.equ GPIO16_CTRL, IO_BANK0_BASE + 0x084.equ SIO_GPIO_OE, SIO_BASE + 0x030 .equ SIO_GPIO_OE_SET, SIO_BASE + 0x038 .equ SIO_GPIO_OUT, SIO_BASE + 0x010 .equ SIO_GPIO_OUT_SET, SIO_BASE + 0x018 .global main.thumb_funcmain: LDR r0, =GPIO16_CTRL MOV r1, #5 STR r1, [r0] LDR r0, =SIO_GPIO_OE_SET MOV r1, #(1 << 16) STR r1, [r0] LDR r0, =SIO_GPIO_OUT_SET MOV r1, #(1 << 16) STR r1, [r0] loop: B loopThank you!
Statistics: Posted by aureuss — Wed Oct 22, 2025 10:42 pm — Replies 0 — Views 13