)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"34f8230b85f67ee06c69fe8dc824b2f8e945234c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"0b91ab34_bd1de4cd","updated":"2025-03-16 12:55:02.000000000","message":"another minor comment, not really blocking. Thanks","commit_id":"352abb7454d471f93c3e799cef9e951febb6a419"}],"src/flash/nor/rp2040.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5c2c1354b4157b7501f2c730e0719159e032b8d8","unresolved":true,"context_lines":[{"line_number":954,"context_line":""},{"line_number":955,"context_line":"\t\ttarget \u003d get_target(CMD_ARGV[arg_idx]);"},{"line_number":956,"context_line":"\t\tif (!target) {"},{"line_number":957,"context_line":"\t\t\tLOG_ERROR(\"Target %s does not exist\", CMD_ARGV[arg_idx]);"},{"line_number":958,"context_line":"\t\t\treturn ERROR_FAIL;"},{"line_number":959,"context_line":"\t\t}"},{"line_number":960,"context_line":"\t\targ_idx++;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"feaf71bb_edf0a0d9","line":957,"updated":"2025-03-09 15:03:45.000000000","message":"`command_print()` should replace `LOG_ERROR()` and `LOG_INFO()`","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"90c620523d1906a19cdb1b942187708b3a1aae25","unresolved":false,"context_lines":[{"line_number":954,"context_line":""},{"line_number":955,"context_line":"\t\ttarget \u003d get_target(CMD_ARGV[arg_idx]);"},{"line_number":956,"context_line":"\t\tif (!target) {"},{"line_number":957,"context_line":"\t\t\tLOG_ERROR(\"Target %s does not exist\", CMD_ARGV[arg_idx]);"},{"line_number":958,"context_line":"\t\t\treturn ERROR_FAIL;"},{"line_number":959,"context_line":"\t\t}"},{"line_number":960,"context_line":"\t\targ_idx++;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"51940368_2c2ef86c","line":957,"in_reply_to":"14d25d05_9eca8c4a","updated":"2025-03-11 17:40:04.000000000","message":"Done","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"34f8230b85f67ee06c69fe8dc824b2f8e945234c","unresolved":false,"context_lines":[{"line_number":954,"context_line":""},{"line_number":955,"context_line":"\t\ttarget \u003d get_target(CMD_ARGV[arg_idx]);"},{"line_number":956,"context_line":"\t\tif (!target) {"},{"line_number":957,"context_line":"\t\t\tLOG_ERROR(\"Target %s does not exist\", CMD_ARGV[arg_idx]);"},{"line_number":958,"context_line":"\t\t\treturn ERROR_FAIL;"},{"line_number":959,"context_line":"\t\t}"},{"line_number":960,"context_line":"\t\targ_idx++;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"d0063c7e_eedb2df4","line":957,"in_reply_to":"51940368_2c2ef86c","updated":"2025-03-16 12:55:02.000000000","message":"Agree. We first need to rework all the handling of event output.","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f7b7114b964afdc58e2f6cedaabf4ed14b9d206b","unresolved":true,"context_lines":[{"line_number":954,"context_line":""},{"line_number":955,"context_line":"\t\ttarget \u003d get_target(CMD_ARGV[arg_idx]);"},{"line_number":956,"context_line":"\t\tif (!target) {"},{"line_number":957,"context_line":"\t\t\tLOG_ERROR(\"Target %s does not exist\", CMD_ARGV[arg_idx]);"},{"line_number":958,"context_line":"\t\t\treturn ERROR_FAIL;"},{"line_number":959,"context_line":"\t\t}"},{"line_number":960,"context_line":"\t\targ_idx++;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"14d25d05_9eca8c4a","line":957,"in_reply_to":"feaf71bb_edf0a0d9","updated":"2025-03-11 13:49:52.000000000","message":"Antonio,\nI know and agree that `command_print()` should be used for commands issued interactively.\nBut this one is not expected to serve as a common user command, actually it gets called in the `reset-init` event only.\n\nIn this particular case `LOG_INFO()` seems me much better. `command_print()` sets the return string and you have to explicitly `echo` the return value of the command because the event handler simply ignores it. I wanted to avoid `echo [cmd]` in the event Tcl body so I decided to use homogenously `LOG_` functions in this command handler.\n\n`command_print()` together with an error code at least outputs something\n(since merging your 5049: target: use LOG_USER to print errors in events | https://review.openocd.org/c/openocd/+/5049).\nBut the message appears in the log couple of lines late (after cleanup is done).\nHere is log with the same message passed by both `LOG_ERROR` (line 376) and `command_print` (line 385!!):\n\n```\nError: 376 133256 rp2xxx.c:1361 rp2xxx_rom_api_call_handler(): Function xx not found in RP2xxx ROM.\nDebug: 377 133256 rp2xxx.c:842 cleanup_after_raw_flash_cmd(): Cleaning up after flash operations\nDebug: 378 133266 target.c:2101 target_free_working_area_restore(): freed 1024 bytes of working area at address 0x20010000\nDebug: 379 133266 target.c:1900 print_wa_layout(): b  0x20010000-0x200103ff (1024 bytes)\nDebug: 380 133266 target.c:1900 print_wa_layout(): b* 0x20010400-0x200107ff (1024 bytes)\nDebug: 381 133266 target.c:1900 print_wa_layout():    0x20010800-0x2001ffff (63488 bytes)\nDebug: 382 133276 target.c:2101 target_free_working_area_restore(): freed 1024 bytes of working area at address 0x20010400\nDebug: 383 133276 target.c:1900 print_wa_layout():    0x20010000-0x2001ffff (65536 bytes)\nDebug: 384 133276 command.c:528 exec_command(): Command \u0027rp2xxx rom_api_call\u0027 failed with error code -4\nError: 385 133276 target.c:4701 target_handle_event(): [rp.cm0] Execution of event reset-init failed:\nFunction xx not found in RP2xxx ROM.\n```\n\nSo for errors `command_print`s are feasible but certainly not ideal for log analysing.\nIf you insist I can switch `LOG_ERROR`s to `command_print`s.","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5c2c1354b4157b7501f2c730e0719159e032b8d8","unresolved":true,"context_lines":[{"line_number":972,"context_line":"\t}"},{"line_number":973,"context_line":""},{"line_number":974,"context_line":"\tif (!bank) {"},{"line_number":975,"context_line":"\t\tLOG_TARGET_ERROR(target, \"No assocciated RP2xxx flash bank found\");"},{"line_number":976,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":977,"context_line":"\t}"},{"line_number":978,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"99f7efd5_22f3d2df","line":975,"updated":"2025-03-09 15:03:45.000000000","message":"a/assocciated/associated/","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"90c620523d1906a19cdb1b942187708b3a1aae25","unresolved":false,"context_lines":[{"line_number":972,"context_line":"\t}"},{"line_number":973,"context_line":""},{"line_number":974,"context_line":"\tif (!bank) {"},{"line_number":975,"context_line":"\t\tLOG_TARGET_ERROR(target, \"No assocciated RP2xxx flash bank found\");"},{"line_number":976,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":977,"context_line":"\t}"},{"line_number":978,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"67dc5d48_3c80dc60","line":975,"in_reply_to":"99f7efd5_22f3d2df","updated":"2025-03-11 17:40:04.000000000","message":"Done","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5c2c1354b4157b7501f2c730e0719159e032b8d8","unresolved":true,"context_lines":[{"line_number":1005,"context_line":"\tLOG_INFO(\"RP2xxx ROM API function %.2s @ %04\" PRIx16, CMD_ARGV[arg_idx], fc);"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"\tstruct rp2040_flash_bank *priv \u003d bank-\u003edriver_priv;"},{"line_number":1008,"context_line":"\tretval \u003d rp2xxx_call_rom_func(bank-\u003etarget, priv, fc, args, ARRAY_SIZE(args));"},{"line_number":1009,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":1010,"context_line":"\t\tLOG_ERROR(\"RP2xxx ROM API call failed\");"},{"line_number":1011,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"418d69e0_54a32324","line":1008,"updated":"2025-03-09 15:03:45.000000000","message":"`target` is equal to `bank-\u003etarget`. Use the shorter `target` here too, otherwise looks confusing wrt the rest of the code.","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f7b7114b964afdc58e2f6cedaabf4ed14b9d206b","unresolved":true,"context_lines":[{"line_number":1005,"context_line":"\tLOG_INFO(\"RP2xxx ROM API function %.2s @ %04\" PRIx16, CMD_ARGV[arg_idx], fc);"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"\tstruct rp2040_flash_bank *priv \u003d bank-\u003edriver_priv;"},{"line_number":1008,"context_line":"\tretval \u003d rp2xxx_call_rom_func(bank-\u003etarget, priv, fc, args, ARRAY_SIZE(args));"},{"line_number":1009,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":1010,"context_line":"\t\tLOG_ERROR(\"RP2xxx ROM API call failed\");"},{"line_number":1011,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"a1073a5e_307c2ccc","line":1008,"in_reply_to":"418d69e0_54a32324","updated":"2025-03-11 13:49:52.000000000","message":"Not just confusing, this is a real bug: It makes `-target` unusable. Thanks for the catch!","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"90c620523d1906a19cdb1b942187708b3a1aae25","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"\tLOG_INFO(\"RP2xxx ROM API function %.2s @ %04\" PRIx16, CMD_ARGV[arg_idx], fc);"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"\tstruct rp2040_flash_bank *priv \u003d bank-\u003edriver_priv;"},{"line_number":1008,"context_line":"\tretval \u003d rp2xxx_call_rom_func(bank-\u003etarget, priv, fc, args, ARRAY_SIZE(args));"},{"line_number":1009,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":1010,"context_line":"\t\tLOG_ERROR(\"RP2xxx ROM API call failed\");"},{"line_number":1011,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"0bd9049d_4233d9d0","line":1008,"in_reply_to":"a1073a5e_307c2ccc","updated":"2025-03-11 17:40:04.000000000","message":"Done","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5c2c1354b4157b7501f2c730e0719159e032b8d8","unresolved":true,"context_lines":[{"line_number":1016,"context_line":""},{"line_number":1017,"context_line":"static const struct command_registration rp2040_exec_command_handlers[] \u003d {"},{"line_number":1018,"context_line":"\t{"},{"line_number":1019,"context_line":"\t\t.name \u003d \"rom_api_call\","},{"line_number":1020,"context_line":"\t\t.mode \u003d COMMAND_EXEC,"},{"line_number":1021,"context_line":"\t\t.help \u003d \"arbitrary ROM API call\","},{"line_number":1022,"context_line":"\t\t.usage \u003d \"[-target t] fc [p0 [p1 [p2 [p3]]]]\","}],"source_content_type":"text/x-csrc","patch_set":3,"id":"140bb0db_49b129b9","line":1019,"updated":"2025-03-09 15:03:45.000000000","message":"Command missing in openocd.texi","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c9e0790565b7d2d95b4c15f2743d674ecc97044b","unresolved":false,"context_lines":[{"line_number":1016,"context_line":""},{"line_number":1017,"context_line":"static const struct command_registration rp2040_exec_command_handlers[] \u003d {"},{"line_number":1018,"context_line":"\t{"},{"line_number":1019,"context_line":"\t\t.name \u003d \"rom_api_call\","},{"line_number":1020,"context_line":"\t\t.mode \u003d COMMAND_EXEC,"},{"line_number":1021,"context_line":"\t\t.help \u003d \"arbitrary ROM API call\","},{"line_number":1022,"context_line":"\t\t.usage \u003d \"[-target t] fc [p0 [p1 [p2 [p3]]]]\","}],"source_content_type":"text/x-csrc","patch_set":3,"id":"eec20164_9e855e36","line":1019,"in_reply_to":"140bb0db_49b129b9","updated":"2025-03-09 15:55:43.000000000","message":"I see this is already done in\nhttps://review.openocd.org/c/openocd/+/8456\nIt\u0027s ok!","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5c2c1354b4157b7501f2c730e0719159e032b8d8","unresolved":true,"context_lines":[{"line_number":1019,"context_line":"\t\t.name \u003d \"rom_api_call\","},{"line_number":1020,"context_line":"\t\t.mode \u003d COMMAND_EXEC,"},{"line_number":1021,"context_line":"\t\t.help \u003d \"arbitrary ROM API call\","},{"line_number":1022,"context_line":"\t\t.usage \u003d \"[-target t] fc [p0 [p1 [p2 [p3]]]]\","},{"line_number":1023,"context_line":"\t\t.handler \u003d rp2040_rom_api_call_handler,"},{"line_number":1024,"context_line":"\t},"},{"line_number":1025,"context_line":"\tCOMMAND_REGISTRATION_DONE"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"861d2654_d965356c","line":1022,"updated":"2025-03-09 15:03:45.000000000","message":"I find quite unusual having the target-name as argument.\nOther target commands are prefixed by the target-name to specify the target to use, but here it is a flash command, not a target command.\n\nI plan to add a generic `target-name prefix` command to overwrite the current target for the command that follows on the command-line. This would drop the need to replicate the command declaration for the cases with and without target-name.\n\nDo you think we could restrict this `rom_api_call` command to current target only?\nOr can we anticipate in the documentation that the optional `-target` parameter could be deprecated and disappear in the future?","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f7b7114b964afdc58e2f6cedaabf4ed14b9d206b","unresolved":true,"context_lines":[{"line_number":1019,"context_line":"\t\t.name \u003d \"rom_api_call\","},{"line_number":1020,"context_line":"\t\t.mode \u003d COMMAND_EXEC,"},{"line_number":1021,"context_line":"\t\t.help \u003d \"arbitrary ROM API call\","},{"line_number":1022,"context_line":"\t\t.usage \u003d \"[-target t] fc [p0 [p1 [p2 [p3]]]]\","},{"line_number":1023,"context_line":"\t\t.handler \u003d rp2040_rom_api_call_handler,"},{"line_number":1024,"context_line":"\t},"},{"line_number":1025,"context_line":"\tCOMMAND_REGISTRATION_DONE"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"9fc38ed1_d4702b28","line":1022,"in_reply_to":"861d2654_d965356c","updated":"2025-03-11 13:49:52.000000000","message":"I agree it\u0027s quite unusual.\n\nActually the `rom_api_call` is more a target command than a flash command.\nNot the first one, there are numerous utility commands in flash drivers which are mostly target related e.g. `kinetis disable_wdog` or `stm32l4x option_load`\nWe (ab)use flash infrastructure because there is no easy way to create a lightweight extension of a target.\n\n`rom_api_call` is used in rp2350.cfg `reset-init` event just with the current target. I introduced `-target` option in some stage of development and left it there because the flash is configured with core0 only (and an alias is used for core1) and `rom_api_call` might be useful on either core.\n\nI do not expect other use of `-target` than for testing, so there should not be a problem if we change it in the future.","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"90c620523d1906a19cdb1b942187708b3a1aae25","unresolved":false,"context_lines":[{"line_number":1019,"context_line":"\t\t.name \u003d \"rom_api_call\","},{"line_number":1020,"context_line":"\t\t.mode \u003d COMMAND_EXEC,"},{"line_number":1021,"context_line":"\t\t.help \u003d \"arbitrary ROM API call\","},{"line_number":1022,"context_line":"\t\t.usage \u003d \"[-target t] fc [p0 [p1 [p2 [p3]]]]\","},{"line_number":1023,"context_line":"\t\t.handler \u003d rp2040_rom_api_call_handler,"},{"line_number":1024,"context_line":"\t},"},{"line_number":1025,"context_line":"\tCOMMAND_REGISTRATION_DONE"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"fceab565_dfed8bbd","line":1022,"in_reply_to":"9fc38ed1_d4702b28","updated":"2025-03-11 17:40:04.000000000","message":"I dropped the option, the command now supports core0 only.","commit_id":"d99a30c925dad089d0b375f969176234180ef572"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"34f8230b85f67ee06c69fe8dc824b2f8e945234c","unresolved":true,"context_lines":[{"line_number":983,"context_line":"\tuint16_t fc;"},{"line_number":984,"context_line":"\tretval \u003d rp2xxx_lookup_rom_symbol(target, tag, symtype_func, \u0026fc);"},{"line_number":985,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":986,"context_line":"\t\tcommand_print(CMD, \"Function %.2s not found in RP2xxx ROM.\","},{"line_number":987,"context_line":"\t\t\t\t\t  CMD_ARGV[0]);"},{"line_number":988,"context_line":"\t\tgoto cleanup_and_return;"},{"line_number":989,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"994aa373_fca826b8","line":986,"updated":"2025-03-16 12:55:02.000000000","message":"Marc is insisting in dropping the trailing punctuation from messages.\nThis will be flagged too.\nIf you rework this patch for any reason, drop the trailing dot.","commit_id":"352abb7454d471f93c3e799cef9e951febb6a419"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f8a04954f78fe37f6ceda04ffebcab73d8c5bee4","unresolved":false,"context_lines":[{"line_number":983,"context_line":"\tuint16_t fc;"},{"line_number":984,"context_line":"\tretval \u003d rp2xxx_lookup_rom_symbol(target, tag, symtype_func, \u0026fc);"},{"line_number":985,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":986,"context_line":"\t\tcommand_print(CMD, \"Function %.2s not found in RP2xxx ROM.\","},{"line_number":987,"context_line":"\t\t\t\t\t  CMD_ARGV[0]);"},{"line_number":988,"context_line":"\t\tgoto cleanup_and_return;"},{"line_number":989,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"0bc1cc24_edfb80cb","line":986,"in_reply_to":"7915cb68_66de4d1b","updated":"2025-05-19 12:45:08.000000000","message":"Fixed in 8809: flash/nor/rp2xxx: fix LOG_xxx messages | https://review.openocd.org/c/openocd/+/8809","commit_id":"352abb7454d471f93c3e799cef9e951febb6a419"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"7fc702fa3a75fdefdb60c30144b17533150c9eec","unresolved":true,"context_lines":[{"line_number":983,"context_line":"\tuint16_t fc;"},{"line_number":984,"context_line":"\tretval \u003d rp2xxx_lookup_rom_symbol(target, tag, symtype_func, \u0026fc);"},{"line_number":985,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":986,"context_line":"\t\tcommand_print(CMD, \"Function %.2s not found in RP2xxx ROM.\","},{"line_number":987,"context_line":"\t\t\t\t\t  CMD_ARGV[0]);"},{"line_number":988,"context_line":"\t\tgoto cleanup_and_return;"},{"line_number":989,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"7915cb68_66de4d1b","line":986,"in_reply_to":"994aa373_fca826b8","updated":"2025-03-16 19:26:12.000000000","message":"Yup, there are lot of trailing dots. The patches are much older than 8576: doc/manual: Add section about logging | https://review.openocd.org/c/openocd/+/8576\n\nI\u0027ll fix them in a separate patch.","commit_id":"352abb7454d471f93c3e799cef9e951febb6a419"}]}
