Bump Tock kernel version (#374)
* Bump Tock kernel version * Update boards to new kernel * Update patches to new kernel * Update PR template * Bump libtock-rs * Use new layout from libtock-rs * Fix clippy warnings due to updated toolchain * Fix new toolchain file format * Bump elf2tab to v0.7.0 * Fix worklow and setup.sh script to use the TOML rust-toolchain file * New libtock-rs style of declaring the stack. * Fix padding in layout file. The layout from libtock-rs generates invalid flash padding. The value is 32-bit and therefore setting padding to 0xff yields 0xff000000 instead of 0xffffffff that we want. * adds tock patch for app break hard fault * sets in deploy, removed patch 04-mpu-fix * fixed the if deploy * fixes indentation * updates board names in install.md * fix docs and deploy style Co-authored-by: Fabian Kaczmarczyck <kaczmarczyck@google.com> Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c2b3aeca88
commit
c1f2551d0d
@@ -1,5 +1,5 @@
|
||||
diff --git a/chips/nrf52/src/nvmc.rs b/chips/nrf52/src/nvmc.rs
|
||||
index b70162cae..9934f3a31 100644
|
||||
index adbc2a2b5..7594ec867 100644
|
||||
--- a/chips/nrf52/src/nvmc.rs
|
||||
+++ b/chips/nrf52/src/nvmc.rs
|
||||
@@ -3,15 +3,19 @@
|
||||
@@ -37,37 +37,38 @@ index b70162cae..9934f3a31 100644
|
||||
|
||||
/// This is a wrapper around a u8 array that is sized to a single page for the
|
||||
/// nrf. Users of this module must pass an object of this type to use the
|
||||
@@ -219,6 +229,11 @@ impl Nvmc {
|
||||
@@ -217,6 +227,10 @@ impl Nvmc {
|
||||
}
|
||||
}
|
||||
|
||||
+ pub fn configure_readonly(&self) {
|
||||
+ let regs = &*self.registers;
|
||||
+ regs.config.write(Configuration::WEN::Ren);
|
||||
+ self.registers.config.write(Configuration::WEN::Ren);
|
||||
+ }
|
||||
+
|
||||
/// Configure the NVMC to allow writes to flash.
|
||||
pub fn configure_writeable(&self) {
|
||||
let regs = &*self.registers;
|
||||
@@ -234,7 +249,7 @@ impl Nvmc {
|
||||
let regs = &*self.registers;
|
||||
regs.config.write(Configuration::WEN::Een);
|
||||
self.registers.config.write(Configuration::WEN::Wen);
|
||||
@@ -229,9 +243,7 @@ impl Nvmc {
|
||||
pub fn erase_uicr(&self) {
|
||||
self.registers.config.write(Configuration::WEN::Een);
|
||||
while !self.is_ready() {}
|
||||
- regs.erasepage.write(ErasePage::ERASEPAGE.val(0x10001000));
|
||||
+ regs.eraseuicr.write(EraseUicr::ERASEUICR::ERASE);
|
||||
- self.registers
|
||||
- .erasepage
|
||||
- .write(ErasePage::ERASEPAGE.val(0x10001000));
|
||||
+ self.registers.eraseuicr.write(EraseUicr::ERASEUICR::ERASE);
|
||||
while !self.is_ready() {}
|
||||
}
|
||||
|
||||
@@ -326,7 +341,7 @@ impl Nvmc {
|
||||
@@ -319,7 +331,7 @@ impl Nvmc {
|
||||
// Put the NVMC in write mode.
|
||||
regs.config.write(Configuration::WEN::Wen);
|
||||
self.registers.config.write(Configuration::WEN::Wen);
|
||||
|
||||
- for i in (0..data.len()).step_by(4) {
|
||||
+ for i in (0..data.len()).step_by(WORD_SIZE) {
|
||||
let word: u32 = (data[i + 0] as u32) << 0
|
||||
| (data[i + 1] as u32) << 8
|
||||
| (data[i + 2] as u32) << 16
|
||||
@@ -394,3 +409,236 @@ impl hil::flash::Flash for Nvmc {
|
||||
@@ -387,3 +399,236 @@ impl hil::flash::Flash for Nvmc {
|
||||
self.erase_page(page_number)
|
||||
}
|
||||
}
|
||||
@@ -305,10 +306,10 @@ index b70162cae..9934f3a31 100644
|
||||
+ }
|
||||
+}
|
||||
diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs
|
||||
index dbe503515..428d90c29 100644
|
||||
index 49e1e5182..807170195 100644
|
||||
--- a/kernel/src/lib.rs
|
||||
+++ b/kernel/src/lib.rs
|
||||
@@ -123,7 +123,7 @@ pub use crate::sched::cooperative::{CoopProcessNode, CooperativeSched};
|
||||
@@ -122,7 +122,7 @@ pub use crate::sched::cooperative::{CoopProcessNode, CooperativeSched};
|
||||
pub use crate::sched::mlfq::{MLFQProcessNode, MLFQSched};
|
||||
pub use crate::sched::priority::PrioritySched;
|
||||
pub use crate::sched::round_robin::{RoundRobinProcessNode, RoundRobinSched};
|
||||
@@ -348,10 +349,10 @@ index 348c746a5..5465c95f4 100644
|
||||
}
|
||||
}
|
||||
diff --git a/kernel/src/process.rs b/kernel/src/process.rs
|
||||
index 4dfde3b4f..8380af673 100644
|
||||
index c52754be3..ae6a58341 100644
|
||||
--- a/kernel/src/process.rs
|
||||
+++ b/kernel/src/process.rs
|
||||
@@ -360,6 +360,15 @@ pub trait ProcessType {
|
||||
@@ -359,6 +359,15 @@ pub trait ProcessType {
|
||||
/// writeable flash region.
|
||||
fn get_writeable_flash_region(&self, region_index: usize) -> (u32, u32);
|
||||
|
||||
@@ -367,7 +368,7 @@ index 4dfde3b4f..8380af673 100644
|
||||
/// Debug function to update the kernel on where the stack starts for this
|
||||
/// process. Processes are not required to call this through the memop
|
||||
/// system call, but it aids in debugging the process.
|
||||
@@ -1015,6 +1024,35 @@ impl<C: Chip> ProcessType for Process<'_, C> {
|
||||
@@ -1048,6 +1057,35 @@ impl<C: Chip> ProcessType for Process<'_, C> {
|
||||
self.header.get_writeable_flash_region(region_index)
|
||||
}
|
||||
|
||||
@@ -403,7 +404,7 @@ index 4dfde3b4f..8380af673 100644
|
||||
fn update_stack_start_pointer(&self, stack_pointer: *const u8) {
|
||||
if stack_pointer >= self.mem_start() && stack_pointer < self.mem_end() {
|
||||
self.debug.map(|debug| {
|
||||
@@ -1664,6 +1702,33 @@ impl<C: 'static + Chip> Process<'_, C> {
|
||||
@@ -1751,6 +1789,33 @@ impl<C: 'static + Chip> Process<'_, C> {
|
||||
return Err(ProcessLoadError::MpuInvalidFlashLength);
|
||||
}
|
||||
|
||||
@@ -438,7 +439,7 @@ index 4dfde3b4f..8380af673 100644
|
||||
// memory space just for kernel and grant state. We need to make
|
||||
// sure we allocate enough memory just for that.
|
||||
diff --git a/kernel/src/sched.rs b/kernel/src/sched.rs
|
||||
index 88eea4042..ed3ae8260 100644
|
||||
index 10626a2e1..8844bc6c3 100644
|
||||
--- a/kernel/src/sched.rs
|
||||
+++ b/kernel/src/sched.rs
|
||||
@@ -118,6 +118,12 @@ pub enum SchedulingDecision {
|
||||
@@ -482,7 +483,7 @@ index 88eea4042..ed3ae8260 100644
|
||||
process_identifier_max: Cell::new(0),
|
||||
grant_counter: Cell::new(0),
|
||||
grants_finalized: Cell::new(false),
|
||||
@@ -899,4 +916,8 @@ impl Kernel {
|
||||
@@ -900,4 +917,8 @@ impl Kernel {
|
||||
|
||||
(return_reason, time_executed_us)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user