aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/fm4.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2020-08-18 18:56:03 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2020-09-05 17:12:32 +0100
commite66593f8242d49dd05f6b9c4a5121fa466a158aa (patch)
tree157fb088551e543a2591dd91c10b69474ba6ddec /src/flash/nor/fm4.c
parent2f62883161fe4cdc32826a7bc6826ad82516233e (diff)
downloadriscv-openocd-e66593f8242d49dd05f6b9c4a5121fa466a158aa.zip
riscv-openocd-e66593f8242d49dd05f6b9c4a5121fa466a158aa.tar.gz
riscv-openocd-e66593f8242d49dd05f6b9c4a5121fa466a158aa.tar.bz2
flash: use proper format with uint32_t
Modify the format strings to properly handle uint32_t data types. Change the type of variable retval in 'nor/ambiqmicro.c' to match both the value to carry and the returned type of the function. Fix the prototype mismatch of function lpc2900_address2sector() between the header and the C file. Change-Id: I68ffba9bd83eec8132f83bff3af993861fd09d84 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5816 Tested-by: jenkins
Diffstat (limited to 'src/flash/nor/fm4.c')
-rw-r--r--src/flash/nor/fm4.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/flash/nor/fm4.c b/src/flash/nor/fm4.c
index 4daec78..211a008 100644
--- a/src/flash/nor/fm4.c
+++ b/src/flash/nor/fm4.c
@@ -172,7 +172,7 @@ static int fm4_flash_erase(struct flash_bank *bank, unsigned int first,
retval = ERROR_FLASH_OPERATION_FAILED;
goto err_run_ret;
} else if (result != 0) {
- LOG_ERROR("Unexpected error %d from flash sector erase programming algorithm", result);
+ LOG_ERROR("Unexpected error %" PRIu32 " from flash sector erase programming algorithm", result);
retval = ERROR_FLASH_OPERATION_FAILED;
goto err_run_ret;
} else
@@ -213,7 +213,7 @@ static int fm4_flash_write(struct flash_bank *bank, const uint8_t *buffer,
#include "../../../contrib/loaders/flash/fm4/write.inc"
};
- LOG_DEBUG("Spansion FM4 write at 0x%08" PRIx32 " (%" PRId32 " bytes)",
+ LOG_DEBUG("Spansion FM4 write at 0x%08" PRIx32 " (%" PRIu32 " bytes)",
offset, byte_count);
if (offset & 0x1) {
@@ -222,7 +222,7 @@ static int fm4_flash_write(struct flash_bank *bank, const uint8_t *buffer,
return ERROR_FLASH_DST_BREAKS_ALIGNMENT;
}
if (byte_count & 0x1) {
- LOG_WARNING("length %" PRId32 " is not 2-byte aligned, rounding up",
+ LOG_WARNING("length %" PRIu32 " is not 2-byte aligned, rounding up",
byte_count);
}
@@ -273,7 +273,7 @@ static int fm4_flash_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t halfwords = MIN(halfword_count, data_workarea->size / 2);
uint32_t addr = bank->base + offset;
- LOG_DEBUG("copying %" PRId32 " bytes to SRAM " TARGET_ADDR_FMT,
+ LOG_DEBUG("copying %" PRIu32 " bytes to SRAM " TARGET_ADDR_FMT,
MIN(halfwords * 2, byte_count), data_workarea->address);
retval = target_write_buffer(target, data_workarea->address,
@@ -284,7 +284,7 @@ static int fm4_flash_write(struct flash_bank *bank, const uint8_t *buffer,
goto err_write_data;
}
- LOG_DEBUG("writing 0x%08" PRIx32 "-0x%08" PRIx32 " (%" PRId32 "x)",
+ LOG_DEBUG("writing 0x%08" PRIx32 "-0x%08" PRIx32 " (%" PRIu32 "x)",
addr, addr + halfwords * 2 - 1, halfwords);
buf_set_u32(reg_params[0].value, 0, 32, (addr & ~0xffff) | 0xAA8);
@@ -312,7 +312,7 @@ static int fm4_flash_write(struct flash_bank *bank, const uint8_t *buffer,
retval = ERROR_FLASH_OPERATION_FAILED;
goto err_run_ret;
} else if (result != 0) {
- LOG_ERROR("Unexpected error %d from flash write "
+ LOG_ERROR("Unexpected error %" PRIu32 " from flash write "
"programming algorithm", result);
retval = ERROR_FLASH_OPERATION_FAILED;
goto err_run_ret;