From 8ffd5d94ab35f3a153a022df45e086f9639dc211 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 13 Jul 2026 01:29:21 +0200 Subject: [PATCH] Fix printf format. Signed-off-by: Pol Henarejos --- src/otp/otp_esp32.c | 12 ++++++------ src/otp/otp_rp2350.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/otp/otp_esp32.c b/src/otp/otp_esp32.c index ddc7b49..570fd4a 100644 --- a/src/otp/otp_esp32.c +++ b/src/otp/otp_esp32.c @@ -291,14 +291,14 @@ void otp_platform_init(const uint8_t **otp_key_1_out, const uint8_t **otp_key_2_ random_fill_buffer(mkek, sizeof(mkek)); ret = esp_efuse_write_key(OTP_KEY_1, ESP_EFUSE_KEY_PURPOSE_USER, mkek, sizeof(mkek)); if (ret != 0) { - printf("Error writing OTP key 1 [%d]\n", ret); + printf("Error writing OTP key 1 [%ld]\n", ret); } mbedtls_platform_zeroize(mkek, sizeof(mkek)); write_otp[0] = OTP_KEY_1; } ret = read_key_from_efuse(OTP_KEY_1, _otp_key_1, sizeof(_otp_key_1)); if (ret != ESP_OK) { - printf("Error reading OTP key 1 [%d]\n", ret); + printf("Error reading OTP key 1 [%ld]\n", ret); } *otp_key_1_out = _otp_key_1; @@ -315,14 +315,14 @@ void otp_platform_init(const uint8_t **otp_key_1_out, const uint8_t **otp_key_2_ } ret = esp_efuse_write_key(OTP_KEY_2, ESP_EFUSE_KEY_PURPOSE_USER, pkey, olen); if (ret != 0) { - printf("Error writing OTP key 2 [%d]\n", ret); + printf("Error writing OTP key 2 [%ld]\n", ret); } mbedtls_platform_zeroize(pkey, sizeof(pkey)); write_otp[1] = OTP_KEY_2; } ret = read_key_from_efuse(OTP_KEY_2, _otp_key_2, sizeof(_otp_key_2)); if (ret != ESP_OK) { - printf("Error reading OTP key 2 [%d]\n", ret); + printf("Error reading OTP key 2 [%ld]\n", ret); } *otp_key_2_out = _otp_key_2; @@ -330,11 +330,11 @@ void otp_platform_init(const uint8_t **otp_key_1_out, const uint8_t **otp_key_2_ if (write_otp[i] != 0xFFFF) { ret = esp_efuse_set_key_dis_write(write_otp[i]); if (ret != ESP_OK) { - printf("Error setting OTP key %d to read only [%d]\n", i, ret); + printf("Error setting OTP key %d to read only [%ld]\n", i, ret); } ret = esp_efuse_set_keypurpose_dis_write(write_otp[i]); if (ret != ESP_OK) { - printf("Error setting OTP key %d purpose to read only [%d]\n", i, ret); + printf("Error setting OTP key %d purpose to read only [%ld]\n", i, ret); } } } diff --git a/src/otp/otp_rp2350.c b/src/otp/otp_rp2350.c index 8b9f37a..c55a41c 100644 --- a/src/otp/otp_rp2350.c +++ b/src/otp/otp_rp2350.c @@ -50,7 +50,7 @@ static int otp_write_data_mode(uint16_t row, const uint8_t *data, uint16_t len, otp_cmd_t cmd = { .flags = row | (is_ecc ? OTP_CMD_ECC_BITS : 0) | OTP_CMD_WRITE_BITS }; uint32_t ret = rom_func_otp_access((uint8_t *)data, len, cmd); if (ret) { - printf("OTP Write failed with error: %ld\n", ret); + printf("OTP Write failed with error: %lu\n", ret); } return ret; }