rp2040

RP2040 Programming without SDK
Log | Files | Refs

commit 6c641f4ea9d40c27a9e14629f85814ff0778a18a
parent 24155e70bf4f93978baedbc56650f0bdef2f9e85
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Fri, 23 Feb 2024 12:06:21 +0900

wip

Diffstat:
Mex3/boot2.s | 13+++++++------
Mex3/main.s | 3+++
Mex3/memmap.ld | 7+------
3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/ex3/boot2.s b/ex3/boot2.s @@ -11,13 +11,14 @@ setup_xip: blx r2 blx r0 - ldr r0, =0x10010000 - ldr r1, m0plus_vtor - str r0, [r1, #0] // M0PLUS: VTOR - ldr r1, [r0, #4] // entry point - ldr r0, [r0, #0] // stack pointer + //ldr r0, =0x10010000 + //ldr r1, m0plus_vtor + //str r0, [r1, #0] // M0PLUS: VTOR + //ldr r1, [r0, #4] // entry point + //ldr r0, [r0, #0] // stack pointer + ldr r0, =0x20040000 mov sp, r0 - bx r1 + b reset .align 2 rom_base: diff --git a/ex3/main.s b/ex3/main.s @@ -1,13 +1,16 @@ .cpu cortex-m0plus .thumb +/* .section .vectors .global vectors vectors: .word 0x20040000 // initial SP .word (reset+1) // entry point +*/ .section .text + .global reset reset: // unreset gpio, pll_sys, uart0 ldr r0, =(1 << 22 | 1 << 12 | 1 << 5) // uart0 | pll_sys | io_bank0 diff --git a/ex3/memmap.ld b/ex3/memmap.ld @@ -1,7 +1,6 @@ MEMORY { - FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 1024k - VECTORS(r): ORIGIN = 0x10010000, LENGTH = 1024k + FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2048k SRAM(rwx) : ORIGIN = 0x20000000, LENGTH = 264k } @@ -15,9 +14,5 @@ SECTIONS .text : { *(.text) } > FLASH - - .vectors : { - *(.vectors) - } > VECTORS }