rp2040

RP2040 Programming without SDK
Log | Files | Refs

commit 9344c0334b437cb0674ee9d51ab11bc39548ab1b
parent 9ce7aad1fee51b5b2c87f965dbaa3c9ffe0cad4e
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Sat, 24 Feb 2024 07:51:28 +0900

relocate vector table

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

diff --git a/ex1/boot2.s b/ex1/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/ex1/main.s b/ex1/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 @@ -58,3 +53,9 @@ io_bank0_base: .word 0x40014000 sio_base: .word 0xd0000000 + + .align 8 + .global vectors +vectors: + .word 0x20040000 // initial SP + .word (reset+1) // entry point diff --git a/ex1/memmap.ld b/ex1/memmap.ld @@ -12,7 +12,6 @@ SECTIONS } > FLASH .text : { - *(.vectors) *(.text) } > FLASH }