forked from auracaster/openocd
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:
@@ -253,7 +253,7 @@ static int xmc1xxx_write(struct flash_bank *bank, const uint8_t *buffer,
|
||||
#include "../../../contrib/loaders/flash/xmc1xxx/write.inc"
|
||||
};
|
||||
|
||||
LOG_DEBUG("Infineon XMC1000 write at 0x%08" PRIx32 " (%" PRId32 " bytes)",
|
||||
LOG_DEBUG("Infineon XMC1000 write at 0x%08" PRIx32 " (%" PRIu32 " bytes)",
|
||||
offset, byte_count);
|
||||
|
||||
if (offset & (NVM_BLOCK_SIZE - 1)) {
|
||||
@@ -262,7 +262,7 @@ static int xmc1xxx_write(struct flash_bank *bank, const uint8_t *buffer,
|
||||
return ERROR_FLASH_DST_BREAKS_ALIGNMENT;
|
||||
}
|
||||
if (byte_count & (NVM_BLOCK_SIZE - 1)) {
|
||||
LOG_WARNING("length %" PRId32 " is not block aligned, rounding up",
|
||||
LOG_WARNING("length %" PRIu32 " is not block aligned, rounding up",
|
||||
byte_count);
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ static int xmc1xxx_write(struct flash_bank *bank, const uint8_t *buffer,
|
||||
uint32_t blocks = MIN(block_count, data_workarea->size / NVM_BLOCK_SIZE);
|
||||
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(blocks * NVM_BLOCK_SIZE, byte_count),
|
||||
data_workarea->address);
|
||||
|
||||
@@ -329,7 +329,7 @@ static int xmc1xxx_write(struct flash_bank *bank, const uint8_t *buffer,
|
||||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG("writing 0x%08" PRIx32 "-0x%08" PRIx32 " (%" PRId32 "x)",
|
||||
LOG_DEBUG("writing 0x%08" PRIx32 "-0x%08" PRIx32 " (%" PRIu32 "x)",
|
||||
addr, addr + blocks * NVM_BLOCK_SIZE - 1, blocks);
|
||||
|
||||
retval = xmc1xxx_nvm_check_idle(target);
|
||||
@@ -429,7 +429,7 @@ static int xmc1xxx_get_info_command(struct flash_bank *bank, char *buf, int buf_
|
||||
}
|
||||
LOG_DEBUG("ID[7] = %08" PRIX32, chipid[7]);
|
||||
|
||||
snprintf(buf, buf_size, "XMC%" PRIx32 "00 %X flash %uKB ROM %uKB SRAM %uKB",
|
||||
snprintf(buf, buf_size, "XMC%" PRIx32 "00 %" PRIX32 " flash %" PRIu32 "KB ROM %" PRIu32 "KB SRAM %" PRIu32 "KB",
|
||||
(chipid[0] >> 12) & 0xff,
|
||||
0xAA + (chipid[7] >> 28) - 1,
|
||||
(((chipid[6] >> 12) & 0x3f) - 1) * 4,
|
||||
|
||||
Reference in New Issue
Block a user