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
This commit is contained in:
@@ -275,7 +275,7 @@ static int ath79_spi_bitbang_chunk(struct flash_bank *bank,
|
||||
*transferred = 0;
|
||||
pracc_queue_init(&ctx);
|
||||
|
||||
LOG_DEBUG("ath79_spi_bitbang_bytes(%p, %08x, %p, %d)",
|
||||
LOG_DEBUG("ath79_spi_bitbang_bytes(%p, %08" PRIx32 ", %p, %d)",
|
||||
target, ath79_info->io_base, data, len);
|
||||
|
||||
LOG_DEBUG("max code %d => max len %d. to_xfer %d",
|
||||
@@ -568,7 +568,7 @@ static int ath79_write_page(struct flash_bank *bank, const uint8_t *buffer,
|
||||
ath79_info->dev->pagesize : SPIFLASH_DEF_PAGESIZE;
|
||||
|
||||
if (address & 0xff) {
|
||||
LOG_ERROR("ath79_write_page: unaligned write address: %08x",
|
||||
LOG_ERROR("ath79_write_page: unaligned write address: %08" PRIx32,
|
||||
address);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -577,7 +577,7 @@ static int ath79_write_page(struct flash_bank *bank, const uint8_t *buffer,
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
if (len > ath79_info->dev->pagesize) {
|
||||
LOG_ERROR("ath79_write_page: len bigger than page size %d: %d",
|
||||
LOG_ERROR("ath79_write_page: len bigger than page size %" PRIu32 ": %" PRIu32,
|
||||
pagesize, len);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -589,7 +589,7 @@ static int ath79_write_page(struct flash_bank *bank, const uint8_t *buffer,
|
||||
if (i == len) /* all 0xff, no need to program. */
|
||||
return ERROR_OK;
|
||||
|
||||
LOG_INFO("writing %d bytes to flash page @0x%08x", len, address);
|
||||
LOG_INFO("writing %" PRIu32 " bytes to flash page @0x%08" PRIx32, len, address);
|
||||
|
||||
memcpy(ath79_info->spi.page_buf, buffer, len);
|
||||
|
||||
@@ -692,12 +692,12 @@ static int ath79_read_buffer(struct flash_bank *bank, uint8_t *buffer,
|
||||
__func__, address, len);
|
||||
|
||||
if (address & 0xff) {
|
||||
LOG_ERROR("ath79_read_buffer: unaligned read address: %08x",
|
||||
LOG_ERROR("ath79_read_buffer: unaligned read address: %08" PRIx32,
|
||||
address);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
LOG_INFO("reading %d bytes from flash @0x%08x", len, address);
|
||||
LOG_INFO("reading %" PRIu32 " bytes from flash @0x%08" PRIx32, len, address);
|
||||
|
||||
/* bitbang command */
|
||||
ath79_spi_bitbang_prepare(bank);
|
||||
|
||||
Reference in New Issue
Block a user