rp2040

RP2040 Programming without SDK
Log | Files | Refs

commit 6b5151a303ab990352589a5482404ab008275301
parent e4ee2a4f2aa48bedc8b6f24024117920d2b67d84
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Mon, 10 Apr 2023 09:40:37 +0900

use sram_base to fetch initial sp

Diffstat:
Mmach.s | 9+++++----
Mmemmap.ld | 1+
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/mach.s b/mach.s @@ -1,12 +1,13 @@ .section .vectors -__vectors: -.word 0x20040000 -.word reset +vectors: + .word 0x20040000 // initial SP + .word reset // entry point .section .text .thumb_func reset: - ldr r0, =0x20040000 + ldr r0, sram_base + ldr r0, [r0, #0] mov sp, r0 bl main diff --git a/memmap.ld b/memmap.ld @@ -13,6 +13,7 @@ SECTIONS .text 0x20000000 : AT (0x10000100) { *(.vectors) *(.text) + _etext = .; } }