Skip to content

Commit

Permalink
src/flash/nor/kinetis.c: Fixed flash bank write gap
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/8463
Tested-by: jenkins
Reviewed-by: Antonio Borneo <[email protected]>
Reviewed-by: Tomas Vanek <[email protected]>
  • Loading branch information
daniellizewski authored and borneoa committed Sep 15, 2024
1 parent 6f9b1ee commit d35399b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/flash/nor/kinetis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ static int kinetis_create_missing_banks(struct kinetis_chip *k_chip)
bank->target = k_chip->target;
bank->driver = &kinetis_flash;
bank->default_padded_value = bank->erased_value = 0xff;
bank->minimal_write_gap = FLASH_WRITE_GAP_SECTOR;

snprintf(name, sizeof(name), "%s.%s%s",
base_name, class, num);
Expand Down

0 comments on commit d35399b

Please sign in to comment.