rp2040

RP2040 Programming without SDK
Log | Files | Refs

commit 8f94806cfd789d3aca81d1efa6c5588e253b7474
parent 9344c0334b437cb0674ee9d51ab11bc39548ab1b
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Sat, 24 Feb 2024 07:56:58 +0900

relocate vector table

Diffstat:
Mex2/boot2.s | 5+----
Mex2/main.s | 11++++++-----
Mex2/memmap.ld | 1-
3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/ex2/boot2.s b/ex2/boot2.s @@ -11,9 +11,8 @@ setup_xip: blx r2 blx r0 - ldr r0, flash_main + ldr r0, =vectors ldr r1, m0plus_vtor - // TODO move VTOR to 0x10000000 str r0, [r1, #0] // M0PLUS: VTOR ldr r1, [r0, #4] // entry point ldr r0, [r0, #0] // stack pointer @@ -23,8 +22,6 @@ setup_xip: .align 2 rom_base: .word 0x00000000 -flash_main: - .word 0x10000000 + 0x100 m0plus_vtor: .word 0xe0000000 + 0xed08 literals: diff --git a/ex2/main.s b/ex2/main.s @@ -1,11 +1,6 @@ .cpu cortex-m0plus .thumb - .section .vectors -vectors: - .word 0x20040000 // initial SP - .word (reset+1) // entry point - .section .text reset: // unreset gpio, pll_sys, uart0 @@ -219,3 +214,9 @@ uart0_base: .word 0x40034000 sio_base: .word 0xd0000000 + + .align 8 + .global vectors +vectors: + .word 0x20040000 // initial SP + .word (reset+1) // entry point diff --git a/ex2/memmap.ld b/ex2/memmap.ld @@ -12,7 +12,6 @@ SECTIONS } > FLASH .text : { - *(.vectors) *(.text) } > FLASH }