rp2040

RP2040 Programming without SDK
Log | Files | Refs

commit 9de2a0a6db76aa2ddcd58091928a549007d9148f
parent 9cdcea9b9982dc7affe5b89d02fb6b158581b7f5
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Sat,  2 Mar 2024 07:44:56 +0900

work. but still can't access char * variable from c

Diffstat:
Mex3/Makefile | 2+-
Mex3/main.c | 4+---
Mex3/memmap.ld | 4++--
Mex3/start.s | 2+-
4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/ex3/Makefile b/ex3/Makefile @@ -1,6 +1,6 @@ +CC = arm-none-eabi-gcc AS = arm-none-eabi-as LD = arm-none-eabi-ld -CC = arm-none-eabi-gcc OBJCOPY = arm-none-eabi-objcopy BINCRC = ../tools/bincrc BIN2UF2 = ../tools/bin2uf2 diff --git a/ex3/main.c b/ex3/main.c @@ -14,10 +14,8 @@ isr_svcall(void) { puts("svcall"); } -char *msg = "hello"; - void isr_alarm(void) { - puts(msg); + printh(0xdeadbeef); set_alarm(1000 * 1000); } diff --git a/ex3/memmap.ld b/ex3/memmap.ld @@ -13,12 +13,12 @@ SECTIONS .vectors : { *(.vectors) . += SIZEOF(.vectors); - . = ALIGN(256); + . = ALIGN(2); text_start = .; } > FLASH .text : { *(.text) - } > FLASH + } > SRAM AT > FLASH text_size = SIZEOF(.text); } diff --git a/ex3/start.s b/ex3/start.s @@ -306,7 +306,7 @@ bled: str r5, [r4, #0x18] // SIO: GPIO_OUT_XOR bl delay pop {r0, r1, r2, r3, r4, r5, pc} - + delay: push {r0} mov r0, #1