Fixes to compile with gcc11 #925

Target code changes are pure for formal correctness and not tested!
This commit is contained in:
Uwe Bonnes 2021-09-07 22:58:21 +02:00 committed by UweBonnes
parent 28623e6b27
commit e1a928beb1
3 changed files with 9 additions and 9 deletions

View File

@ -28,9 +28,9 @@ typedef struct bmp_info_s {
bmp_type_t bmp_type;
char dev;
char serial[64];
char manufacturer[128];
char product[128];
char version[128];
char manufacturer[512];
char product[256];
char version[256];
bool is_jtag;
#if HOSTED_BMP_ONLY != 1
libusb_context *libusb_ctx;

View File

@ -486,10 +486,10 @@ static int kl_gen_flash_done(struct target_flash *f)
kl_gen_command(f->t, FTFE_CMD_PROGRAM_PHRASE,
FLASH_SECURITY_BYTE_ADDRESS - 4, (uint8_t*)vals);
} else {
uint32_t val = target_mem_read32(f->t, FLASH_SECURITY_BYTE_ADDRESS);
val = (val & 0xffffff00) | FLASH_SECURITY_BYTE_UNSECURED;
uint32_t vals[2] = {target_mem_read32(f->t, FLASH_SECURITY_BYTE_ADDRESS), 0};
vals[0] = (vals[0] & 0xffffff00) | FLASH_SECURITY_BYTE_UNSECURED;
kl_gen_command(f->t, FTFA_CMD_PROGRAM_LONGWORD,
FLASH_SECURITY_BYTE_ADDRESS, (uint8_t*)&val);
FLASH_SECURITY_BYTE_ADDRESS, (uint8_t*)&vals);
}
return 0;

View File

@ -373,10 +373,10 @@ static int ke04_flash_done(struct target_flash *f)
/* Load the security byte from its field */
/* Note: Cumulative programming is not allowed according to the RM */
uint32_t val = target_mem_read32(f->t, FLASH_SECURITY_WORD_ADDRESS);
val = (val & 0xff00ffff) | (FLASH_SECURITY_BYTE_UNSECURED << 16);
uint32_t vals[2] = {target_mem_read32(f->t, FLASH_SECURITY_WORD_ADDRESS), 0};
vals[0] = (vals[0] & 0xff00ffff) | (FLASH_SECURITY_BYTE_UNSECURED << 16);
ke04_command(f->t, CMD_PROGRAM_FLASH_32,
FLASH_SECURITY_WORD_ADDRESS, (uint8_t *)&val);
FLASH_SECURITY_WORD_ADDRESS, (uint8_t *)&vals);
return 0;
}