)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5ce53992f96a3c63e37e0730ebc95087ee5df2ff","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"30092242_cc5c612e","updated":"2022-08-04 21:38:14.000000000","message":"two typos (please check them) and plenty of bla bla bla (feel free to ignore it)","commit_id":"6ce7effb2ecc3b1aa74ffe89a7aa3b00aa84a49d"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0320ecb53af057711a17edc7250a419ccf4740a6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"030f89ba_409d4ddb","updated":"2022-08-05 08:55:26.000000000","message":"thanks","commit_id":"19c403eeb4704aa8c10c02d2d27b3a6c352f8715"}],"src/target/cortex_m.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"31f363bcd5e7d92180ca6309436fc4aaa9a2a709","unresolved":true,"context_lines":[{"line_number":2402,"context_line":"\t\t *  as S_RESET_ST may indicate a reset that happened long time ago"},{"line_number":2403,"context_line":"\t\t *  (most probably the power-on reset before OpenOCD was started)."},{"line_number":2404,"context_line":"\t\t *  As we are just initializing the debug system we do not need"},{"line_number":2405,"context_line":"\t\t *  to call cortex_m_endreset_event() in the folowing poll."},{"line_number":2406,"context_line":"\t\t */"},{"line_number":2407,"context_line":"\t\tif (!cortex_m-\u003edcb_dhcsr_sticky_is_recent"},{"line_number":2408,"context_line":"\t\t\t       \u0026\u0026 cortex_m-\u003edcb_dhcsr \u0026 S_RESET_ST) {"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"5c2ef0c2_79a24d0a","line":2405,"updated":"2022-08-02 17:14:21.000000000","message":"typo \"following\"","commit_id":"de595c7a218d33776e961e1d74e763336bb0cf61"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"33782c33635abb948e6c716d73192f85b3f7fcf3","unresolved":false,"context_lines":[{"line_number":2402,"context_line":"\t\t *  as S_RESET_ST may indicate a reset that happened long time ago"},{"line_number":2403,"context_line":"\t\t *  (most probably the power-on reset before OpenOCD was started)."},{"line_number":2404,"context_line":"\t\t *  As we are just initializing the debug system we do not need"},{"line_number":2405,"context_line":"\t\t *  to call cortex_m_endreset_event() in the folowing poll."},{"line_number":2406,"context_line":"\t\t */"},{"line_number":2407,"context_line":"\t\tif (!cortex_m-\u003edcb_dhcsr_sticky_is_recent"},{"line_number":2408,"context_line":"\t\t\t       \u0026\u0026 cortex_m-\u003edcb_dhcsr \u0026 S_RESET_ST) {"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"f8867756_fbf3af0e","line":2405,"in_reply_to":"5c2ef0c2_79a24d0a","updated":"2022-08-04 15:14:18.000000000","message":"Done","commit_id":"de595c7a218d33776e961e1d74e763336bb0cf61"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"31f363bcd5e7d92180ca6309436fc4aaa9a2a709","unresolved":true,"context_lines":[{"line_number":2409,"context_line":"\t\t\tLOG_TARGET_DEBUG(target, \"reset happened some time ago, ignore\");"},{"line_number":2410,"context_line":"\t\t\tcortex_m-\u003edcb_dhcsr \u0026\u003d ~S_RESET_ST;"},{"line_number":2411,"context_line":"\t\t}"},{"line_number":2412,"context_line":"\t\tcortex_m_cumulate_dhcsr_sticky(cortex_m, cortex_m-\u003edcb_dhcsr);"},{"line_number":2413,"context_line":""},{"line_number":2414,"context_line":"\t\tif (!(cortex_m-\u003edcb_dhcsr \u0026 C_DEBUGEN)) {"},{"line_number":2415,"context_line":"\t\t\t/* Enable debug requests */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"0cfc1554_c830b1a3","line":2412,"updated":"2022-08-02 17:14:21.000000000","message":"maybe it\u0027s just me getting old, but I would find it more readable if the flag is set here instead of having it in another function.\nAlso I find the flag name is misleading.\nWhat about:\n if (!cortex_m-\u003edcb_dhcsr_already_read) {\n     cortex_m-\u003edcb_dhcsr_already_read \u003d true;\n     if (cortex_m-\u003edcb_dhcsr \u0026 S_RESET_ST) {\n         LOG_TARGET_DEBUG(target, \"reset happened some time ago, ignore\");\n         cortex_m-\u003edcb_dhcsr \u0026\u003d ~S_RESET_ST;\n     }\n }\n cortex_m_cumulate_dhcsr_sticky(cortex_m, cortex_m-\u003edcb_dhcsr);","commit_id":"de595c7a218d33776e961e1d74e763336bb0cf61"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"5fd3025f2e52158148bbab38ac258069a9cae22e","unresolved":true,"context_lines":[{"line_number":2409,"context_line":"\t\t\tLOG_TARGET_DEBUG(target, \"reset happened some time ago, ignore\");"},{"line_number":2410,"context_line":"\t\t\tcortex_m-\u003edcb_dhcsr \u0026\u003d ~S_RESET_ST;"},{"line_number":2411,"context_line":"\t\t}"},{"line_number":2412,"context_line":"\t\tcortex_m_cumulate_dhcsr_sticky(cortex_m, cortex_m-\u003edcb_dhcsr);"},{"line_number":2413,"context_line":""},{"line_number":2414,"context_line":"\t\tif (!(cortex_m-\u003edcb_dhcsr \u0026 C_DEBUGEN)) {"},{"line_number":2415,"context_line":"\t\t\t/* Enable debug requests */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"43f245c9_320e29ed","line":2412,"in_reply_to":"0cfc1554_c830b1a3","updated":"2022-08-02 21:21:25.000000000","message":"\u003e What about:\n\u003e  if (!cortex_m-\u003edcb_dhcsr_already_read) {\n\u003e      cortex_m-\u003edcb_dhcsr_already_read \u003d true;\n\u003e      if (cortex_m-\u003edcb_dhcsr \u0026 S_RESET_ST) {\n\u003e          LOG_TARGET_DEBUG(target, \"reset happened some time ago, ignore\");\n\u003e          cortex_m-\u003edcb_dhcsr \u0026\u003d ~S_RESET_ST;\n\u003e      }\n\u003e  }\n\u003e  cortex_m_cumulate_dhcsr_sticky(cortex_m, cortex_m-\u003edcb_dhcsr);\n\nHmm, yes, looks simpler and is functionally equivalent.\nMy original motivation was to make the flag universal, usable without knowledge\nwhich part of code reads DHCSR first. As long as all DHCSR reads are accompanied with a cortex_m_cumulate_dhcsr_sticky() the flag is universally valid.\nUnfortunately to fulfil the original idea I would need to split\ndcb_dhcsr_cumulated_sticky to dcb_dhcsr_sticky_historical (or the first read) and dcb_dhcsr_cumulated_sticky_recent, prepare them in cortex_m_cumulate_dhcsr_sticky() and postpone the processing of them to cortex_m_poll() - this seemed me as a huge overkill so I put a part of processing here.\n\n\u003e Also I find the flag name is misleading.\n\nLooks like a different personal taste.\ndcb_dhcsr_already_read hints nothing about the flag usage until you remember that sticky bit gets reset after read. I mean \u0027recent\u0027 as the opposite for \u0027historical\u0027. Isn\u0027t it clear?\n\nAnyway this change is low in the importance scale, let\u0027s don\u0027t focus on it more than appropriate.","commit_id":"de595c7a218d33776e961e1d74e763336bb0cf61"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"33782c33635abb948e6c716d73192f85b3f7fcf3","unresolved":true,"context_lines":[{"line_number":2409,"context_line":"\t\t\tLOG_TARGET_DEBUG(target, \"reset happened some time ago, ignore\");"},{"line_number":2410,"context_line":"\t\t\tcortex_m-\u003edcb_dhcsr \u0026\u003d ~S_RESET_ST;"},{"line_number":2411,"context_line":"\t\t}"},{"line_number":2412,"context_line":"\t\tcortex_m_cumulate_dhcsr_sticky(cortex_m, cortex_m-\u003edcb_dhcsr);"},{"line_number":2413,"context_line":""},{"line_number":2414,"context_line":"\t\tif (!(cortex_m-\u003edcb_dhcsr \u0026 C_DEBUGEN)) {"},{"line_number":2415,"context_line":"\t\t\t/* Enable debug requests */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"e083a3c6_730b4712","line":2412,"in_reply_to":"43f245c9_320e29ed","updated":"2022-08-04 15:14:18.000000000","message":"Partly addressed.","commit_id":"de595c7a218d33776e961e1d74e763336bb0cf61"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5ce53992f96a3c63e37e0730ebc95087ee5df2ff","unresolved":false,"context_lines":[{"line_number":2409,"context_line":"\t\t\tLOG_TARGET_DEBUG(target, \"reset happened some time ago, ignore\");"},{"line_number":2410,"context_line":"\t\t\tcortex_m-\u003edcb_dhcsr \u0026\u003d ~S_RESET_ST;"},{"line_number":2411,"context_line":"\t\t}"},{"line_number":2412,"context_line":"\t\tcortex_m_cumulate_dhcsr_sticky(cortex_m, cortex_m-\u003edcb_dhcsr);"},{"line_number":2413,"context_line":""},{"line_number":2414,"context_line":"\t\tif (!(cortex_m-\u003edcb_dhcsr \u0026 C_DEBUGEN)) {"},{"line_number":2415,"context_line":"\t\t\t/* Enable debug requests */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"b781161f_73bac1aa","line":2412,"in_reply_to":"e083a3c6_730b4712","updated":"2022-08-04 21:38:14.000000000","message":"Just for talking, feel free to dump it in the bin.\nI still don\u0027t catch the use of the wording is_recent or is_historical.\nThe explanation in the comment is clear: the first read can catch an incorrect value and it\u0027s good to trash it out. A flag named is_first_read would be perfect, but requires to be initialized to true which is not convenient; it\u0027s opposite is_already_read or is_not_first_read have the benefit of being initialized to false.\nAnyway, now the code is fully contained here after the good explaining comment; any flag name is ok for me.","commit_id":"de595c7a218d33776e961e1d74e763336bb0cf61"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5ce53992f96a3c63e37e0730ebc95087ee5df2ff","unresolved":true,"context_lines":[{"line_number":652,"context_line":""},{"line_number":653,"context_line":"\tregister_cache_invalidate(armv7m-\u003earm.core_cache);"},{"line_number":654,"context_line":""},{"line_number":655,"context_line":"\t/* TODO: invalidate also woking areas (needed in the case of detected reset)."},{"line_number":656,"context_line":"\t * Doing so will require flash drivers to test if woking area"},{"line_number":657,"context_line":"\t * is still valid in all target algo calling loops."},{"line_number":658,"context_line":"\t */"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"18ccb519_9b82aa22","line":655,"updated":"2022-08-04 21:38:14.000000000","message":"typo? s/woking/working/ ?\nAlso in next line?","commit_id":"6ce7effb2ecc3b1aa74ffe89a7aa3b00aa84a49d"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"19e929bc2ac811fc4fdca3abf0401a880d9b3b4d","unresolved":false,"context_lines":[{"line_number":652,"context_line":""},{"line_number":653,"context_line":"\tregister_cache_invalidate(armv7m-\u003earm.core_cache);"},{"line_number":654,"context_line":""},{"line_number":655,"context_line":"\t/* TODO: invalidate also woking areas (needed in the case of detected reset)."},{"line_number":656,"context_line":"\t * Doing so will require flash drivers to test if woking area"},{"line_number":657,"context_line":"\t * is still valid in all target algo calling loops."},{"line_number":658,"context_line":"\t */"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"e6d0c7c8_c1d96ce2","line":655,"in_reply_to":"18ccb519_9b82aa22","updated":"2022-08-05 06:50:18.000000000","message":"OMG, sorry! I would need new glasses or new brain or to stop programming at all.","commit_id":"6ce7effb2ecc3b1aa74ffe89a7aa3b00aa84a49d"}]}
