This commit is contained in:
parent
f5efbf3963
commit
0014635cae
4 changed files with 86 additions and 23 deletions
|
@ -9,8 +9,4 @@
|
|||
runner = "elf2uf2-rs -d"
|
||||
|
||||
[build]
|
||||
# Cortex-M0 and Cortex-M0+
|
||||
target = "thumbv6m-none-eabi"
|
||||
|
||||
[env]
|
||||
# DEFMT_LOG = "debug"
|
||||
target = "thumbv8m.main-none-eabihf"
|
||||
|
|
17
Cargo.toml
17
Cargo.toml
|
@ -6,8 +6,19 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "executor-interrupt", "integrated-timers"] }
|
||||
embassy-rp = { version = "0.1.0", features = ["unstable-pac", "time-driver", "critical-section-impl"] }
|
||||
embassy-executor = { version = "0.7.0", features = [
|
||||
"task-arena-size-32768",
|
||||
"arch-cortex-m",
|
||||
"executor-thread",
|
||||
"executor-interrupt",
|
||||
] }
|
||||
embassy-rp = { version = "0.3.1", features = [
|
||||
"unstable-pac",
|
||||
"time-driver",
|
||||
"critical-section-impl",
|
||||
"rp235xa",
|
||||
] }
|
||||
embassy-futures = { version = "0.1.1" }
|
||||
|
||||
cortex-m-rt = "0.7.4"
|
||||
cortex-m-rt = "0.7.5"
|
||||
cortex-m = { version = "0.7.7", features = ["inline-asm"] }
|
||||
|
|
2
build.rs
2
build.rs
|
@ -31,6 +31,4 @@ fn main() {
|
|||
|
||||
println!("cargo:rustc-link-arg-bins=--nmagic");
|
||||
println!("cargo:rustc-link-arg-bins=-Tlink.x");
|
||||
println!("cargo:rustc-link-arg-bins=-Tlink-rp.x");
|
||||
// println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
||||
}
|
||||
|
|
88
memory.x
88
memory.x
|
@ -1,17 +1,75 @@
|
|||
MEMORY {
|
||||
BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100
|
||||
FLASH : ORIGIN = 0x10000100, LENGTH = 2048K - 0x100
|
||||
|
||||
/* Pick one of the two options for RAM layout */
|
||||
|
||||
/* OPTION A: Use all RAM banks as one big block */
|
||||
/* Reasonable, unless you are doing something */
|
||||
/* really particular with DMA or other concurrent */
|
||||
/* access that would benefit from striping */
|
||||
RAM : ORIGIN = 0x20000000, LENGTH = 264K
|
||||
|
||||
/* OPTION B: Keep the unstriped sections separate */
|
||||
/* RAM: ORIGIN = 0x20000000, LENGTH = 256K */
|
||||
/* SCRATCH_A: ORIGIN = 0x20040000, LENGTH = 4K */
|
||||
/* SCRATCH_B: ORIGIN = 0x20041000, LENGTH = 4K */
|
||||
/*
|
||||
* The RP2350 has either external or internal flash.
|
||||
*
|
||||
* 2 MiB is a safe default here, although a Pico 2 has 4 MiB.
|
||||
*/
|
||||
FLASH : ORIGIN = 0x10000000, LENGTH = 2048K
|
||||
/*
|
||||
* RAM consists of 8 banks, SRAM0-SRAM7, with a striped mapping.
|
||||
* This is usually good for performance, as it distributes load on
|
||||
* those banks evenly.
|
||||
*/
|
||||
RAM : ORIGIN = 0x20000000, LENGTH = 512K
|
||||
/*
|
||||
* RAM banks 8 and 9 use a direct mapping. They can be used to have
|
||||
* memory areas dedicated for some specific job, improving predictability
|
||||
* of access times.
|
||||
* Example: Separate stacks for core0 and core1.
|
||||
*/
|
||||
SRAM4 : ORIGIN = 0x20080000, LENGTH = 4K
|
||||
SRAM5 : ORIGIN = 0x20081000, LENGTH = 4K
|
||||
}
|
||||
|
||||
SECTIONS {
|
||||
/* ### Boot ROM info
|
||||
*
|
||||
* Goes after .vector_table, to keep it in the first 4K of flash
|
||||
* where the Boot ROM (and picotool) can find it
|
||||
*/
|
||||
.start_block : ALIGN(4)
|
||||
{
|
||||
__start_block_addr = .;
|
||||
KEEP(*(.start_block));
|
||||
KEEP(*(.boot_info));
|
||||
} > FLASH
|
||||
|
||||
} INSERT AFTER .vector_table;
|
||||
|
||||
/* move .text to start /after/ the boot info */
|
||||
_stext = ADDR(.start_block) + SIZEOF(.start_block);
|
||||
|
||||
SECTIONS {
|
||||
/* ### Picotool 'Binary Info' Entries
|
||||
*
|
||||
* Picotool looks through this block (as we have pointers to it in our
|
||||
* header) to find interesting information.
|
||||
*/
|
||||
.bi_entries : ALIGN(4)
|
||||
{
|
||||
/* We put this in the header */
|
||||
__bi_entries_start = .;
|
||||
/* Here are the entries */
|
||||
KEEP(*(.bi_entries));
|
||||
/* Keep this block a nice round size */
|
||||
. = ALIGN(4);
|
||||
/* We put this in the header */
|
||||
__bi_entries_end = .;
|
||||
} > FLASH
|
||||
} INSERT AFTER .text;
|
||||
|
||||
SECTIONS {
|
||||
/* ### Boot ROM extra info
|
||||
*
|
||||
* Goes after everything in our program, so it can contain a signature.
|
||||
*/
|
||||
.end_block : ALIGN(4)
|
||||
{
|
||||
__end_block_addr = .;
|
||||
KEEP(*(.end_block));
|
||||
} > FLASH
|
||||
|
||||
} INSERT AFTER .uninit;
|
||||
|
||||
PROVIDE(start_to_end = __end_block_addr - __start_block_addr);
|
||||
PROVIDE(end_to_start = __start_block_addr - __end_block_addr);
|
Loading…
Reference in a new issue