Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pin lock issue during io reset + Fix S+ and X SRAM size #239

Merged
merged 4 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ledger_device_sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ledger_device_sdk"
version = "1.20.3"
version = "1.20.4"
authors = ["yhql", "yogh333", "agrojean-ledger", "kingofpayne"]
edition = "2021"
license.workspace = true
Expand All @@ -21,7 +21,7 @@ rand_core = { version = "0.6.3", default-features = false }
zeroize = { version = "1.6.0", default-features = false }
numtoa = "0.2.4"
const-zero = "0.1.1"
ledger_secure_sdk_sys = { path = "../ledger_secure_sdk_sys", version = "1.6.6" }
ledger_secure_sdk_sys = { path = "../ledger_secure_sdk_sys", version = "1.6.7" }

[features]
debug = []
Expand Down
2 changes: 1 addition & 1 deletion ledger_device_sdk/nanosplus_layout.ld
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MEMORY
{
FLASH (rx) : ORIGIN = 0xc0de0000, LENGTH = 400K
DATA (r) : ORIGIN = 0xc0de0000, LENGTH = 400K
SRAM (rwx) : ORIGIN = 0xda7a0000, LENGTH = 30K
SRAM (rwx) : ORIGIN = 0xda7a0000, LENGTH = 44K
}

PAGE_SIZE = 512;
Expand Down
2 changes: 1 addition & 1 deletion ledger_device_sdk/nanox_layout.ld
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MEMORY
{
FLASH (rx) : ORIGIN = 0xc0de0000, LENGTH = 400K
DATA (r) : ORIGIN = 0xc0de0000, LENGTH = 400K
SRAM (rwx) : ORIGIN = 0xda7a0000, LENGTH = 30K
SRAM (rwx) : ORIGIN = 0xda7a0000, LENGTH = 28K
}

PAGE_SIZE = 256;
Expand Down
3 changes: 0 additions & 3 deletions ledger_device_sdk/src/nbgl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ use core::ffi::{c_char, c_int};
use core::mem::transmute;
use ledger_secure_sdk_sys::*;

#[no_mangle]
static mut G_ux_params: bolos_ux_params_t = unsafe { const_zero!(bolos_ux_params_t) };

pub mod nbgl_address_review;
pub mod nbgl_choice;
pub mod nbgl_generic_review;
Expand Down
2 changes: 1 addition & 1 deletion ledger_secure_sdk_sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ledger_secure_sdk_sys"
version = "1.6.6"
version = "1.6.7"
authors = ["yhql", "agrojean-ledger", "yogh333"]
edition = "2021"
license.workspace = true
Expand Down
17 changes: 17 additions & 0 deletions ledger_secure_sdk_sys/src/c/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ void c_reset_bss() {
memset(bss, 0, bss_len);
}

bolos_ux_params_t G_ux_params;

void c_boot_std() {
// below is a 'manual' implementation of `io_seproxyhal_init`
#ifdef HAVE_MCU_PROTECT
Expand All @@ -277,6 +279,21 @@ void c_boot_std() {
io_seproxyhal_spi_send(c, 4);
#endif

#ifndef TARGET_NANOS
// Warn UX layer of io reset to avoid unwanted pin lock
memset(&G_ux_params, 0, sizeof(G_ux_params));
G_ux_params.ux_id = BOLOS_UX_IO_RESET;

// If the app has just been booted from the UX, multiple os_ux calls may be necessary
// to ensure UX layer has take the BOLOS_UX_IO_RESET instruction into account.
for (uint8_t i = 0; i < 2; i++) {
os_ux(&G_ux_params);
if (os_sched_last_status(TASK_BOLOS_UX) == BOLOS_UX_OK) {
break;
}
}
#endif

#ifdef HAVE_BLE
unsigned int plane = G_io_app.plane_mode;
#endif
Expand Down
Loading