-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from tock/usb-cdc
Implement bootloader for Nano 33 BLE
- Loading branch information
Showing
58 changed files
with
4,572 additions
and
1,388 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build | ||
target | ||
local_cargo | ||
Cargo.lock | ||
|
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,5 @@ | ||
Architecture-Specific Bootloader Helpers | ||
======================================== | ||
|
||
Code like moving the vector table is architecture-specific. | ||
|
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,10 @@ | ||
[package] | ||
name = "bootloader_cortexm" | ||
version = "0.1.0" | ||
authors = ["Tock Project Developers <[email protected]>"] | ||
|
||
[dependencies] | ||
kernel = { git = "https://github.com/tock/tock", branch = "master" } | ||
#kernel = { path = "../../../tock/kernel" } | ||
|
||
bootloader = { path = "../../bootloader" } |
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,26 @@ | ||
pub struct CortexMJumper {} | ||
|
||
impl CortexMJumper { | ||
pub fn new() -> CortexMJumper { | ||
CortexMJumper {} | ||
} | ||
} | ||
|
||
impl bootloader::interfaces::Jumper for CortexMJumper { | ||
fn jump(&self, address: u32) -> ! { | ||
unsafe { | ||
asm!( | ||
".syntax unified \n\ | ||
mov r0, {0} // The address of the payload's .vectors \n\ | ||
ldr r1, =0xe000ed08 // The address of the VTOR register (0xE000E000(SCS) + 0xD00(SCB) + 0x8(VTOR)) \n\ | ||
str r0, [r1] // Move the payload's VT address into the VTOR register \n\ | ||
ldr r1, [r0] // Move the payload's initial SP into r1 \n\ | ||
mov sp, r1 // Set our SP to that \n\ | ||
ldr r0, [r0, #4] // Load the payload's ENTRY into r0 \n\ | ||
bx r0 // Whoopee", | ||
in(reg) address, | ||
); | ||
} | ||
loop {} | ||
} | ||
} |
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,4 @@ | ||
#![feature(const_fn, asm)] | ||
#![no_std] | ||
|
||
pub mod jumper; |
Oops, something went wrong.