From 93bfa23015ebe6b840d97facf67f1abed44d57b2 Mon Sep 17 00:00:00 2001 From: Hannes Weisbach Date: Tue, 21 May 2024 14:58:05 +0200 Subject: [PATCH] Add `NO_ERASE` to enum erase_type_t to mark OTP writes --- src/st-flash/flash.c | 2 +- src/stlink-lib/common_flash.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/st-flash/flash.c b/src/st-flash/flash.c index a7506366..cd27cebe 100644 --- a/src/st-flash/flash.c +++ b/src/st-flash/flash.c @@ -197,7 +197,7 @@ int32_t main(int32_t ac, char** av) { printf("OTP Write NOT implemented\n"); goto on_error; } - err = stlink_fwrite_flash(sl, o.filename, o.addr, erase_type); + err = stlink_fwrite_flash(sl, o.filename, o.addr, NO_ERASE); if (err == -1) { printf("stlink_fwrite_flash() == -1\n"); diff --git a/src/stlink-lib/common_flash.h b/src/stlink-lib/common_flash.h index fce55bdd..a85e5439 100644 --- a/src/stlink-lib/common_flash.h +++ b/src/stlink-lib/common_flash.h @@ -11,6 +11,7 @@ #define BANK_2 1 enum erase_type_t { + NO_ERASE = 0, SECTION_ERASE = 1, MASS_ERASE = 2, };