From fc287ab684468f50ab57e5efc94d8cc8d64422fd Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Mon, 2 Mar 2026 11:44:38 +0000 Subject: [PATCH 1/2] Fix OTP get/list for row 1 The last_reg_row variable was not being initialised to an invalid value --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index cec28af..bdea571 100644 --- a/main.cpp +++ b/main.cpp @@ -7669,7 +7669,7 @@ bool otp_get_command::execute(device_map &devices) { picoboot_memory_access raw_access(con); auto model = raw_access.get_model(); auto matches = filter_otp(settings.otp.selectors, otp_cmd_max_bits(), settings.otp.fuzzy); - uint32_t last_reg_row = 1; // invalid + uint32_t last_reg_row = 0xffffffff; // invalid bool first = true; char buf[512]; uint32_t raw_buffer[OTP_PAGE_ROWS]; @@ -8018,7 +8018,7 @@ bool otp_list_command::execute(device_map &devices) { init_otp(otp_regs, settings.otp.extra_files); auto matches = filter_otp(settings.otp.selectors.empty() ? std::vector({":"}) : settings.otp.selectors, 24, true); - uint32_t last_reg_row = 1; // invalid + uint32_t last_reg_row = 0xffffffff; // invalid bool first = true; char buf[512]; int indent0 = settings.otp.list_pages ? 18 : 8; From 6f0d95c7f4bdcb104ee280efe998ecd3c559dd13 Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Mon, 2 Mar 2026 11:56:01 +0000 Subject: [PATCH 2/2] Replace 0xffffffff with UINT32_MAX --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index bdea571..1394dab 100644 --- a/main.cpp +++ b/main.cpp @@ -7669,7 +7669,7 @@ bool otp_get_command::execute(device_map &devices) { picoboot_memory_access raw_access(con); auto model = raw_access.get_model(); auto matches = filter_otp(settings.otp.selectors, otp_cmd_max_bits(), settings.otp.fuzzy); - uint32_t last_reg_row = 0xffffffff; // invalid + uint32_t last_reg_row = UINT32_MAX; // invalid bool first = true; char buf[512]; uint32_t raw_buffer[OTP_PAGE_ROWS]; @@ -8018,7 +8018,7 @@ bool otp_list_command::execute(device_map &devices) { init_otp(otp_regs, settings.otp.extra_files); auto matches = filter_otp(settings.otp.selectors.empty() ? std::vector({":"}) : settings.otp.selectors, 24, true); - uint32_t last_reg_row = 0xffffffff; // invalid + uint32_t last_reg_row = UINT32_MAX; // invalid bool first = true; char buf[512]; int indent0 = settings.otp.list_pages ? 18 : 8;