)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"88a27370aaf181a041c3ea18af5e7f5d009d5cc7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"cbd3a6c8_b373c832","updated":"2026-09-20 13:36:10.000000000","message":"Looks good, thanks!","commit_id":"e04b5d5590992e433192f8e89c464d12a627ece9"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"e8be9e191bf323557fe180778fec6cf3d498ab1a","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"97d42e3b_5861fe9c","updated":"2026-10-16 07:47:24.000000000","message":"Marc, this change is in conflict with already merged\n9960: flash/nor: make flash driver erase_check method optional | https://review.openocd.org/c/openocd/+/9960\nCould you please rebase? Thanks","commit_id":"e04b5d5590992e433192f8e89c464d12a627ece9"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"9a3c065094a82bc4e9e2fb3ddbf78430961aa810","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"137cafdf_a7b2b8a0","in_reply_to":"97d42e3b_5861fe9c","updated":"2026-10-19 10:53:15.000000000","message":"Thanks!","commit_id":"e04b5d5590992e433192f8e89c464d12a627ece9"}],"src/flash/nor/core.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"ff5dc47c73d7d6686f751388faec9e13ac16f791","unresolved":true,"context_lines":[{"line_number":353,"context_line":"\t\t\t\t\t\"continuing on next sector\", i);"},{"line_number":354,"context_line":"\t\t\t\tbreak;"},{"line_number":355,"context_line":"\t\t\t}"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"\t\t\tbank-\u003esectors[i].is_erased \u003d 1;"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"\t\t\tfor (uint32_t n_bytes \u003d 0; n_bytes \u003c chunk; n_bytes++) {"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"7a92e948_4902fe4d","line":356,"updated":"2026-09-16 08:22:03.000000000","message":"Could you please add keep_alive() and shutdown test similarly to\nhttps://review.openocd.org/c/openocd/+/9978/2/src/helper/crc32.c#55\nPreferably in a separate patch.","commit_id":"07d6ec6ca3b8778016ab182b31dd9b52683df443"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"badd13050daeb57b7b03c2ab50067f190637245c","unresolved":false,"context_lines":[{"line_number":353,"context_line":"\t\t\t\t\t\"continuing on next sector\", i);"},{"line_number":354,"context_line":"\t\t\t\tbreak;"},{"line_number":355,"context_line":"\t\t\t}"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"\t\t\tbank-\u003esectors[i].is_erased \u003d 1;"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"\t\t\tfor (uint32_t n_bytes \u003d 0; n_bytes \u003c chunk; n_bytes++) {"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"51ce011d_4ca4f220","line":356,"in_reply_to":"7a92e948_4902fe4d","updated":"2026-09-16 19:15:47.000000000","message":"Ack","commit_id":"07d6ec6ca3b8778016ab182b31dd9b52683df443"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"ff5dc47c73d7d6686f751388faec9e13ac16f791","unresolved":true,"context_lines":[{"line_number":354,"context_line":"\t\t\t\tbreak;"},{"line_number":355,"context_line":"\t\t\t}"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"\t\t\tbank-\u003esectors[i].is_erased \u003d 1;"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"\t\t\tfor (uint32_t n_bytes \u003d 0; n_bytes \u003c chunk; n_bytes++) {"},{"line_number":360,"context_line":"\t\t\t\tif (buffer[n_bytes] !\u003d bank-\u003eerased_value) {"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"c3e0940d_675bb75c","line":357,"updated":"2026-09-16 08:22:03.000000000","message":"Looks like a bug.\n\n1) If the sector is longer than buffer we set `is_erased \u003d 1` and continue in the inner loop. If the following `target_read_buffer()` fails it returns false positive.\n\n2) The first buffer of the sector sets `is_erased \u003d 0` and each next buffer round we re-set `is_erased \u003d 1` so it returns false positive too?!\n\nLine 334 should set 1 as in the original code, -1 should be set in error path.\n\nMarc instead of risking a regression in 1.0 release, don\u0027t you want to wait with this after 1.0 released? We can just preset `is_erased \u003d -1` in `handle_flash_erase_check_command`?","commit_id":"07d6ec6ca3b8778016ab182b31dd9b52683df443"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"88a27370aaf181a041c3ea18af5e7f5d009d5cc7","unresolved":false,"context_lines":[{"line_number":354,"context_line":"\t\t\t\tbreak;"},{"line_number":355,"context_line":"\t\t\t}"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"\t\t\tbank-\u003esectors[i].is_erased \u003d 1;"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"\t\t\tfor (uint32_t n_bytes \u003d 0; n_bytes \u003c chunk; n_bytes++) {"},{"line_number":360,"context_line":"\t\t\t\tif (buffer[n_bytes] !\u003d bank-\u003eerased_value) {"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"ba7896eb_ca05c424","line":357,"in_reply_to":"5950d29b_6f50196d","updated":"2026-09-20 13:36:10.000000000","message":"Done","commit_id":"07d6ec6ca3b8778016ab182b31dd9b52683df443"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"badd13050daeb57b7b03c2ab50067f190637245c","unresolved":true,"context_lines":[{"line_number":354,"context_line":"\t\t\t\tbreak;"},{"line_number":355,"context_line":"\t\t\t}"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"\t\t\tbank-\u003esectors[i].is_erased \u003d 1;"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"\t\t\tfor (uint32_t n_bytes \u003d 0; n_bytes \u003c chunk; n_bytes++) {"},{"line_number":360,"context_line":"\t\t\t\tif (buffer[n_bytes] !\u003d bank-\u003eerased_value) {"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"5950d29b_6f50196d","line":357,"in_reply_to":"c3e0940d_675bb75c","updated":"2026-09-16 19:15:47.000000000","message":"Ouh, what a brain fart on my side - sorry for the noise. Maybe too early in the morning ... :-/\n\n\u003e Marc instead of risking a regression in 1.0 release, don\u0027t you want to wait with this after 1.0 released? We can just preset is_erased \u003d -1 in handle_flash_erase_check_command?\n\nI see your point but we have to touch the exit path in `default_flash_mem_blank_check()` anyway. Adding more of the `is_erased` garbage which will last for years maybe sounds wrong to me :(\n\nThe new version should work - also tested it on hardware with injected read failures.","commit_id":"07d6ec6ca3b8778016ab182b31dd9b52683df443"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"ff5dc47c73d7d6686f751388faec9e13ac16f791","unresolved":true,"context_lines":[{"line_number":364,"context_line":"\t\t\t}"},{"line_number":365,"context_line":"\t\t}"},{"line_number":366,"context_line":"\t}"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"\treturn ERROR_OK;"},{"line_number":369,"context_line":"}"},{"line_number":370,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"5abf59b6_5654ee64","line":367,"updated":"2026-09-16 08:22:03.000000000","message":"free(buffer)","commit_id":"07d6ec6ca3b8778016ab182b31dd9b52683df443"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"badd13050daeb57b7b03c2ab50067f190637245c","unresolved":false,"context_lines":[{"line_number":364,"context_line":"\t\t\t}"},{"line_number":365,"context_line":"\t\t}"},{"line_number":366,"context_line":"\t}"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"\treturn ERROR_OK;"},{"line_number":369,"context_line":"}"},{"line_number":370,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"74e48d9e_f99319d4","line":367,"in_reply_to":"5abf59b6_5654ee64","updated":"2026-09-16 19:15:47.000000000","message":"🤦","commit_id":"07d6ec6ca3b8778016ab182b31dd9b52683df443"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"88a27370aaf181a041c3ea18af5e7f5d009d5cc7","unresolved":true,"context_lines":[{"line_number":348,"context_line":"\t\t\t * rather than failing the whole check."},{"line_number":349,"context_line":"\t\t\t */"},{"line_number":350,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":351,"context_line":"\t\t\t\tLOG_WARNING(\"Failed to check erase state on sector %u, \""},{"line_number":352,"context_line":"\t\t\t\t\t\"continuing on next sector\", i);"},{"line_number":353,"context_line":"\t\t\t\tbank-\u003esectors[i].is_erased \u003d -1;"},{"line_number":354,"context_line":"\t\t\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"99e56f5e_3fe3b0f6","line":351,"range":{"start_line":351,"start_character":4,"end_line":351,"end_character":15},"updated":"2026-09-20 13:36:10.000000000","message":"Just thinking if the warning is not too noisy here and if debug would be sufficient. But an unreadable sector triggers an error message anyway so maybe better to inform that checking continues.","commit_id":"e04b5d5590992e433192f8e89c464d12a627ece9"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"9ed24d3b36bd656ada85feb22fd48ec05f4a46e8","unresolved":false,"context_lines":[{"line_number":348,"context_line":"\t\t\t * rather than failing the whole check."},{"line_number":349,"context_line":"\t\t\t */"},{"line_number":350,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":351,"context_line":"\t\t\t\tLOG_WARNING(\"Failed to check erase state on sector %u, \""},{"line_number":352,"context_line":"\t\t\t\t\t\"continuing on next sector\", i);"},{"line_number":353,"context_line":"\t\t\t\tbank-\u003esectors[i].is_erased \u003d -1;"},{"line_number":354,"context_line":"\t\t\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"d5ef95d1_ad96baec","line":351,"range":{"start_line":351,"start_character":4,"end_line":351,"end_character":15},"in_reply_to":"99e56f5e_3fe3b0f6","updated":"2026-09-21 05:55:24.000000000","message":"Does not look bad:\n```\n\u003e flash erase_check 0\nRunning slow fallback erase check - add working memory\nSWD DPIDR 0x6ba02477\nFailed to read memory at 0x080f7ff0\nFailed to check erase state on sector 123, continuing on next sector\nSWD DPIDR 0x6ba02477\nFailed to read memory at 0x080f8000\nFailed to check erase state on sector 124, continuing on next sector\n        #  0: 0x00000000 (0x2000 8kB) not erased\n        #  1: 0x00002000 (0x2000 8kB) not erased\n        #  2: 0x00004000 (0x2000 8kB) not erased\n        #  3: 0x00006000 (0x2000 8kB) not erased\n        #  4: 0x00008000 (0x2000 8kB) not erased\n        #  5: 0x0000a000 (0x2000 8kB) not erased\n        #  6: 0x0000c000 (0x2000 8kB) not erased\n        #  7: 0x0000e000 (0x2000 8kB) not erased\n        # 12: 0x00018000 (0x2000 8kB) not erased\n        # 13: 0x0001a000 (0x2000 8kB) not erased\n        # 14: 0x0001c000 (0x2000 8kB) not erased\n        # 15: 0x0001e000 (0x2000 8kB) not erased\n        #123: 0x000f6000 (0x2000 8kB) erase state unknown\n        #124: 0x000f8000 (0x2000 8kB) erase state unknown\n        #126: 0x000fc000 (0x2000 8kB) not erased\n```\nTested on STM32H7A3, read faults are ECC errors after double `flash fillw` to the same location and different data.\nPCROP cannot be used as the protected area reads as zeros.","commit_id":"e04b5d5590992e433192f8e89c464d12a627ece9"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"3937da3f5d7c20785aeea71dc6557c0f6eeef94f","unresolved":false,"context_lines":[{"line_number":348,"context_line":"\t\t\t * rather than failing the whole check."},{"line_number":349,"context_line":"\t\t\t */"},{"line_number":350,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":351,"context_line":"\t\t\t\tLOG_WARNING(\"Failed to check erase state on sector %u, \""},{"line_number":352,"context_line":"\t\t\t\t\t\"continuing on next sector\", i);"},{"line_number":353,"context_line":"\t\t\t\tbank-\u003esectors[i].is_erased \u003d -1;"},{"line_number":354,"context_line":"\t\t\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"bfa60671_19639088","line":351,"range":{"start_line":351,"start_character":4,"end_line":351,"end_character":15},"in_reply_to":"d5ef95d1_ad96baec","updated":"2026-09-21 07:47:45.000000000","message":"PCROP has no standard behaviour across the different device series. Some implementations raise a read error IIRC. Anyway, features like PCROP need driver-specific code. I\u0027m thinking whether a sector-level callback would be beneficial such that drivers need to implement only device specific checks on some sectors. Nothing for this pactch of course.","commit_id":"e04b5d5590992e433192f8e89c464d12a627ece9"}],"src/flash/nor/tcl.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"a93f73a22e593a3f4b7ae840db93f62786cded49","unresolved":true,"context_lines":[{"line_number":185,"context_line":"\tint retval \u003d CALL_COMMAND_HANDLER(flash_command_get_bank, 0, \u0026p);"},{"line_number":186,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":187,"context_line":"\t\treturn retval;"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"\tretval \u003d p-\u003edriver-\u003eerase_check(p);"},{"line_number":190,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":191,"context_line":"\t\tcommand_print(CMD,"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"198f8eda_28297134","line":188,"updated":"2026-09-15 17:02:22.000000000","message":"Of course\n```\n\u003e flash erase_check 0\nTarget not halted\nError: checking erase state of flash bank #0 at 0x00000000\n        #  0: 0x00000000 (0x400 1kB) not erased\n        #  1: 0x00000400 (0x400 1kB) not erased\n```\nis clearly a problem. But we can easily solve it by setting all `is_erased \u003d UNKNOWN` here to prevent displaying of stalled information.\n\nI remember we discussed this code couple of years ago and decided that we should drop `is_erased` from flash sectors and use the same allocated block array as used as a parameter of `target_blank_check_memory()`\nThis would also solve sector-less devices more elegantly.\nUnfortunately no progress has been done.","commit_id":"847e3d3531024db3a2d7d5034a76510132588230"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"7b9fec37b02b404b321b13c1bb74c330a9da6cd5","unresolved":false,"context_lines":[{"line_number":185,"context_line":"\tint retval \u003d CALL_COMMAND_HANDLER(flash_command_get_bank, 0, \u0026p);"},{"line_number":186,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":187,"context_line":"\t\treturn retval;"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"\tretval \u003d p-\u003edriver-\u003eerase_check(p);"},{"line_number":190,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":191,"context_line":"\t\tcommand_print(CMD,"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"a7ea5a0a_e1871951","line":188,"in_reply_to":"198f8eda_28297134","updated":"2026-09-15 18:47:07.000000000","message":"I agree that the `erase_check()` API should return the erase state instead of \"caching\" the state in the driver. How would sector-less devices benefit from that?\n\nThis is something I have on my (long) TODO list :D But let\u0027s move forward with the current code for now.","commit_id":"847e3d3531024db3a2d7d5034a76510132588230"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"a975875ec9445c192fbc025df37120cf72076450","unresolved":false,"context_lines":[{"line_number":185,"context_line":"\tint retval \u003d CALL_COMMAND_HANDLER(flash_command_get_bank, 0, \u0026p);"},{"line_number":186,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":187,"context_line":"\t\treturn retval;"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"\tretval \u003d p-\u003edriver-\u003eerase_check(p);"},{"line_number":190,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":191,"context_line":"\t\tcommand_print(CMD,"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"a09534ae_6597a09a","line":188,"in_reply_to":"a7ea5a0a_e1871951","updated":"2026-09-15 20:30:05.000000000","message":"\u003e How would sector-less devices benefit from that?\n\nIf erase_check generates an array of offset/size pairs it may be the only part of code different for sectored and sector-less. The memory checking process and list of results would be controlled by this array regardless of sectored or sector-less.","commit_id":"847e3d3531024db3a2d7d5034a76510132588230"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"a93f73a22e593a3f4b7ae840db93f62786cded49","unresolved":true,"context_lines":[{"line_number":193,"context_line":"\t\t\tTARGET_ADDR_FMT \" failed\","},{"line_number":194,"context_line":"\t\t\tCMD_ARGV[0],"},{"line_number":195,"context_line":"\t\t\tp-\u003ebase);"},{"line_number":196,"context_line":"\t\treturn retval;"},{"line_number":197,"context_line":"\t}"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"\tbool blank \u003d true;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"4a1b8d6e_57dea4d1","line":196,"range":{"start_line":196,"start_character":2,"end_line":196,"end_character":16},"updated":"2026-09-15 17:02:22.000000000","message":"I\u0027m strictly against failing early. `is_erased` is three-state and checking is done sector by sector. Ideally if you have one unreadable sector in the middle of a flash you may get an error and still get usable state of the rest of bank.\n\nUnfortunately most of (perhaps all) driver-\u003eerase_check backends fail early as well. We would need a reliable way to distinguish between errors giving some hope to continue correctly and unrecoverable fails. It\u0027s not easy when some targets returns either ERROR_OK or ERROR_FAIL.","commit_id":"847e3d3531024db3a2d7d5034a76510132588230"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"7b9fec37b02b404b321b13c1bb74c330a9da6cd5","unresolved":true,"context_lines":[{"line_number":193,"context_line":"\t\t\tTARGET_ADDR_FMT \" failed\","},{"line_number":194,"context_line":"\t\t\tCMD_ARGV[0],"},{"line_number":195,"context_line":"\t\t\tp-\u003ebase);"},{"line_number":196,"context_line":"\t\treturn retval;"},{"line_number":197,"context_line":"\t}"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"\tbool blank \u003d true;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"9845cbfc_8cbb4f55","line":196,"range":{"start_line":196,"start_character":2,"end_line":196,"end_character":16},"in_reply_to":"4a1b8d6e_57dea4d1","updated":"2026-09-15 18:47:07.000000000","message":"We seem to be mostly well aligned here. Read-protected sectors might be a reason why obtaining the erase state partially fails, and the `unknown` state makes sense in this case.\n\nThe only question is *when* we should fail early. In my opinion, `erase_check` should return an error (`ERROR_xxx`) if there is no chance that the erase state can be updated - for example, when the target is not halted. In other cases, such as when some sectors are not readable, it should return `ERROR_OK` and use the unknown state for those specific sectors.\nThe current messy solution becomes even more apparent if we had a new API. Imagine we have a function that directly returns the sector status but still uses `ERROR_xxx` as return values and we keep ignoring them.\n\nTherefore, I propose keeping this change and adapting the driver code accordingly.","commit_id":"847e3d3531024db3a2d7d5034a76510132588230"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"d3d35095b042d21c03bf57deda5874edf7c80ad7","unresolved":true,"context_lines":[{"line_number":193,"context_line":"\t\t\tTARGET_ADDR_FMT \" failed\","},{"line_number":194,"context_line":"\t\t\tCMD_ARGV[0],"},{"line_number":195,"context_line":"\t\t\tp-\u003ebase);"},{"line_number":196,"context_line":"\t\treturn retval;"},{"line_number":197,"context_line":"\t}"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"\tbool blank \u003d true;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"4c0872bd_2b7a351d","line":196,"range":{"start_line":196,"start_character":2,"end_line":196,"end_character":16},"in_reply_to":"4b41b4b6_d4858948","updated":"2026-09-16 07:12:10.000000000","message":"Nice, I think that\u0027s a good step forward.\n\nI don\u0027t check for successful checks, but always return `ERRROR_OK` if no fatal error, e.g, malloc, happened. I think it\u0027s not necessary but have no hard opinion on that.","commit_id":"847e3d3531024db3a2d7d5034a76510132588230"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"88a27370aaf181a041c3ea18af5e7f5d009d5cc7","unresolved":true,"context_lines":[{"line_number":193,"context_line":"\t\t\tTARGET_ADDR_FMT \" failed\","},{"line_number":194,"context_line":"\t\t\tCMD_ARGV[0],"},{"line_number":195,"context_line":"\t\t\tp-\u003ebase);"},{"line_number":196,"context_line":"\t\treturn retval;"},{"line_number":197,"context_line":"\t}"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"\tbool blank \u003d true;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"6fd5c54c_be757621","line":196,"range":{"start_line":196,"start_character":2,"end_line":196,"end_character":16},"in_reply_to":"4c0872bd_2b7a351d","updated":"2026-09-20 13:36:10.000000000","message":"spi drivers check:\ndw-spi.c - target algo over whole bank, probably no partial error possible.\nmrvlqspi.c, sh_qspi.c - stubs just `return ERROR_OK` - I\u0027ll fix.\nstmqspi.c - target algo over multiple sectors, fails on the first error.","commit_id":"847e3d3531024db3a2d7d5034a76510132588230"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"change_message_id":"a975875ec9445c192fbc025df37120cf72076450","unresolved":true,"context_lines":[{"line_number":193,"context_line":"\t\t\tTARGET_ADDR_FMT \" failed\","},{"line_number":194,"context_line":"\t\t\tCMD_ARGV[0],"},{"line_number":195,"context_line":"\t\t\tp-\u003ebase);"},{"line_number":196,"context_line":"\t\treturn retval;"},{"line_number":197,"context_line":"\t}"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"\tbool blank \u003d true;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"4b41b4b6_d4858948","line":196,"range":{"start_line":196,"start_character":2,"end_line":196,"end_character":16},"in_reply_to":"9845cbfc_8cbb4f55","updated":"2026-09-15 20:30:05.000000000","message":"Well it\u0027s also viable.\n`default_flash_blank_check()` looks compatible with your variant.\nWe just need to change `default_flash_mem_blank_check()` to return ERROR_OK if the checking loop was interrupted due to error and at least one block has been successfully checked. And then check all flash drivers implementing `erase_check` 😞\ndw-spi.c, kinetis.c, kinetis_ke.c, lpc2000.c, lpc2900.c, mrvlqspi.c, psoc5lp.c, \nsh_qspi.c, stmqspi.c, str9xpec.c, tms470.c, xcf.c, xmc1xxx.c\nHmm, more than I expected. And lot of mess. That\u0027s the reason why we never dropped `is_erased` from sectors.\nE.g. tms470 ends the loop when it encounters not erased sector and returns ERROR_FLASH_SECTOR_NOT_ERASED.\nxmc1xxx.c fails on the first error.\nlpc2000.c old crap with exit() call and fails on the first error.\nlpc2900.c fails on the first error.\n\nWow kinetis.c, kinetis_ke.c are ok - on sector wide errors set unknown and continue!\nstr9xpec.c and xcf.c also look good - no partial error possible.\npsoc5lp.c okay.\n\nI didn\u0027t check spi drivers.\n\nOkay, if you insist on keeping this change, please adjust `default_flash_mem_blank_check()`. Let\u0027s not bother with the flash drivers.","commit_id":"847e3d3531024db3a2d7d5034a76510132588230"}]}
