rp2040

RP2040 Programming without SDK
Log | Files | Refs

commit 47789e12a5a24eae09ee5a0978e09c1a5b7cf386
parent 7ae0d491ea01a26d60aa461adbb10d35625cfcd2
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Mon, 11 Aug 2025 09:47:30 +0900

enable uart interrupt

Diffstat:
Mspi/Makefile | 3++-
Mspi/main.s | 14++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/spi/Makefile b/spi/Makefile @@ -29,7 +29,8 @@ a.uf2: a.bin $(BIN2UF2) a_crc.bin $@ flash: all - mount /dev/disk/by-label/RPI-RP2 /mnt + #mount /dev/disk/by-label/RPI-RP2 /mnt + mount /dev/sd2i /mnt cp a.uf2 /mnt tools: diff --git a/spi/main.s b/spi/main.s @@ -88,9 +88,18 @@ wait_vco: ldr r0, =(3 << 5 | 1 << 4) // WLEN = 8, FEN = 1 str r0, [r3, #0x2c] // UART: UARTLCR_H + // enable uart interrupt + ldr r4, ppb_base + mov r5, #0xe1 + lsl r5, #8 + mov r0, #1 + lsl r0, #20 + str r0, [r4, r5] + loop: bl getbyte - bl putbyte + #bl putbyte + bl printh b loop // functions @@ -222,4 +231,5 @@ uart0_base: .word 0x40034000 sio_base: .word 0xd0000000 - +ppb_base: + .word 0xe0000000