)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1002302,"name":"Henrik Mau","display_name":"Henrik Mau","email":"henrik.mau@analog.com","username":"hmauadi"},"change_message_id":"736b2f242ecf46a8ffbf9cec7f43247ce3af39b6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"47a91f8b_3a135f34","updated":"2025-08-01 10:00:17.000000000","message":"Thank you for the feedback.  We will test your suggested changes and follow up.","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a88de5548fea54c122909d8ee5cbd9998c487a60","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5c3d190b_3c8bc55a","updated":"2025-07-27 18:18:02.000000000","message":"Thanks for the patch.\nI would like to have more info on the issue you have with the reset on max32670, and I would like to get few words in a comment in the script so in the future we know how to handle this device.","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1002302,"name":"Henrik Mau","display_name":"Henrik Mau","email":"henrik.mau@analog.com","username":"hmauadi"},"change_message_id":"387025b59b830425e0694724260588b1b046f193","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"97663c39_fdfecd68","updated":"2025-06-30 12:25:37.000000000","message":"This relies on the changes in #8794 and #8976","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d71f02769a93c81a0abd9638071297c7654284e7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5751f202_5d6b7fe5","in_reply_to":"97663c39_fdfecd68","updated":"2025-08-17 13:30:26.000000000","message":"Ack","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1002302,"name":"Henrik Mau","display_name":"Henrik Mau","email":"henrik.mau@analog.com","username":"hmauadi"},"change_message_id":"10ceff59dba5758f214c21618d86f8d75f80e372","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"41a22acd_5f7628a8","updated":"2025-08-07 16:48:46.000000000","message":"The latest patch uses the much simplified code you suggested.  I have added a short comment on why the breakpoint is required.","commit_id":"3a164de5c25565b907b5a787c0d316759ff6bf78"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0cc0d6c4139b3b733489292ce456a531cb70100a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"23bfaff2_3aa0b74e","updated":"2025-08-09 19:43:53.000000000","message":"Thanks","commit_id":"5c338a2fef7c7538816cc7b0a9c7839cd7843f5c"}],"tcl/target/max32670.cfg":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a88de5548fea54c122909d8ee5cbd9998c487a60","unresolved":true,"context_lines":[{"line_number":25,"context_line":"# Override default init_reset{mode} to catch parameter \"mode\""},{"line_number":26,"context_line":"proc init_reset {mode} {"},{"line_number":27,"context_line":"\tglobal sp_reset_mode"},{"line_number":28,"context_line":"\tset sp_reset_mode $mode"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"$_CHIPNAME.cpu configure -event reset-deassert-post {"}],"source_content_type":"text/x-ttcn-cfg","patch_set":1,"id":"3021e3b3_874754b2","line":28,"updated":"2025-07-27 18:18:02.000000000","message":"You don\u0027t need this function to preserve the variable `$mode`.\nIn the events `reset-deassert-post` and `reset-assert-pre` you have pre-defined the variables\n- `$MODE` that is one in `halt`, `init`, `run`,\n- `$halt` that is 1 for `halt` or `init`, 0 for `run`","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1002302,"name":"Henrik Mau","display_name":"Henrik Mau","email":"henrik.mau@analog.com","username":"hmauadi"},"change_message_id":"10ceff59dba5758f214c21618d86f8d75f80e372","unresolved":false,"context_lines":[{"line_number":25,"context_line":"# Override default init_reset{mode} to catch parameter \"mode\""},{"line_number":26,"context_line":"proc init_reset {mode} {"},{"line_number":27,"context_line":"\tglobal sp_reset_mode"},{"line_number":28,"context_line":"\tset sp_reset_mode $mode"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"$_CHIPNAME.cpu configure -event reset-deassert-post {"}],"source_content_type":"text/x-ttcn-cfg","patch_set":1,"id":"b0321685_2510ce45","line":28,"in_reply_to":"3021e3b3_874754b2","updated":"2025-08-07 16:48:46.000000000","message":"Ah, that simplifies things.  Function removed.","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a88de5548fea54c122909d8ee5cbd9998c487a60","unresolved":true,"context_lines":[{"line_number":28,"context_line":"\tset sp_reset_mode $mode"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"$_CHIPNAME.cpu configure -event reset-deassert-post {"},{"line_number":32,"context_line":"  global sp_reset_mode"},{"line_number":33,"context_line":"  global _CHIPNAME"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-ttcn-cfg","patch_set":1,"id":"1c6f73f6_40da0f35","line":31,"updated":"2025-07-27 18:18:02.000000000","message":"Why you do this `arp_poll` iteration before halt?\nAfter a reset the status of Cortex_m in OpenOCD is \"reset\" and you need to poll twice to have the current state. It is part of the way OpenOCD handles Cortex-M.\nYou can simply run twice `arp_poll`, it should be enough.\nBut still I don\u0027t understand why you need to do it. OpenOCD should be already able to halt the CPU without his code","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1002302,"name":"Henrik Mau","display_name":"Henrik Mau","email":"henrik.mau@analog.com","username":"hmauadi"},"change_message_id":"10ceff59dba5758f214c21618d86f8d75f80e372","unresolved":false,"context_lines":[{"line_number":28,"context_line":"\tset sp_reset_mode $mode"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"$_CHIPNAME.cpu configure -event reset-deassert-post {"},{"line_number":32,"context_line":"  global sp_reset_mode"},{"line_number":33,"context_line":"  global _CHIPNAME"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-ttcn-cfg","patch_set":1,"id":"8659981e_f83d015b","line":31,"in_reply_to":"1c6f73f6_40da0f35","updated":"2025-08-07 16:48:46.000000000","message":"That was a misunderstanding on our part.  We\u0027ve addressed it per your recommendation below.","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a88de5548fea54c122909d8ee5cbd9998c487a60","unresolved":true,"context_lines":[{"line_number":32,"context_line":"  global sp_reset_mode"},{"line_number":33,"context_line":"  global _CHIPNAME"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"\tif { ([string compare $sp_reset_mode \"init\"] \u003d\u003d 0) } {"},{"line_number":36,"context_line":"    set state \"reset\""},{"line_number":37,"context_line":"    while { [string compare $state \"reset\"] \u003d\u003d 0 } {"},{"line_number":38,"context_line":"      set state [$_CHIPNAME.cpu curstate]"}],"source_content_type":"text/x-ttcn-cfg","patch_set":1,"id":"ffcef4ef_3a1a1eb5","line":35,"updated":"2025-07-27 18:18:02.000000000","message":"Don\u0027t use `string compare` as it makes the code less readable.\nhttps://wiki.tcl-lang.org/page/string+compare+%2E%2E%2E\nuse\n`if {$sp_reset_mode eq \"init\"} {`","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1002302,"name":"Henrik Mau","display_name":"Henrik Mau","email":"henrik.mau@analog.com","username":"hmauadi"},"change_message_id":"10ceff59dba5758f214c21618d86f8d75f80e372","unresolved":false,"context_lines":[{"line_number":32,"context_line":"  global sp_reset_mode"},{"line_number":33,"context_line":"  global _CHIPNAME"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"\tif { ([string compare $sp_reset_mode \"init\"] \u003d\u003d 0) } {"},{"line_number":36,"context_line":"    set state \"reset\""},{"line_number":37,"context_line":"    while { [string compare $state \"reset\"] \u003d\u003d 0 } {"},{"line_number":38,"context_line":"      set state [$_CHIPNAME.cpu curstate]"}],"source_content_type":"text/x-ttcn-cfg","patch_set":1,"id":"c608b476_65a041be","line":35,"in_reply_to":"ffcef4ef_3a1a1eb5","updated":"2025-08-07 16:48:46.000000000","message":"Removed","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a88de5548fea54c122909d8ee5cbd9998c487a60","unresolved":true,"context_lines":[{"line_number":65,"context_line":"    set rom_bp_enabled \"no\""},{"line_number":66,"context_line":"  }"},{"line_number":67,"context_line":"  set sp_reset_mode none"},{"line_number":68,"context_line":"}"}],"source_content_type":"text/x-ttcn-cfg","patch_set":1,"id":"f6bafda7_04c52e44","line":68,"updated":"2025-07-27 18:18:02.000000000","message":"So, this device has no reset line\n`reset_config none`\nit means OpenOCD will use the SW reset.\nAs far as I know the SW reset will also handle the \u0027reset halt\u0027, but you need all this extra code that adds a breakpoint in the ROM.\nCan you please explain in a comment why you need it?\nI presume that for some security reason, OpenOCD is unable to halt the CPU after reset, until it gets the PC 0x00002174.\n\nI think you can simplify the code dropping `rom_bp_enabled` and set the bp in `reset-assert-pre` with\n```\nif {$halt} {catch {bp 0x00002174 2 hw}\n```\nand remove it in `reset-deassert-post`\n```\nif {$halt} {\n    $::_CHIPNAME.cpu arp_poll\n    $::_CHIPNAME.cpu arp_poll\n    $::_CHIPNAME.cpu arp_halt\n    rbp 0x00002174\n}\n```\nplease note that `$::var` is for addressing the global variable without the need to declare them as global","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"},{"author":{"_account_id":1002302,"name":"Henrik Mau","display_name":"Henrik Mau","email":"henrik.mau@analog.com","username":"hmauadi"},"change_message_id":"10ceff59dba5758f214c21618d86f8d75f80e372","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    set rom_bp_enabled \"no\""},{"line_number":66,"context_line":"  }"},{"line_number":67,"context_line":"  set sp_reset_mode none"},{"line_number":68,"context_line":"}"}],"source_content_type":"text/x-ttcn-cfg","patch_set":1,"id":"76377e43_977458f3","line":68,"in_reply_to":"f6bafda7_04c52e44","updated":"2025-08-07 16:48:46.000000000","message":"You are correct.  Your recommendation is a far simpler way of achieving the goal of halting the CPU on reset.  Thank you.","commit_id":"9845e4f08f54398e519b2717acd1e507c15a15da"}]}
