Ah, thanks. I was able to reflash after ignoring the error. The error at the end is a little scary for a n00b so that is why I took pause. Maybe if the write verification errors were noted and the error was softened it would save you from having to answer this question again

I am no C programmer and couldn't get the build to work with VS but maybe something that gives lets you know its ok and returns success.
Code:
np_backend.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/np_backend.c b/np_backend.c
index 83c6a70..995e6a5 100644
--- a/np_backend.c
+++ b/np_backend.c
@@ -719,8 +719,13 @@ static int npk_raw_flashblock(const uint8_t *src, uint32_t start, uint32_t len)
errval = diag_l1_recv(global_l2_conn->diag_link->l2_dl0d, NULL, &rxbuf[errval], needed, 300);
}
if (errval < 0) errval = 0; //floor
- printf("%s\n", decode_nrc(&rxbuf[1]));
+ char *errstring = decode_nrc(&rxbuf[1]);
+ printf("%s\n", errstring);
(void) diag_l2_ioctl(global_l2_conn, DIAG_IOCTL_IFLUSH, NULL);
+ //take note that the error was a post-write verify such that the error can be softened in practice mode
+ if (strcmp(errstring, "post-write verify failed") == 0 ) {
+ return -2;
+ }
return -1;
}
@@ -808,7 +813,10 @@ int reflash_block(const uint8_t *newdata, const struct flashdev_t *fdt, unsigned
/* 4- write */
errval = npk_raw_flashblock(newdata, start, len);
- if (errval) {
+ if (practice && errval == -2){
+ printf("\n post-write verify failed errors are expected in practice mode as the ROM was not actually written.");
+ }
+ else if (errval) {
printf("\nReflash error ! Do not panic, do not reset the ECU immediately. The kernel is "
"most likely still running and receiving commands !\n");
goto badexit;