-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port on-target-tests to rp235x (#894)
* Make rp2040 dependencies optional in on-target tests * Make rp2040 import conditional * Port individual test to rp235x
- Loading branch information
Showing
20 changed files
with
312 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//! Set up linker scripts for the rp235x-hal examples | ||
use std::fs::File; | ||
use std::io::Write; | ||
use std::path::PathBuf; | ||
|
||
fn main() { | ||
// Put the linker script somewhere the linker can find it | ||
let out = PathBuf::from(std::env::var_os("OUT_DIR").unwrap()); | ||
println!("cargo:rustc-link-search={}", out.display()); | ||
|
||
// The file `memory.x` is loaded by cortex-m-rt's `link.x` script, which | ||
// is what we specify in `.cargo/config.toml` for Arm builds | ||
#[cfg(feature = "rp2040")] | ||
let memory_x = include_bytes!("memory_rp2040.x"); | ||
#[cfg(feature = "rp235x")] | ||
let memory_x = include_bytes!("memory_rp235x.x"); | ||
let mut f = File::create(out.join("memory.x")).unwrap(); | ||
f.write_all(memory_x).unwrap(); | ||
println!("cargo:rerun-if-changed=memory.x"); | ||
|
||
/* | ||
// The file `rp235x_riscv.x` is what we specify in `.cargo/config.toml` for | ||
// RISC-V builds | ||
let rp235x_riscv_x = include_bytes!("rp235x_riscv.x"); | ||
let mut f = File::create(out.join("rp235x_riscv.x")).unwrap(); | ||
f.write_all(rp235x_riscv_x).unwrap(); | ||
println!("cargo:rerun-if-changed=rp235x_riscv.x"); | ||
*/ | ||
|
||
println!("cargo:rerun-if-changed=build.rs"); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
MEMORY { | ||
/* | ||
* 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); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# Keep running tests even if one of them fails | ||
# We need to specify probe-rs as our runner via environment variables here | ||
# to control build since we aren't able to override them in config.toml | ||
CARGO_TARGET_THUMBV8M_MAIN_NONE_EABIHF_RUNNER="probe-rs run" cargo test --target thumbv8m.main-none-eabihf --no-fail-fast --features rp235x -- --chip rp235x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.