Skip to content

Commit d7cee28

Browse files
committed
Fix formatting again?
1 parent 85c8d1e commit d7cee28

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

hal/src/peripherals/flash_controller.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,7 @@ impl<'gcr, 'icc> FlashController<'gcr, 'icc> {
138138
/// - Lock write protection
139139
/// - Flush ICC
140140
/// - Enable icc0
141-
fn write_guard<F: Fn()>(
142-
&self,
143-
sys_clk: &SystemClock,
144-
operation: F,
145-
) -> Result<(), FlashErr> {
141+
fn write_guard<F: Fn()>(&self, sys_clk: &SystemClock, operation: F) -> Result<(), FlashErr> {
146142
// Pre-write
147143
self.wait_until_ready();
148144
self.disable_icc0();

tests/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ fn main() {
1313
.write_all(include_bytes!("memory.x"))
1414
.unwrap();
1515

16+
println!("cargo:rustc-link-arg=--nmagic");
17+
1618
// Only re-run the build script when this file, memory.x, or link.x is changed.
1719
println!("cargo:rerun-if-changed=build.rs");
1820
println!("cargo:rerun-if-changed=memory.x");

tests/memory.x

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
MEMORY
22
{
3-
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 512K
3+
FLASH (rx) : ORIGIN = 0x1000E000, LENGTH = 222K
4+
SECFLASH (rx) : ORIGIN = ORIGIN(FLASH) + LENGTH(FLASH), LENGTH = 2K
45
STACK (rw) : ORIGIN = 0x20000000, LENGTH = 110K
56
RAM (rw) : ORIGIN = ORIGIN(STACK) + LENGTH(STACK), LENGTH = 128K - LENGTH(STACK)
67
}
@@ -9,5 +10,19 @@ MEMORY
910
Add a block of memory for the stack before the RAM block, so that a stack overflow leaks into
1011
reserved space and flash memory, instead of .data and .bss.
1112
*/
13+
ASSERT((LENGTH(SECFLASH) == 2K), "Error: SECFLASH is not 2K. To change the size, update this assert, the size in the MEMORY section, and the assert in the flash layout crate.")
1214
1315
_stack_start = ORIGIN(STACK) + LENGTH(STACK);
16+
_stack_end = ORIGIN(STACK);
17+
18+
/* Bootloader hard jumps to 0x1000e200 */
19+
_stext = ORIGIN(FLASH) + 0x200;
20+
21+
SECTIONS {
22+
/* Add a section for the secure flash space. */
23+
.secflash ORIGIN(SECFLASH) :
24+
{
25+
KEEP(*(.secflash .secflash.*));
26+
. = ALIGN(4);
27+
} > SECFLASH
28+
}

0 commit comments

Comments
 (0)