]> www.infradead.org Git - users/borneoa/openocd-next.git/commit
flash/nor/kinetis: fix assertion during flash write
authorTomas Vanek <vanekt@fbl.cz>
Fri, 17 Jan 2025 17:02:50 +0000 (18:02 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 25 Jan 2025 10:32:45 +0000 (10:32 +0000)
commit77f9da76264d4970faf22a40a31fc66fa7543b57
tree25fbf161b58b4a40fb904ea7fdf0a6eabf82b255
parent3099547069896ccff054d64bac6041fe1e20add9
flash/nor/kinetis: fix assertion during flash write

If the device has at lest one FlexNVM bank and it is set as EE backup
only, the bank has no protection blocks.

kinetis_fill_fcf() collects protection data from all banks before
flash write of the sector containing FCF block. In case it encountered
a FlexNVM bank with no protection blocks assert failed.

Failed flash write of previously erased FCF block could cause
engaging debugging lock (if the device was run or reset).

Skip banks with zero protection blocks.
Replace assert() by LOG_ERROR() as we have to finish FCF write.

Change-Id: Ibe7e7ec6d0db4453b8a53c8256987621b809c99d
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Suggested-by: Jasper v. Blanckenburg <jazzpi@users.sourceforge.net>
Fixes: https://sourceforge.net/p/openocd/tickets/448/
Reviewed-on: https://review.openocd.org/c/openocd/+/8719
Tested-by: jenkins
Reviewed-by: Jasper v. Blanckenburg <jasper@mezzo.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/flash/nor/kinetis.c