src/flash/nor/kinetis.c: Fixed flash bank write gap

Flash banks created in kinetis_create_missing_banks did not populate
bank->minimal_write_gap. The default value of 0 was interpreted as
FLASH_WRITE_CONTINUOUS. This created unnecessary large padding if your
binary had a gap in the populated flash. It also caused flash errors
when loading with GDB because the erroneously padded pages were not
erased first. Tested using an S32k148 using s32k.cfg.

Change-Id: I9b7af698e29ac2c4f5fc8ecd82fa7f4b1a0d43f1
Signed-off-by: daniellizewski <daniellizewski@geotab.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8463
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
daniellizewski 2024-08-23 08:31:04 -04:00 committed by Antonio Borneo
parent 6f9b1ee521
commit d35399b00e
1 changed files with 1 additions and 0 deletions

View File

@ -1038,6 +1038,7 @@ static int kinetis_create_missing_banks(struct kinetis_chip *k_chip)
bank->target = k_chip->target; bank->target = k_chip->target;
bank->driver = &kinetis_flash; bank->driver = &kinetis_flash;
bank->default_padded_value = bank->erased_value = 0xff; bank->default_padded_value = bank->erased_value = 0xff;
bank->minimal_write_gap = FLASH_WRITE_GAP_SECTOR;
snprintf(name, sizeof(name), "%s.%s%s", snprintf(name, sizeof(name), "%s.%s%s",
base_name, class, num); base_name, class, num);