)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"45a08c8f7d9cbecd0b01331d8c071aecbbebc43e","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Marc Schink \u003cdev@zapb.de\u003e"},{"line_number":5,"context_line":"CommitDate: 2025-03-11 18:57:50 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"flash/nor/tcl: Add \u0027read_memory\u0027 function"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This function allows to read non-memory mapped flash content directly"},{"line_number":10,"context_line":"via Tcl script. The API is the same as for the \u0027read_memory\u0027 function"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ed89102d_91daf583","line":7,"updated":"2025-03-16 16:07:58.000000000","message":"maybe `flash/nor/tcl: Add \u0027flash read_memory\u0027 command` ?\nand change s/function/command/ below","commit_id":"6d0b015d121c1e62365c7efa1d223562a655b22e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"f42bc361ed46622237bdf379a40e35130d98cead","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Marc Schink \u003cdev@zapb.de\u003e"},{"line_number":5,"context_line":"CommitDate: 2025-03-11 18:57:50 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"flash/nor/tcl: Add \u0027read_memory\u0027 function"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This function allows to read non-memory mapped flash content directly"},{"line_number":10,"context_line":"via Tcl script. The API is the same as for the \u0027read_memory\u0027 function"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"b29c5bd8_d1a7dc0d","line":7,"in_reply_to":"ed89102d_91daf583","updated":"2025-05-23 07:34:36.000000000","message":"Done","commit_id":"6d0b015d121c1e62365c7efa1d223562a655b22e"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"50c3fa0b9d3709cf07892582c77a73751c5dcd45","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"1434bb68_b7efacd3","updated":"2025-01-25 15:12:52.000000000","message":"Any opinions or objections?","commit_id":"eae12b140c2402a58d3841e827af8fb773a75672"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"1b7fc8bdbb94321a775c8d5ba5c35665a5561666","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"91abfb9d_eeaa53f3","updated":"2025-05-23 12:49:20.000000000","message":"Look ok to me, thanks.\n\nQuestion: does it make sense to have `read_memory` and `flash read_memory` separate?\nComparing the two codes, the main delta is that:\n- here we use `get_flash_bank_by_addr()`, that could be used to detect that the address is not flash;\n- here we run `flash_driver_read()` while for memory we use either `target_read_phys_memory()` or `target_read_memory()`.\nFrom code point of view looks trivial merging them.\n\nOr we like/need to have two views (flash vs memory) of the same data?","commit_id":"c177dee84cda28769a821848d9b1b602ac825118"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"258e00970c792175857d25f82300a11e28af7433","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"b4c0a904_402bf6e5","in_reply_to":"35fe28c8_b1394a77","updated":"2025-05-25 16:19:07.000000000","message":"\u003e Let\u0027s imagine somebody debugs XIP mode setting on a new board. He wants to check both the data in the external memory and what target reads at the XIP mapped area.\n\u003e ...\n\u003e Does it make sense?\n\nDefinitively it makes sense! Thanks!\nSo the two commands for flash and non-flash access should be kept separate.\nLet\u0027s see later, after this merge, if we can optimize/simplify the code BUT keeping the two use cases well separated.","commit_id":"c177dee84cda28769a821848d9b1b602ac825118"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3d71d161036b8234a6361d45d12ccc8a5e720eb8","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"be5e81ba_bde995db","in_reply_to":"38ce7e9a_ff55f012","updated":"2025-05-24 17:26:00.000000000","message":"We have `load_image`, also `flash write_image` and `flash write_bank`.\nWe have `dump_image` and also bank specific `flash read_bank`.\nIf you drop `flash mdw` and avoid introducing `flash read_memory`,\nhow we would read an external memory which is not visible in the target address space? This `flash` specific version is also necessary for some special internal hidden memories like user signature partition of SAMV7/E7/S7 flash.\n\nOf course I\u0027m not fan of code duplicating. Would not help some reasonable refactoring?","commit_id":"c177dee84cda28769a821848d9b1b602ac825118"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3c1affe5054c6e444bd149ab01114b46c29a5035","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"35fe28c8_b1394a77","in_reply_to":"6fd640c7_33d6c029","updated":"2025-05-25 15:08:56.000000000","message":"Oh yes, it looks reasonable for the situations when everything works.\nOn the other hand OpenOCD is a debugging tools, so the assumption that everything works is often quite odd.\n\nLet\u0027s imagine somebody debugs XIP mode setting on a new board. He wants to check both the data in the external memory and what target reads at the XIP mapped area.\n\nThis case of using both versions might be rare. Anyway I would prefer to always use the proper command depending to what is my work focused to: `non flash` version for target or internal flash (in about 99% cases) or `flash` for special/external flash (~1%).\n\nAnd yes, most of normal users know only the non flash `mdw` version and do not care about anything else. I\u0027m reluctant to change their basic command to what used to be `flash` version dependent on banks setup and probing.\n\nI think we don\u0027t need separate commands but we need at least some option to enable/disable access through flash driver. Considering the memory command allows a target prefix, from user point of view we can consider `flash` as an additional target-like prefix for mem access commands.\n\nDoes it make sense?","commit_id":"c177dee84cda28769a821848d9b1b602ac825118"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"047eef11bf569e1a60052cbf45c638fd055b3186","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"b0bb555f_ba3bc51a","in_reply_to":"91abfb9d_eeaa53f3","updated":"2025-05-23 16:10:20.000000000","message":"Actually the flash version might work quite differently: e.g. the flash driver reads an external memory directly by SPI (or other) protocol. The memory may not be accessible in the target address space (either because XIP mode is not initialised or not possible at all).","commit_id":"c177dee84cda28769a821848d9b1b602ac825118"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"6e6a2450fe94d1d8315ef50e4f95881d985b5ecb","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"38ce7e9a_ff55f012","in_reply_to":"b0bb555f_ba3bc51a","updated":"2025-05-24 14:33:11.000000000","message":"But the complexity you mention is hidden behind `get_flash_bank_by_addr()`.\nIf you compare the existing code of `read_memory` with this new code for `flash read_memory` you can see that they share ~99%.\n\nLet\u0027s left apart the issue of maintaining such almost duplicated code;\ndoes it make sense to have two separate commands `read_memory` and `flash read_memory` when the implementation can be all in a single code?\n\nHistorically we had duplicated implementation for `mdw` and similar, but we are making them deprecated. Can we avoid introducing `flash read_memory` and have only `read_memory` ?","commit_id":"c177dee84cda28769a821848d9b1b602ac825118"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"9de1278ea405cd074596d060476d0caab2469daa","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"6fd640c7_33d6c029","in_reply_to":"be5e81ba_bde995db","updated":"2025-05-25 12:38:01.000000000","message":"I see I need to better explain my point:\n\nCommand `flash mdw`, replaced in this patch, uses `flash_driver_read()` to read the flash content in the host buffer.\nCommand `flash read_memory`, added in this patch, also uses `flash_driver_read()`.\nCommand `flash read_bank` also uses `flash_driver_read()`.\nAll these use a dedicated API for reading the flash, not necessarily try to read the target address space.\n\nCommand `read_memory` reads from target address space using `target_read_memory()`.\n\nI\u0027m not proposing to try to read the flash from the target address space!\nMy proposal is to have a single `read_memory` command that:\n- first calls `get_flash_bank_by_addr()` to check if the address belongs to a flash;\n- if flash, then use `flash_driver_read()` to read it;\n- if no-flash, then use memory API to read from target address space.\n\nI don\u0027t see any technical reason this should not work.\nWe should only modify the existing command `read_memory` so it can \"also\" read a flash.\n\nMy question is:\nfrom syntax and user point of view, does it make sense to have two dedicated `read_memory` commands for flash and non-flash?\nFor me it\u0027s simpler to have a single one.\n\nWe could even imagine to have `flash read_memory` as alias of the generic `read_memory` command, but I don\u0027t see any real advantage of doing it.","commit_id":"c177dee84cda28769a821848d9b1b602ac825118"}],"doc/openocd.texi":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"00f3981b7dfb79a387867a4aa630dd577cc2d04d","unresolved":true,"context_lines":[{"line_number":5863,"context_line":"A Tcl list containing the requested memory elements is returned by this function."},{"line_number":5864,"context_line":""},{"line_number":5865,"context_line":"@itemize"},{"line_number":5866,"context_line":"@item @var{address} ... flash memory address"},{"line_number":5867,"context_line":"@item @var{width} ... memory access bit size, can be 8, 16, 32 or 64"},{"line_number":5868,"context_line":"@item @var{count} ... number of elements to read"},{"line_number":5869,"context_line":"@end itemize"}],"source_content_type":"text/x-texinfo","patch_set":2,"id":"ee80900e_16e7e144","line":5866,"updated":"2025-03-16 16:05:24.000000000","message":"strange way to list the parameters, but already used 109 times in this doc.\nI think we should \"standardize\" the way to list the command\u0027s parameters","commit_id":"6d0b015d121c1e62365c7efa1d223562a655b22e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"f42bc361ed46622237bdf379a40e35130d98cead","unresolved":false,"context_lines":[{"line_number":5863,"context_line":"A Tcl list containing the requested memory elements is returned by this function."},{"line_number":5864,"context_line":""},{"line_number":5865,"context_line":"@itemize"},{"line_number":5866,"context_line":"@item @var{address} ... flash memory address"},{"line_number":5867,"context_line":"@item @var{width} ... memory access bit size, can be 8, 16, 32 or 64"},{"line_number":5868,"context_line":"@item @var{count} ... number of elements to read"},{"line_number":5869,"context_line":"@end itemize"}],"source_content_type":"text/x-texinfo","patch_set":2,"id":"123f0e20_2a272b7b","line":5866,"in_reply_to":"ee80900e_16e7e144","updated":"2025-05-23 07:34:36.000000000","message":"Yes, there are so many inconsistencies in the docs.. :(","commit_id":"6d0b015d121c1e62365c7efa1d223562a655b22e"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"00f3981b7dfb79a387867a4aa630dd577cc2d04d","unresolved":true,"context_lines":[{"line_number":5872,"context_line":"memory at address 0x08000000:"},{"line_number":5873,"context_line":""},{"line_number":5874,"context_line":"@example"},{"line_number":5875,"context_line":"read_memory 0x08000000 32 2"},{"line_number":5876,"context_line":"@end example"},{"line_number":5877,"context_line":"@end deffn"},{"line_number":5878,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":2,"id":"115deb56_5f3cd720","line":5875,"updated":"2025-03-16 16:05:24.000000000","message":"missing leading `flash` ?","commit_id":"6d0b015d121c1e62365c7efa1d223562a655b22e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"f42bc361ed46622237bdf379a40e35130d98cead","unresolved":false,"context_lines":[{"line_number":5872,"context_line":"memory at address 0x08000000:"},{"line_number":5873,"context_line":""},{"line_number":5874,"context_line":"@example"},{"line_number":5875,"context_line":"read_memory 0x08000000 32 2"},{"line_number":5876,"context_line":"@end example"},{"line_number":5877,"context_line":"@end deffn"},{"line_number":5878,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":2,"id":"e02e4eab_3a95fcc3","line":5875,"in_reply_to":"115deb56_5f3cd720","updated":"2025-05-23 07:34:36.000000000","message":"Done","commit_id":"6d0b015d121c1e62365c7efa1d223562a655b22e"}],"src/flash/nor/tcl.c":[{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"2dc6028e0d2004916b30b9d00527c3a8e4d41690","unresolved":true,"context_lines":[{"line_number":763,"context_line":""},{"line_number":764,"context_line":"\tconst unsigned int width \u003d width_bits / 8;"},{"line_number":765,"context_line":""},{"line_number":766,"context_line":"\tif ((addr + (count * width)) \u003c addr) {"},{"line_number":767,"context_line":"\t\tcommand_print(CMD, \"addr + count wraps to zero\");"},{"line_number":768,"context_line":"\t\treturn ERROR_COMMAND_ARGUMENT_INVALID;"},{"line_number":769,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"24089f70_e98f9879","line":766,"updated":"2024-12-02 22:42:09.000000000","message":"Integrate wrap-around detection fix from here: https://review.openocd.org/c/openocd/+/8572","commit_id":"eae12b140c2402a58d3841e827af8fb773a75672"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"7131e8ad2c5264fda875f69b0dd891cc0de411c0","unresolved":false,"context_lines":[{"line_number":763,"context_line":""},{"line_number":764,"context_line":"\tconst unsigned int width \u003d width_bits / 8;"},{"line_number":765,"context_line":""},{"line_number":766,"context_line":"\tif ((addr + (count * width)) \u003c addr) {"},{"line_number":767,"context_line":"\t\tcommand_print(CMD, \"addr + count wraps to zero\");"},{"line_number":768,"context_line":"\t\treturn ERROR_COMMAND_ARGUMENT_INVALID;"},{"line_number":769,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"aff0ae24_d8a4ea06","line":766,"in_reply_to":"24089f70_e98f9879","updated":"2025-05-23 07:36:24.000000000","message":"Done","commit_id":"eae12b140c2402a58d3841e827af8fb773a75672"}]}
