)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"e252d921a361451c1d7ec2a68d0db162a7dffddf","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"75ebea93_a51c7d0f","updated":"2025-10-25 13:59:24.000000000","message":"I think you forgot about the ugly HLA.","commit_id":"d5a18362acc63f2c4cf9fb475ab97dbe12c07ec8"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a6b8c4034239692a4ac17b8d48aeac270cdb89dd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"f3c74d92_c874e678","in_reply_to":"09890d1b_42f37f6a","updated":"2025-11-03 10:28:10.000000000","message":"Shit! forgot completely, too!\nPlease check https://review.openocd.org/c/openocd/+/9202","commit_id":"d5a18362acc63f2c4cf9fb475ab97dbe12c07ec8"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"5d3072cdb15708a13f0fe4fe1bbfa6379023bf05","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"09890d1b_42f37f6a","in_reply_to":"75ebea93_a51c7d0f","updated":"2025-10-31 16:55:34.000000000","message":"Indeed, I forgot completely.\nBut I\u0027m not alone. After fixing hla examine I get segmentation fault, guess where :)\n```\n(gdb) bt\n#0  mem_ap_read_u32 (ap\u003d0x0, address\u003d3758157176, value\u003d0x7fffffffed04)\n    at ../src/target/arm_adi_v5.c:253\n#1  0x0000555555795aa8 in armv7m_identify_cache (\n    target\u003dtarget@entry\u003d0x5555559c2c20) at ../src/target/armv7m_cache.c:77\n#2  0x0000555555710d68 in cortex_m_examine (target\u003d0x5555559c2c20)\n    at ../src/target/cortex_m.c:2976\n```\n\nNot sure if you didn\u0027t change it after my advice :) :)","commit_id":"d5a18362acc63f2c4cf9fb475ab97dbe12c07ec8"}],"src/target/cortex_m.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"e252d921a361451c1d7ec2a68d0db162a7dffddf","unresolved":true,"context_lines":[{"line_number":2757,"context_line":""},{"line_number":2758,"context_line":"\t/* hla_target shares the examine handler but does not support"},{"line_number":2759,"context_line":"\t * all its calls */"},{"line_number":2760,"context_line":"\tif (!armv7m-\u003eis_hla_target) {"},{"line_number":2761,"context_line":"\t\tif (!armv7m-\u003edebug_ap) {"},{"line_number":2762,"context_line":"\t\t\tif (cortex_m-\u003eapsel \u003d\u003d DP_APSEL_INVALID) {"},{"line_number":2763,"context_line":"\t\t\t\t/* Search for the MEM-AP */"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"b2b935ad_668da8cd","line":2760,"updated":"2025-10-25 13:59:24.000000000","message":"I get, with HLA\n```\nError: [stm32f4x.cpu] Memory not ready\nError: [stm32f4x.cpu] Examination failed\n```\n\nIn case of HLA, `armv7m-\u003edebug_ap` is never set!\nHLA doesn\u0027t have `.memory_ready` so relies on default fallback to `target_was_examined()`.\nBut dropping the call to `target_set_examined()` below ...\n\nI think we need another `.memory_ready` for HLA","commit_id":"d5a18362acc63f2c4cf9fb475ab97dbe12c07ec8"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a6b8c4034239692a4ac17b8d48aeac270cdb89dd","unresolved":false,"context_lines":[{"line_number":2757,"context_line":""},{"line_number":2758,"context_line":"\t/* hla_target shares the examine handler but does not support"},{"line_number":2759,"context_line":"\t * all its calls */"},{"line_number":2760,"context_line":"\tif (!armv7m-\u003eis_hla_target) {"},{"line_number":2761,"context_line":"\t\tif (!armv7m-\u003edebug_ap) {"},{"line_number":2762,"context_line":"\t\t\tif (cortex_m-\u003eapsel \u003d\u003d DP_APSEL_INVALID) {"},{"line_number":2763,"context_line":"\t\t\t\t/* Search for the MEM-AP */"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"5b22f198_1d28134e","line":2760,"in_reply_to":"b2b935ad_668da8cd","updated":"2025-11-03 10:28:10.000000000","message":"Done","commit_id":"d5a18362acc63f2c4cf9fb475ab97dbe12c07ec8"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"e252d921a361451c1d7ec2a68d0db162a7dffddf","unresolved":true,"context_lines":[{"line_number":2767,"context_line":"\t\t\t\t\treturn retval;"},{"line_number":2768,"context_line":"\t\t\t\t}"},{"line_number":2769,"context_line":"\t\t\t} else {"},{"line_number":2770,"context_line":"\t\t\t\tarmv7m-\u003edebug_ap \u003d dap_get_ap(swjdp, cortex_m-\u003eapsel);"},{"line_number":2771,"context_line":"\t\t\t\tif (!armv7m-\u003edebug_ap) {"},{"line_number":2772,"context_line":"\t\t\t\t\tLOG_TARGET_ERROR(target, \"Cannot get AP\");"},{"line_number":2773,"context_line":"\t\t\t\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"0c0633aa_2a7aa2e4","line":2770,"updated":"2025-10-25 13:59:24.000000000","message":"We set `armv7m-\u003edebug_ap` here or above at line 2764.\nBut we never drop it if we get an error accessing the AP during examine, meaning the memory is not really accessible.\nThis mechanism doesn\u0027t look too much reliable, at the end.\n\nThe ROM-table scan in line 2764 could take long time.\nI\u0027m not in favor to set `armv7m-\u003edebug_ap \u003d NULL` in case of error accessing the AP because a following `examine` will scan the ROM-table again!\nWhy not adding an independent flag\n` bool ap_memory_ready;`\nin the cortex-m private data that is set during the examine and clear if the memory access fails?\n\nThe same flag could be used by HLA.","commit_id":"d5a18362acc63f2c4cf9fb475ab97dbe12c07ec8"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"5d3072cdb15708a13f0fe4fe1bbfa6379023bf05","unresolved":true,"context_lines":[{"line_number":2767,"context_line":"\t\t\t\t\treturn retval;"},{"line_number":2768,"context_line":"\t\t\t\t}"},{"line_number":2769,"context_line":"\t\t\t} else {"},{"line_number":2770,"context_line":"\t\t\t\tarmv7m-\u003edebug_ap \u003d dap_get_ap(swjdp, cortex_m-\u003eapsel);"},{"line_number":2771,"context_line":"\t\t\t\tif (!armv7m-\u003edebug_ap) {"},{"line_number":2772,"context_line":"\t\t\t\t\tLOG_TARGET_ERROR(target, \"Cannot get AP\");"},{"line_number":2773,"context_line":"\t\t\t\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"ddc81e5c_01d0b644","line":2770,"in_reply_to":"0c0633aa_2a7aa2e4","updated":"2025-10-31 16:55:34.000000000","message":"That\u0027s why I named the method memory_ready. It is not mentioned to be a full-fledged is_accessible test with considering running, unavailable and whatever target states. As we need the memory r/w in examine, possibly in poll, reset, the more sophisticated test could bring a similar chicken-egg problem again.\nIn the case of communication error there is still chance that the connection will work again and the very AP we used before will work again.\nLet\u0027s return false just in case there is absolutely no chance, say we found no AP - and `mem_ap_read_u32()` would fault like above.\nDoes it make sense?","commit_id":"d5a18362acc63f2c4cf9fb475ab97dbe12c07ec8"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a6b8c4034239692a4ac17b8d48aeac270cdb89dd","unresolved":false,"context_lines":[{"line_number":2767,"context_line":"\t\t\t\t\treturn retval;"},{"line_number":2768,"context_line":"\t\t\t\t}"},{"line_number":2769,"context_line":"\t\t\t} else {"},{"line_number":2770,"context_line":"\t\t\t\tarmv7m-\u003edebug_ap \u003d dap_get_ap(swjdp, cortex_m-\u003eapsel);"},{"line_number":2771,"context_line":"\t\t\t\tif (!armv7m-\u003edebug_ap) {"},{"line_number":2772,"context_line":"\t\t\t\t\tLOG_TARGET_ERROR(target, \"Cannot get AP\");"},{"line_number":2773,"context_line":"\t\t\t\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"3ac0bb27_ec385912","line":2770,"in_reply_to":"ddc81e5c_01d0b644","updated":"2025-11-03 10:28:10.000000000","message":"It makes sense!","commit_id":"d5a18362acc63f2c4cf9fb475ab97dbe12c07ec8"}]}
