Skip to content

Commit b017563

Browse files
authored
Merge branch 'main' into add/reorder-apps
2 parents 92df482 + bd0ded3 commit b017563

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

.github/workflows/issue-builder.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ jobs:
170170
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171171
UPSTREAM: "tock/tock"
172172
DOWNSTREAM: ${{ github.repository }}
173-
TITLE: Bring updates from 'tock-tbf' to 'tbf-parser'
173+
TITLE: Bring updates from `tock-tbf` to `tbf-parser`
174174
LABELS: D3-TBF PARSER,P1-CRITICAL,EXCLUSIVE LABEL
175175
BODY: |
176-
Please review the commits in order of oldest to newest (bottom to top). Once you have implemented the corresponding updates, copy-paste the sha of the commit you last covered in ['.lastcommsha'](https://github.com/WyliodrinEmbeddedIoT/tockloader-rs/tree/main/.github/.lastcommsha). Make sure to label any PRs addressing the commits in this list with 'EXCLUSIVE LABEL'. The following commits need to be accounted for:
176+
Please review the commits in order of oldest to newest (bottom to top). Once you have implemented the corresponding updates, copy-paste the sha of the commit you last covered in [.lastcommsha](https://github.com/WyliodrinEmbeddedIoT/tockloader-rs/tree/main/.github/.lastcommsha). Make sure to label any PRs addressing the commits in this list with `EXCLUSIVE LABEL`. The following commits need to be accounted for:
177177
PINNED: false
178178
CLOSE_PREVIOUS: true
179179

.lastcommsha

-4 Bytes
Binary file not shown.

tockloader-lib/src/attributes/app_attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl AppAttributes {
143143
// The end of the application binary marks the beginning of the
144144
// footer.
145145
//
146-
// TODO(george-cosma): This is not always true, `get_binary_end`
146+
// Note: This is not always true, `get_binary_end`
147147
// does not make sense if the application is just padding. This can
148148
// crash the process.
149149
let binary_end_offset = header.get_binary_end();
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
use async_trait::async_trait;
2+
3+
use crate::board_settings::BoardSettings;
4+
use crate::bootloader_serial::{
5+
issue_command, ping_bootloader_and_wait_for_response, Command, Response,
6+
};
7+
use crate::connection::{Connection, SerialConnection};
8+
use crate::errors::{InternalError, TockloaderError};
9+
use crate::CommandEraseApps;
10+
11+
#[async_trait]
12+
impl CommandEraseApps for SerialConnection {
13+
async fn erase_apps(&mut self, settings: &BoardSettings) -> Result<(), TockloaderError> {
14+
if !self.is_open() {
15+
return Err(InternalError::ConnectionNotOpen.into());
16+
}
17+
let stream = self.stream.as_mut().expect("Board must be open");
18+
19+
ping_bootloader_and_wait_for_response(stream).await?;
20+
21+
let pkt = (settings.start_address as u32).to_le_bytes().to_vec();
22+
let (_, _) = issue_command(stream, Command::ErasePage, pkt, true, 0, Response::OK).await?;
23+
Ok(())
24+
}
25+
}

0 commit comments

Comments
 (0)