diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-06-06 00:06:32 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-06-06 00:06:32 +0200 |
| commit | 4f03dff577f08bb9af1ea3fc118857973baa686e (patch) | |
| tree | 8bb5cba85d846bd1a81740f2e96287906138a3e8 /embassy-rp | |
| parent | 162d48530436be9cfa6a0d4aba88d97f52a5ad4a (diff) | |
rp: add run-from-ram feature.
Diffstat (limited to 'embassy-rp')
| -rw-r--r-- | embassy-rp/Cargo.toml | 5 | ||||
| -rw-r--r-- | embassy-rp/src/flash.rs | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 5f08c7f33..ddada655b 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml | |||
| @@ -41,6 +41,11 @@ boot2-ram-memcpy = [] | |||
| 41 | boot2-w25q080 = [] | 41 | boot2-w25q080 = [] |
| 42 | boot2-w25x10cl = [] | 42 | boot2-w25x10cl = [] |
| 43 | 43 | ||
| 44 | # Indicate code is running from RAM. | ||
| 45 | # Set this if all code is in RAM, and the cores never access memory-mapped flash memory through XIP. | ||
| 46 | # This allows the flash driver to not force pausing execution on both cores when doing flash operations. | ||
| 47 | run-from-ram = [] | ||
| 48 | |||
| 44 | # Enable nightly-only features | 49 | # Enable nightly-only features |
| 45 | nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly", "dep:embassy-usb-driver", "dep:embedded-io"] | 50 | nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly", "dep:embassy-usb-driver", "dep:embedded-io"] |
| 46 | 51 | ||
diff --git a/embassy-rp/src/flash.rs b/embassy-rp/src/flash.rs index 0372afb1e..5d928abad 100644 --- a/embassy-rp/src/flash.rs +++ b/embassy-rp/src/flash.rs | |||
| @@ -10,7 +10,10 @@ use crate::pac; | |||
| 10 | use crate::peripherals::FLASH; | 10 | use crate::peripherals::FLASH; |
| 11 | 11 | ||
| 12 | pub const FLASH_BASE: *const u32 = 0x10000000 as _; | 12 | pub const FLASH_BASE: *const u32 = 0x10000000 as _; |
| 13 | pub const USE_BOOT2: bool = true; | 13 | |
| 14 | // If running from RAM, we might have no boot2. Use bootrom `flash_enter_cmd_xip` instead. | ||
| 15 | // TODO: when run-from-ram is set, completely skip the "pause cores and jumpp to RAM" dance. | ||
| 16 | pub const USE_BOOT2: bool = !cfg!(feature = "run-from-ram"); | ||
| 14 | 17 | ||
| 15 | // **NOTE**: | 18 | // **NOTE**: |
| 16 | // | 19 | // |
