)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0f21be547418853a07ce00f5e953abc7fb7fcd00","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"61c680f8_af4805e4","updated":"2024-12-21 17:05:23.000000000","message":"Marc, the chip marking suggests some level of compatibility with STM32F4 series. I hope you carefully considered all pros and cons of making the separate driver. The code looks like Atery flash controller really diverged from STM32 original.","commit_id":"e28d512c240c64ba8b6395909a21197314ae1ebd"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"0eaf3a894940190ca5359324b094384560a7e2fa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"fbf81e75_9205db92","in_reply_to":"61c680f8_af4805e4","updated":"2025-01-12 21:43:23.000000000","message":"Yes, there are lot of differences in registers and features. Of course, one could try to reuse an existing stm32 flash driver, but at some point the code becomes too complicated to maintain and understand. We already have issues with devices that have a high level of compatibility, see https://review.openocd.org/c/openocd/+/8351.","commit_id":"e28d512c240c64ba8b6395909a21197314ae1ebd"},{"author":{"_account_id":1002374,"name":"ALTracer","username":"ALTracer"},"change_message_id":"cdf02f1b723cb8ad625c30f4f4b7dcf170debb91","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":7,"id":"6d724080_03978bcd","updated":"2025-02-08 07:59:22.000000000","message":"This PR presumably works in the simplest case for single-bank Arterytek devices. I\u0027ve tested it on a couple dual-bank chips because that\u0027s all I have in reach.\nWhere is internal watchdog feeding handled (when it\u0027s autostarted per option bytes) -- in C driver or in Tcl script (mmw for DEBUG_CTRL freeze)? It would interfere with flashloading.","commit_id":"07959b1fd19d885fa2564e002202dc26c8a274a6"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"d04a6de01a1528094ee0bd4aee5e34616196e082","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"f69e3d01_a7b52c1b","in_reply_to":"6d724080_03978bcd","updated":"2025-05-13 14:06:20.000000000","message":"Without flash loader the watchdog should not be a problem since the core is not running at all. For the flash loader this needs to be considered, thanks!","commit_id":"07959b1fd19d885fa2564e002202dc26c8a274a6"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"026065d431bffbc35768fabbf7c9debc096c4cd4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"34e18dba_ea13d735","updated":"2025-06-04 21:51:49.000000000","message":"@Tomas: any further comments? Otherwise this patch should be merged.","commit_id":"4093d55077b1fe847be32e4b5e903f5ecfaf4f75"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"57ec050cb2bc0d7203298e4b7385065e8b9396bd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"edcd3367_1074d962","updated":"2025-06-14 10:29:00.000000000","message":"Few comments, but the only strict required is the alphabetic order.\nI think I will add in the coding style about:\n- no new include files if only used by a single C file;\n- `static inline` only in include files.","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"7b66a1f1edce73b000e839b1da9f3763e17cd3f3","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"3a26d942_ffcdebe4","updated":"2025-06-14 13:45:26.000000000","message":"There is a WIP patch on the same driver\nhttps://review.openocd.org/c/openocd/+/6878\nIs there any interesting feature there, or a device part number not included here?","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"ed551e19923368ccf3e367dd28eeae89c0b603a0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"62bf9371_ae205105","in_reply_to":"3a26d942_ffcdebe4","updated":"2025-07-09 19:42:07.000000000","message":"No interesting feature, only a few additional devices. However, I cannot test them which is why I would not include them in this patch.","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"0fa91b9f925d7e7ca487eac33437d64c1ffb5a8f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"e5dbde85_26673cc6","updated":"2025-07-30 20:47:41.000000000","message":"@Antonio, @Tomas any open issues? Otherwise let\u0027s merge it finally.","commit_id":"a7c445a9a00c8e6ead4cf8b7c0ae1e3126c361eb"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"3d4eb7403793d54fcc6b6f0a43b9dc9dbdcaa37f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"5bd1ffa3_a1a545eb","updated":"2025-08-01 14:26:19.000000000","message":"Thanks","commit_id":"a7c445a9a00c8e6ead4cf8b7c0ae1e3126c361eb"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"ee19cabdfc52ba1029710c05d1aa011dce307e94","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"a363ae0b_ea8d6976","in_reply_to":"e5dbde85_26673cc6","updated":"2025-08-01 07:56:04.000000000","message":"Okay with me. Antonio?","commit_id":"a7c445a9a00c8e6ead4cf8b7c0ae1e3126c361eb"}],"src/flash/nor/artery.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0f21be547418853a07ce00f5e953abc7fb7fcd00","unresolved":true,"context_lines":[{"line_number":1197,"context_line":"\t\tif (!(status \u0026 FLASH_STS_OBF))"},{"line_number":1198,"context_line":"\t\t\tbreak;"},{"line_number":1199,"context_line":""},{"line_number":1200,"context_line":"\t\tif (!timeout--) {"},{"line_number":1201,"context_line":"\t\t\tLOG_ERROR(\"Timed out waiting for flash\");"},{"line_number":1202,"context_line":"\t\t\treturn ERROR_FAIL;"},{"line_number":1203,"context_line":"\t\t}"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"f2d53343_eacf59d8","line":1200,"range":{"start_line":1200,"start_character":7,"end_line":1200,"end_character":14},"updated":"2024-12-21 17:05:23.000000000","message":"Please use `timeval_ms()` to get reasonable precision. `target_read_u32()` could take 3 ms depending mainly on adapter connection.","commit_id":"be98b9f86a0f46bf299e342a435a96532169bf02"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"0eaf3a894940190ca5359324b094384560a7e2fa","unresolved":false,"context_lines":[{"line_number":1197,"context_line":"\t\tif (!(status \u0026 FLASH_STS_OBF))"},{"line_number":1198,"context_line":"\t\t\tbreak;"},{"line_number":1199,"context_line":""},{"line_number":1200,"context_line":"\t\tif (!timeout--) {"},{"line_number":1201,"context_line":"\t\t\tLOG_ERROR(\"Timed out waiting for flash\");"},{"line_number":1202,"context_line":"\t\t\treturn ERROR_FAIL;"},{"line_number":1203,"context_line":"\t\t}"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"75f953ef_49b0d68a","line":1200,"range":{"start_line":1200,"start_character":7,"end_line":1200,"end_character":14},"in_reply_to":"f2d53343_eacf59d8","updated":"2025-01-12 21:43:23.000000000","message":"Done","commit_id":"be98b9f86a0f46bf299e342a435a96532169bf02"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0f21be547418853a07ce00f5e953abc7fb7fcd00","unresolved":true,"context_lines":[{"line_number":1244,"context_line":"\t\t\tbreak;"},{"line_number":1245,"context_line":""},{"line_number":1246,"context_line":"\t\tif (!timeout--) {"},{"line_number":1247,"context_line":"\t\t\tLOG_ERROR(\"Timed out waiting for flash\");"},{"line_number":1248,"context_line":"\t\t\treturn ERROR_FAIL;"},{"line_number":1249,"context_line":"\t\t}"},{"line_number":1250,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"03ae18d0_f911b15c","line":1247,"range":{"start_line":1247,"start_character":36,"end_line":1247,"end_character":41},"updated":"2024-12-21 17:05:23.000000000","message":"Copy pasta?","commit_id":"be98b9f86a0f46bf299e342a435a96532169bf02"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"0eaf3a894940190ca5359324b094384560a7e2fa","unresolved":false,"context_lines":[{"line_number":1244,"context_line":"\t\t\tbreak;"},{"line_number":1245,"context_line":""},{"line_number":1246,"context_line":"\t\tif (!timeout--) {"},{"line_number":1247,"context_line":"\t\t\tLOG_ERROR(\"Timed out waiting for flash\");"},{"line_number":1248,"context_line":"\t\t\treturn ERROR_FAIL;"},{"line_number":1249,"context_line":"\t\t}"},{"line_number":1250,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"f6429e9a_bae652e0","line":1247,"range":{"start_line":1247,"start_character":36,"end_line":1247,"end_character":41},"in_reply_to":"03ae18d0_f911b15c","updated":"2025-01-12 21:43:23.000000000","message":"Done","commit_id":"be98b9f86a0f46bf299e342a435a96532169bf02"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0f21be547418853a07ce00f5e953abc7fb7fcd00","unresolved":true,"context_lines":[{"line_number":1973,"context_line":"\t\t */"},{"line_number":1974,"context_line":"\t\tif ((offset \u003c (sector-\u003eoffset + sector-\u003esize)) \u0026\u0026"},{"line_number":1975,"context_line":"\t\t\t(offset + count - 1) \u003e\u003d sector-\u003eoffset) {"},{"line_number":1976,"context_line":"\t\t\treturn ERROR_FLASH_PROTECTED;"},{"line_number":1977,"context_line":"\t\t}"},{"line_number":1978,"context_line":"\t}"},{"line_number":1979,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"5c0c0de5_34ac096f","line":1976,"updated":"2024-12-21 17:05:23.000000000","message":"Why the protection needs an extra check by the flash driver?\nWould the flash controller do something nasty if the protection were violated?\nAlso the protection information is not necessarily valid in time of write.","commit_id":"be98b9f86a0f46bf299e342a435a96532169bf02"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"0eaf3a894940190ca5359324b094384560a7e2fa","unresolved":false,"context_lines":[{"line_number":1973,"context_line":"\t\t */"},{"line_number":1974,"context_line":"\t\tif ((offset \u003c (sector-\u003eoffset + sector-\u003esize)) \u0026\u0026"},{"line_number":1975,"context_line":"\t\t\t(offset + count - 1) \u003e\u003d sector-\u003eoffset) {"},{"line_number":1976,"context_line":"\t\t\treturn ERROR_FLASH_PROTECTED;"},{"line_number":1977,"context_line":"\t\t}"},{"line_number":1978,"context_line":"\t}"},{"line_number":1979,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"6ff69465_c642e38c","line":1976,"in_reply_to":"5c0c0de5_34ac096f","updated":"2025-01-12 21:43:23.000000000","message":"Done","commit_id":"be98b9f86a0f46bf299e342a435a96532169bf02"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0f21be547418853a07ce00f5e953abc7fb7fcd00","unresolved":true,"context_lines":[{"line_number":1446,"context_line":"\tconst uint32_t page_size \u003d part_info-\u003epage_size;"},{"line_number":1447,"context_line":""},{"line_number":1448,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c bank-\u003enum_prot_blocks; i++) {"},{"line_number":1449,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1450,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1451,"context_line":""},{"line_number":1452,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"2c8383c1_d214e708","line":1449,"range":{"start_line":1449,"start_character":2,"end_line":1449,"end_character":7},"updated":"2024-12-21 17:05:23.000000000","message":"😞\nhttps://review.openocd.org/c/openocd/+/6319/comment/6c45e326_a5f9192e/","commit_id":"e28d512c240c64ba8b6395909a21197314ae1ebd"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"0eaf3a894940190ca5359324b094384560a7e2fa","unresolved":false,"context_lines":[{"line_number":1446,"context_line":"\tconst uint32_t page_size \u003d part_info-\u003epage_size;"},{"line_number":1447,"context_line":""},{"line_number":1448,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c bank-\u003enum_prot_blocks; i++) {"},{"line_number":1449,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1450,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1451,"context_line":""},{"line_number":1452,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"ab053a01_5fe99f4f","line":1449,"range":{"start_line":1449,"start_character":2,"end_line":1449,"end_character":7},"in_reply_to":"2c8383c1_d214e708","updated":"2025-01-12 21:43:23.000000000","message":"I\u0027m not going to change existing code to be \"const-correct\" but use it in newly written code where appropriate. One can make similar (counter-)examples with global or scoped variables ;)","commit_id":"e28d512c240c64ba8b6395909a21197314ae1ebd"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"576018d5267ba91c1954a3c8af9b4aab680d02c9","unresolved":true,"context_lines":[{"line_number":1449,"context_line":"\tconst uint32_t page_size \u003d part_info-\u003epage_size;"},{"line_number":1450,"context_line":""},{"line_number":1451,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c bank-\u003enum_prot_blocks; i++) {"},{"line_number":1452,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1453,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"99afc7fc_e99c1021","line":1452,"range":{"start_line":1452,"start_character":35,"end_line":1452,"end_character":36},"updated":"2025-01-14 15:34:33.000000000","message":"UINT64_C(1) ? Without it I suspect it will not work on 32-bit host for i \u003e\u003d 32.\nPlease check all bit shifts, some could be replaced by `BIT()`\nMaybe a new `BIT_U64()` could be introduced.","commit_id":"ca7e171a9bcf8d02fc6a71bdf267311c65eaf331"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"13dba413f6f6e5286af0c2eabacbdd50b93206b1","unresolved":false,"context_lines":[{"line_number":1449,"context_line":"\tconst uint32_t page_size \u003d part_info-\u003epage_size;"},{"line_number":1450,"context_line":""},{"line_number":1451,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c bank-\u003enum_prot_blocks; i++) {"},{"line_number":1452,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1453,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"3fca1ba2_0b8842c7","line":1452,"range":{"start_line":1452,"start_character":35,"end_line":1452,"end_character":36},"in_reply_to":"99afc7fc_e99c1021","updated":"2025-01-30 21:59:55.000000000","message":"Done","commit_id":"ca7e171a9bcf8d02fc6a71bdf267311c65eaf331"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"576018d5267ba91c1954a3c8af9b4aab680d02c9","unresolved":true,"context_lines":[{"line_number":1450,"context_line":""},{"line_number":1451,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c bank-\u003enum_prot_blocks; i++) {"},{"line_number":1452,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1453,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"},{"line_number":1456,"context_line":"\t\tconst unsigned int sector_offset \u003d bank-\u003eprot_blocks[i].offset / page_size;"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"8ffde8e5_2d00da98","line":1453,"range":{"start_line":1453,"start_character":36,"end_line":1453,"end_character":37},"updated":"2025-01-14 15:34:33.000000000","message":"bool is assigned to int (I know it works)","commit_id":"ca7e171a9bcf8d02fc6a71bdf267311c65eaf331"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"13dba413f6f6e5286af0c2eabacbdd50b93206b1","unresolved":false,"context_lines":[{"line_number":1450,"context_line":""},{"line_number":1451,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c bank-\u003enum_prot_blocks; i++) {"},{"line_number":1452,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1453,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"},{"line_number":1456,"context_line":"\t\tconst unsigned int sector_offset \u003d bank-\u003eprot_blocks[i].offset / page_size;"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"a1ea7e65_22021545","line":1453,"range":{"start_line":1453,"start_character":36,"end_line":1453,"end_character":37},"in_reply_to":"8ffde8e5_2d00da98","updated":"2025-01-30 21:59:55.000000000","message":"Done","commit_id":"ca7e171a9bcf8d02fc6a71bdf267311c65eaf331"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"576018d5267ba91c1954a3c8af9b4aab680d02c9","unresolved":true,"context_lines":[{"line_number":1452,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1453,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"},{"line_number":1456,"context_line":"\t\tconst unsigned int sector_offset \u003d bank-\u003eprot_blocks[i].offset / page_size;"},{"line_number":1457,"context_line":""},{"line_number":1458,"context_line":"\t\tfor (unsigned int j \u003d 0; j \u003c num_sectors; j++)"},{"line_number":1459,"context_line":"\t\t\tbank-\u003esectors[sector_offset + j].is_protected \u003d protected;"},{"line_number":1460,"context_line":"\t}"},{"line_number":1461,"context_line":""},{"line_number":1462,"context_line":"\treturn ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"21af2217_1ced6c13","line":1459,"range":{"start_line":1455,"start_character":1,"end_line":1459,"end_character":61},"updated":"2025-01-14 15:34:33.000000000","message":"Useless now?","commit_id":"ca7e171a9bcf8d02fc6a71bdf267311c65eaf331"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"13dba413f6f6e5286af0c2eabacbdd50b93206b1","unresolved":false,"context_lines":[{"line_number":1452,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1453,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"},{"line_number":1456,"context_line":"\t\tconst unsigned int sector_offset \u003d bank-\u003eprot_blocks[i].offset / page_size;"},{"line_number":1457,"context_line":""},{"line_number":1458,"context_line":"\t\tfor (unsigned int j \u003d 0; j \u003c num_sectors; j++)"},{"line_number":1459,"context_line":"\t\t\tbank-\u003esectors[sector_offset + j].is_protected \u003d protected;"},{"line_number":1460,"context_line":"\t}"},{"line_number":1461,"context_line":""},{"line_number":1462,"context_line":"\treturn ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"26f1a674_3cf453fe","line":1459,"range":{"start_line":1455,"start_character":1,"end_line":1459,"end_character":61},"in_reply_to":"21af2217_1ced6c13","updated":"2025-01-30 21:59:55.000000000","message":"No, it provides the user information about the protected sectors. Quite useful to double check if the intended sectors are really protected.","commit_id":"ca7e171a9bcf8d02fc6a71bdf267311c65eaf331"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"fe1d39ceccc469abb43473ff232cdacfad911f47","unresolved":true,"context_lines":[{"line_number":1452,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1453,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"},{"line_number":1456,"context_line":"\t\tconst unsigned int sector_offset \u003d bank-\u003eprot_blocks[i].offset / page_size;"},{"line_number":1457,"context_line":""},{"line_number":1458,"context_line":"\t\tfor (unsigned int j \u003d 0; j \u003c num_sectors; j++)"},{"line_number":1459,"context_line":"\t\t\tbank-\u003esectors[sector_offset + j].is_protected \u003d protected;"},{"line_number":1460,"context_line":"\t}"},{"line_number":1461,"context_line":""},{"line_number":1462,"context_line":"\treturn ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"985d84b1_3096b48c","line":1459,"range":{"start_line":1455,"start_character":1,"end_line":1459,"end_character":61},"in_reply_to":"26f1a674_3cf453fe","updated":"2025-01-31 02:35:58.000000000","message":"You\u0027re right that `flash info x sectors` does not show valid protection info if `prot_blocks` are used. Please do not workaround the problem in the driver code (IIRC other drivers with `prot_blocks` do not transform the protection info to sectors). This transformation seems me generally usable (and useful) so it should go to the flash infrastructure:\nhttps://review.openocd.org/c/openocd/+/8667/6..7/src/flash/nor/tcl.c#113","commit_id":"ca7e171a9bcf8d02fc6a71bdf267311c65eaf331"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"d04a6de01a1528094ee0bd4aee5e34616196e082","unresolved":false,"context_lines":[{"line_number":1452,"context_line":"\t\tconst bool protected \u003d !(prot \u0026 (1 \u003c\u003c i));"},{"line_number":1453,"context_line":"\t\tbank-\u003eprot_blocks[i].is_protected \u003d protected;"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"\t\tconst unsigned int num_sectors \u003d bank-\u003eprot_blocks[i].size / page_size;"},{"line_number":1456,"context_line":"\t\tconst unsigned int sector_offset \u003d bank-\u003eprot_blocks[i].offset / page_size;"},{"line_number":1457,"context_line":""},{"line_number":1458,"context_line":"\t\tfor (unsigned int j \u003d 0; j \u003c num_sectors; j++)"},{"line_number":1459,"context_line":"\t\t\tbank-\u003esectors[sector_offset + j].is_protected \u003d protected;"},{"line_number":1460,"context_line":"\t}"},{"line_number":1461,"context_line":""},{"line_number":1462,"context_line":"\treturn ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"757b4197_8fb07cc0","line":1459,"range":{"start_line":1455,"start_character":1,"end_line":1459,"end_character":61},"in_reply_to":"985d84b1_3096b48c","updated":"2025-05-13 14:06:20.000000000","message":"Okay, this needs to be addressed in a separate patch.","commit_id":"ca7e171a9bcf8d02fc6a71bdf267311c65eaf331"},{"author":{"_account_id":1002374,"name":"ALTracer","username":"ALTracer"},"change_message_id":"cdf02f1b723cb8ad625c30f4f4b7dcf170debb91","unresolved":true,"context_lines":[{"line_number":251,"context_line":"\t    .usd_size \u003d 48,"},{"line_number":252,"context_line":"\t    .usd_data_size \u003d 8,"},{"line_number":253,"context_line":"\t},"},{"line_number":254,"context_line":"\t{"},{"line_number":255,"context_line":"\t    .pid \u003d 0x700502d0,"},{"line_number":256,"context_line":"\t    .name \u003d \"AT32F403ACEU7\","},{"line_number":257,"context_line":"\t    .series \u003d ARTERY_SERIES_F403A_F407,"},{"line_number":258,"context_line":"\t    .flash_size \u003d 512,"},{"line_number":259,"context_line":"\t    .page_size \u003d 2048,"},{"line_number":260,"context_line":"\t    .usd_size \u003d 48,"},{"line_number":261,"context_line":"\t    .usd_data_size \u003d 8,"},{"line_number":262,"context_line":"\t},"},{"line_number":263,"context_line":"\t{"},{"line_number":264,"context_line":"\t    .pid \u003d 0x700502d1,"},{"line_number":265,"context_line":"\t    .name \u003d \"AT32F407VET7\","}],"source_content_type":"text/x-csrc","patch_set":7,"id":"932c840b_6fc33bc6","line":262,"range":{"start_line":254,"start_character":1,"end_line":262,"end_character":3},"updated":"2025-02-08 07:59:22.000000000","message":"Even though dual-bank support is out of scope of this PR, I had to add 0x70050347 AT32F403ACGU7 entry to test its first 512 KiB bank on a ubiquitous WeActStudio.BlackPill board I have. It works. Please consider adding 15 more entries for similar chips since you submit a thousand line table anyways, first bank is plenty for some programs. Ditto for 4032 KiB AT32F437ZMT7, first bank is 2048 KiB.","commit_id":"07959b1fd19d885fa2564e002202dc26c8a274a6"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"d04a6de01a1528094ee0bd4aee5e34616196e082","unresolved":false,"context_lines":[{"line_number":251,"context_line":"\t    .usd_size \u003d 48,"},{"line_number":252,"context_line":"\t    .usd_data_size \u003d 8,"},{"line_number":253,"context_line":"\t},"},{"line_number":254,"context_line":"\t{"},{"line_number":255,"context_line":"\t    .pid \u003d 0x700502d0,"},{"line_number":256,"context_line":"\t    .name \u003d \"AT32F403ACEU7\","},{"line_number":257,"context_line":"\t    .series \u003d ARTERY_SERIES_F403A_F407,"},{"line_number":258,"context_line":"\t    .flash_size \u003d 512,"},{"line_number":259,"context_line":"\t    .page_size \u003d 2048,"},{"line_number":260,"context_line":"\t    .usd_size \u003d 48,"},{"line_number":261,"context_line":"\t    .usd_data_size \u003d 8,"},{"line_number":262,"context_line":"\t},"},{"line_number":263,"context_line":"\t{"},{"line_number":264,"context_line":"\t    .pid \u003d 0x700502d1,"},{"line_number":265,"context_line":"\t    .name \u003d \"AT32F407VET7\","}],"source_content_type":"text/x-csrc","patch_set":7,"id":"40cf4154_600169c0","line":262,"range":{"start_line":254,"start_character":1,"end_line":262,"end_character":3},"in_reply_to":"932c840b_6fc33bc6","updated":"2025-05-13 14:06:20.000000000","message":"Dual-bank devices are not supported, as mentioned in the commit message.","commit_id":"07959b1fd19d885fa2564e002202dc26c8a274a6"},{"author":{"_account_id":1002374,"name":"ALTracer","username":"ALTracer"},"change_message_id":"cdf02f1b723cb8ad625c30f4f4b7dcf170debb91","unresolved":true,"context_lines":[{"line_number":2060,"context_line":"\t\t}"},{"line_number":2061,"context_line":"\t}"},{"line_number":2062,"context_line":""},{"line_number":2063,"context_line":"\tif (!artery_info-\u003epart_info) {"},{"line_number":2064,"context_line":"\t\tLOG_ERROR(\"Cannot identify target as an Artery device\");"},{"line_number":2065,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":2066,"context_line":"\t}"},{"line_number":2067,"context_line":""},{"line_number":2068,"context_line":"\tconst struct artery_part_info *part_info \u003d artery_info-\u003epart_info;"},{"line_number":2069,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"c93800d4_7bd62679","line":2066,"range":{"start_line":2063,"start_character":1,"end_line":2066,"end_character":2},"updated":"2025-02-08 07:59:22.000000000","message":"This triggered an error on gdb attach attempt to a dual-bank device missing from LUT. Please consider printing (initialized) device_series and pid (like 0x70050347) so that it\u0027s made more obvious which PID to register in tables for potential support. These can be missing from refmans (or no refmans exist altogether, like older 200 MHz AT32F403).","commit_id":"07959b1fd19d885fa2564e002202dc26c8a274a6"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"d04a6de01a1528094ee0bd4aee5e34616196e082","unresolved":false,"context_lines":[{"line_number":2060,"context_line":"\t\t}"},{"line_number":2061,"context_line":"\t}"},{"line_number":2062,"context_line":""},{"line_number":2063,"context_line":"\tif (!artery_info-\u003epart_info) {"},{"line_number":2064,"context_line":"\t\tLOG_ERROR(\"Cannot identify target as an Artery device\");"},{"line_number":2065,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":2066,"context_line":"\t}"},{"line_number":2067,"context_line":""},{"line_number":2068,"context_line":"\tconst struct artery_part_info *part_info \u003d artery_info-\u003epart_info;"},{"line_number":2069,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"d66137f9_0bd916b4","line":2066,"range":{"start_line":2063,"start_character":1,"end_line":2066,"end_character":2},"in_reply_to":"c93800d4_7bd62679","updated":"2025-05-13 14:06:20.000000000","message":"Printing PID has no benefit for end users, only for developers. The latter should be able to read out the PID.","commit_id":"07959b1fd19d885fa2564e002202dc26c8a274a6"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"30fc24c47f400fd1ffb2b6148cf658760da34d84","unresolved":true,"context_lines":[{"line_number":1966,"context_line":"\t\t */"},{"line_number":1967,"context_line":"\t\tif ((offset \u003c (sector-\u003eoffset + sector-\u003esize)) \u0026\u0026"},{"line_number":1968,"context_line":"\t\t\t(offset + count - 1) \u003e\u003d sector-\u003eoffset) {"},{"line_number":1969,"context_line":"\t\t\treturn ERROR_FLASH_PROTECTED;"},{"line_number":1970,"context_line":"\t\t}"},{"line_number":1971,"context_line":"\t}"},{"line_number":1972,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":8,"id":"c062c5d7_4a34a45c","line":1969,"updated":"2025-06-05 04:57:16.000000000","message":"Why the flash driver checks the protection on behalf of MCU?\nDoing so prevents simple testing of hw protection.\nBTW erase does not check it.","commit_id":"4093d55077b1fe847be32e4b5e903f5ecfaf4f75"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"f5d649bdbf95187cb568feb06df708e0fb6caf40","unresolved":false,"context_lines":[{"line_number":1966,"context_line":"\t\t */"},{"line_number":1967,"context_line":"\t\tif ((offset \u003c (sector-\u003eoffset + sector-\u003esize)) \u0026\u0026"},{"line_number":1968,"context_line":"\t\t\t(offset + count - 1) \u003e\u003d sector-\u003eoffset) {"},{"line_number":1969,"context_line":"\t\t\treturn ERROR_FLASH_PROTECTED;"},{"line_number":1970,"context_line":"\t\t}"},{"line_number":1971,"context_line":"\t}"},{"line_number":1972,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":8,"id":"b629cea9_257b8ad8","line":1969,"in_reply_to":"091731d1_235f6986","updated":"2025-06-14 08:50:37.000000000","message":"I understand, but what is the scenario? Is your assumption that the flash driver might not work or are you talking about driver development? In case of the latter, I do the same with the protection check commented out. If we assume that the flash driver has no bug, the approach you describe is not necessary, right? The protection boundaries can be checked by the user with `flash info`.","commit_id":"4093d55077b1fe847be32e4b5e903f5ecfaf4f75"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"b23c35f18a800dded5e113e02402665126a98893","unresolved":false,"context_lines":[{"line_number":1966,"context_line":"\t\t */"},{"line_number":1967,"context_line":"\t\tif ((offset \u003c (sector-\u003eoffset + sector-\u003esize)) \u0026\u0026"},{"line_number":1968,"context_line":"\t\t\t(offset + count - 1) \u003e\u003d sector-\u003eoffset) {"},{"line_number":1969,"context_line":"\t\t\treturn ERROR_FLASH_PROTECTED;"},{"line_number":1970,"context_line":"\t\t}"},{"line_number":1971,"context_line":"\t}"},{"line_number":1972,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":8,"id":"091731d1_235f6986","line":1969,"in_reply_to":"53aedf5f_01242848","updated":"2025-06-14 02:08:50.000000000","message":"I have no objection against informing user nicely. However if the flash driver implements protection checking, how one can test whether the protection set in hw really works, especially whether the protection is not misplaced?\nI usually protect a random block and try some erases/writes next to the block and inside of it. If the flash driver checks before issuing erase/write to hw, such test could be falsely positive.","commit_id":"4093d55077b1fe847be32e4b5e903f5ecfaf4f75"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"257854848b6cee99f73641a99606de1f4d3b62d3","unresolved":false,"context_lines":[{"line_number":1966,"context_line":"\t\t */"},{"line_number":1967,"context_line":"\t\tif ((offset \u003c (sector-\u003eoffset + sector-\u003esize)) \u0026\u0026"},{"line_number":1968,"context_line":"\t\t\t(offset + count - 1) \u003e\u003d sector-\u003eoffset) {"},{"line_number":1969,"context_line":"\t\t\treturn ERROR_FLASH_PROTECTED;"},{"line_number":1970,"context_line":"\t\t}"},{"line_number":1971,"context_line":"\t}"},{"line_number":1972,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":8,"id":"53aedf5f_01242848","line":1969,"in_reply_to":"c062c5d7_4a34a45c","updated":"2025-06-13 09:10:31.000000000","message":"Since you asked me to (re)move the protection state sync between `prot_sectors` and `sectors` this information is not valid anymore anyway.\n\nHowever, can you explain why you prefer *not* to check the protection state before a flash write operation and inform the user nicely about the fact? What is the advantage of not checking? (Let\u0027s assume the flash framework reads the protection state correctly)","commit_id":"4093d55077b1fe847be32e4b5e903f5ecfaf4f75"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"57ec050cb2bc0d7203298e4b7385065e8b9396bd","unresolved":true,"context_lines":[{"line_number":13,"context_line":"#include \u003chelper/binarybuffer.h\u003e"},{"line_number":14,"context_line":"#include \u003chelper/time_support.h\u003e"},{"line_number":15,"context_line":"#include \u003chelper/bits.h\u003e"},{"line_number":16,"context_line":"#include \u003ctarget/algorithm.h\u003e"},{"line_number":17,"context_line":"#include \u003ctarget/cortex_m.h\u003e"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"#include \"artery.h\""}],"source_content_type":"text/x-csrc","patch_set":9,"id":"b253bc2c_b91cdc0b","line":16,"updated":"2025-06-14 10:29:00.000000000","message":"not used, yet","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"58bd2bd38ae04cf4546d3e28195c12469993a166","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#include \u003chelper/binarybuffer.h\u003e"},{"line_number":14,"context_line":"#include \u003chelper/time_support.h\u003e"},{"line_number":15,"context_line":"#include \u003chelper/bits.h\u003e"},{"line_number":16,"context_line":"#include \u003ctarget/algorithm.h\u003e"},{"line_number":17,"context_line":"#include \u003ctarget/cortex_m.h\u003e"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"#include \"artery.h\""}],"source_content_type":"text/x-csrc","patch_set":9,"id":"e715c22a_963543d1","line":16,"in_reply_to":"b253bc2c_b91cdc0b","updated":"2025-07-09 19:40:52.000000000","message":"Done","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"57ec050cb2bc0d7203298e4b7385065e8b9396bd","unresolved":true,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"#include \"artery.h\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"#define FLASH_MASS_ERASE_TIMEOUT\t2400"},{"line_number":22,"context_line":"#define FLASH_ERASE_TIMEOUT\t\t\t500"},{"line_number":23,"context_line":"#define FLASH_WRITE_TIMEOUT\t\t\t5"},{"line_number":24,"context_line":"#define HICK_STABLE_TIMEOUT\t\t\t1000"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"87b4a51a_f6fd654d","line":21,"updated":"2025-06-14 10:29:00.000000000","message":"Adding `_MS` suffix makes this and following more readable","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"58bd2bd38ae04cf4546d3e28195c12469993a166","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"#include \"artery.h\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"#define FLASH_MASS_ERASE_TIMEOUT\t2400"},{"line_number":22,"context_line":"#define FLASH_ERASE_TIMEOUT\t\t\t500"},{"line_number":23,"context_line":"#define FLASH_WRITE_TIMEOUT\t\t\t5"},{"line_number":24,"context_line":"#define HICK_STABLE_TIMEOUT\t\t\t1000"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"b223422f_67403779","line":21,"in_reply_to":"87b4a51a_f6fd654d","updated":"2025-07-09 19:40:52.000000000","message":"I prefer not to have units in variable / macro names. I added a comment.","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"57ec050cb2bc0d7203298e4b7385065e8b9396bd","unresolved":true,"context_lines":[{"line_number":1163,"context_line":"\treturn ERROR_OK;"},{"line_number":1164,"context_line":"}"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"static inline int artery_read_flash_register(struct flash_bank *bank,"},{"line_number":1167,"context_line":"\t\tenum artery_flash_reg_index reg, uint32_t *value)"},{"line_number":1168,"context_line":"{"},{"line_number":1169,"context_line":"\tconst struct artery_flash_bank *artery_info \u003d bank-\u003edriver_priv;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"314e5cd6_0867904e","line":1166,"updated":"2025-06-14 10:29:00.000000000","message":"functions should be declared as `static inline` only if they are declared in an include file.\nIn a C file it\u0027s preferred to let the compiler to decide based on optimization options.","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"58bd2bd38ae04cf4546d3e28195c12469993a166","unresolved":false,"context_lines":[{"line_number":1163,"context_line":"\treturn ERROR_OK;"},{"line_number":1164,"context_line":"}"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"static inline int artery_read_flash_register(struct flash_bank *bank,"},{"line_number":1167,"context_line":"\t\tenum artery_flash_reg_index reg, uint32_t *value)"},{"line_number":1168,"context_line":"{"},{"line_number":1169,"context_line":"\tconst struct artery_flash_bank *artery_info \u003d bank-\u003edriver_priv;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"6ed2df21_87edba9c","line":1166,"in_reply_to":"314e5cd6_0867904e","updated":"2025-07-09 19:40:52.000000000","message":"Done","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"57ec050cb2bc0d7203298e4b7385065e8b9396bd","unresolved":true,"context_lines":[{"line_number":1169,"context_line":"\tconst struct artery_flash_bank *artery_info \u003d bank-\u003edriver_priv;"},{"line_number":1170,"context_line":"\tconst struct artery_part_info *part_info \u003d artery_info-\u003epart_info;"},{"line_number":1171,"context_line":"\tconst struct artery_series_info *series_info \u003d \u0026artery_series[part_info-\u003eseries];"},{"line_number":1172,"context_line":"\tconst uint32_t reg_addr \u003d series_info-\u003eflash_regs_base + series_info-\u003eflash_regs[reg];"},{"line_number":1173,"context_line":""},{"line_number":1174,"context_line":"\treturn target_read_u32(bank-\u003etarget, reg_addr, value);"},{"line_number":1175,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"a7d0d731_2418f55f","line":1172,"updated":"2025-06-14 10:29:00.000000000","message":"Using `const` on `struct *` or on arrays is welcome.\nBut I find strange using it on local variables; it triggers attention as it looks put on purpose to highlight some special situation. If you want it every time, why not also to `retval` in `artery_wait_flash_busy()`? Or having several `const` variables `ret_1`, `ret_2` in `artery_enable_hiclk()`?","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"58bd2bd38ae04cf4546d3e28195c12469993a166","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"\tconst struct artery_flash_bank *artery_info \u003d bank-\u003edriver_priv;"},{"line_number":1170,"context_line":"\tconst struct artery_part_info *part_info \u003d artery_info-\u003epart_info;"},{"line_number":1171,"context_line":"\tconst struct artery_series_info *series_info \u003d \u0026artery_series[part_info-\u003eseries];"},{"line_number":1172,"context_line":"\tconst uint32_t reg_addr \u003d series_info-\u003eflash_regs_base + series_info-\u003eflash_regs[reg];"},{"line_number":1173,"context_line":""},{"line_number":1174,"context_line":"\treturn target_read_u32(bank-\u003etarget, reg_addr, value);"},{"line_number":1175,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"c6ec25aa_8043fb06","line":1172,"in_reply_to":"a7d0d731_2418f55f","updated":"2025-07-09 19:40:52.000000000","message":"This is a hot topic :D You\u0027re right, in this case it\u0027s probably overkill. In more complex code I prefix to have `const` to indicate that this variable is not intended to be changed. True, as you have already shown, it is a narrow ridge and cannot be applied for all variables without generating more complexity / confusion. I have no strong opinion here.","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"}],"src/flash/nor/artery.h":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"57ec050cb2bc0d7203298e4b7385065e8b9396bd","unresolved":true,"context_lines":[{"line_number":1,"context_line":"/* SPDX-License-Identifier: GPL-2.0-or-later */"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"/*"},{"line_number":4,"context_line":" * Copyright (C) 2023 by Marc Schink \u003cdev@zapb.de\u003e"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"d56ca570_3b1836ac","line":1,"updated":"2025-06-14 10:29:00.000000000","message":"I\u0027m not in favor of having include files that are included by a single C file and I plan to drop some of them, as I have done with https://review.openocd.org/c/openocd/+/8856\nIf macros and declarations are needed only in one place, they should be moved there.\nI expect some of the info here could be reused by the flash loader, once available. The file should eventually be added in that context and limited to the shared info.","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"58bd2bd38ae04cf4546d3e28195c12469993a166","unresolved":false,"context_lines":[{"line_number":1,"context_line":"/* SPDX-License-Identifier: GPL-2.0-or-later */"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"/*"},{"line_number":4,"context_line":" * Copyright (C) 2023 by Marc Schink \u003cdev@zapb.de\u003e"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"e86cc77c_3ad0504b","line":1,"in_reply_to":"d56ca570_3b1836ac","updated":"2025-07-09 19:40:52.000000000","message":"I think we discussed it on IRC at some day. The reason is that the follow-up flash loader patch needs some of the macros in the include file.","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"3d4eb7403793d54fcc6b6f0a43b9dc9dbdcaa37f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"/* SPDX-License-Identifier: GPL-2.0-or-later */"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"/*"},{"line_number":4,"context_line":" * Copyright (C) 2023 by Marc Schink \u003cdev@zapb.de\u003e"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"b7f13bc7_7cff6504","line":1,"in_reply_to":"e86cc77c_3ad0504b","updated":"2025-08-01 14:26:19.000000000","message":"Ok!","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"}],"src/flash/nor/drivers.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"57ec050cb2bc0d7203298e4b7385065e8b9396bd","unresolved":true,"context_lines":[{"line_number":25,"context_line":"\t\u0026ath79_flash,"},{"line_number":26,"context_line":"\t\u0026atsame5_flash,"},{"line_number":27,"context_line":"\t\u0026atsamv_flash,"},{"line_number":28,"context_line":"\t\u0026artery_flash,"},{"line_number":29,"context_line":"\t\u0026avr_flash,"},{"line_number":30,"context_line":"\t\u0026bluenrgx_flash,"},{"line_number":31,"context_line":"\t\u0026cc3220sf_flash,"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"028f2bb1_5b97e423","line":28,"updated":"2025-06-14 10:29:00.000000000","message":"please keep the entries sorted","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"58bd2bd38ae04cf4546d3e28195c12469993a166","unresolved":false,"context_lines":[{"line_number":25,"context_line":"\t\u0026ath79_flash,"},{"line_number":26,"context_line":"\t\u0026atsame5_flash,"},{"line_number":27,"context_line":"\t\u0026atsamv_flash,"},{"line_number":28,"context_line":"\t\u0026artery_flash,"},{"line_number":29,"context_line":"\t\u0026avr_flash,"},{"line_number":30,"context_line":"\t\u0026bluenrgx_flash,"},{"line_number":31,"context_line":"\t\u0026cc3220sf_flash,"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"f608ffc2_1d0954a8","line":28,"in_reply_to":"028f2bb1_5b97e423","updated":"2025-07-09 19:40:52.000000000","message":"Done","commit_id":"f39c0294d78753c1bc920242ee029aac5db6ed68"}]}
