)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"a3923a90ebc2df0cb7b1695069032732b88c5614","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"789a89b5_e21e9c76","updated":"2024-07-02 17:08:00.000000000","message":"@Jeremy Grosser -\u003e I have also tried to look closer at https://review.openocd.org/c/openocd/+/8220 to see if I missed anything (hoping not).\n\nTested with \nhttps://github.com/nmenon/openocd/commit/517b51d0a198946b1be802e68b4463840180374e","commit_id":"b776584c182c9e5ced86186ec57ac7e7de0d5711"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"4cf28bd0446b25ebeae7c1667dbc7fd288f5414e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"a5943e9e_dfe2c584","updated":"2024-10-28 15:55:42.000000000","message":"Completed for the next revision - there has also been further fixups based on extended testing and we also fixed up the support for DATA and NONMAIN flash regions correctly for all devices","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f7de156dcccadd58bd34773e6950014dadc7a6ba","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"e46fc383_94cb0022","updated":"2024-07-14 17:47:42.000000000","message":"Thanks for this patch.\nI only run a light review because I\u0027m not working on flash subsystem and I don\u0027t feel comfortable reviewing this.","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"0c04593f_8a55f61e","updated":"2024-11-26 13:15:37.000000000","message":"Thanks for the review Marc.","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"251c6036_9926b308","updated":"2024-11-15 16:03:46.000000000","message":"Thanks for your contribution! Here is a (short) review from my side.\n\n - You never (?) check the return value of target_{write,read} functions\n - Please fix the coding style issues\n - All sectors of the main flash memory are displayed as \u0027protected\u0027 even though they are not (can be erased and programmed). Bug?\n - Usability: flash programming works but is not very \u0027user-friendly\u0027. Once the main flash memory is erased the device got stuck and I need to perform a \u0027board reset\u0027, right? I\u0027m not familiar enough with this device to make suggestions how to fix it unfortunately.  Please at least document this behaviour and what the intended procedure for flash programming is.","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"715532c3a7c6639794a218dfc8b8bc82146749d6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"dc0304d2_5b7f3c2c","updated":"2024-10-30 15:53:52.000000000","message":"Works as expected with all sectors of memory","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"2ca87658_36f3468c","in_reply_to":"251c6036_9926b308","updated":"2024-11-26 13:15:37.000000000","message":"* Updated version with checks for read and write ops\n* uncrustify 0.59 run and cross checked with checkpatch.sh as well\n* Default mode is protected unfortunately, the hardware autolocks the blocks after every write.\n* Documentation added as well for flash programming behavior - esp the reset.","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"904a0243cd23ef8483d1310c2f767429f2a12163","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"9416fdef_3c6d5240","in_reply_to":"2ca87658_36f3468c","updated":"2024-12-03 10:56:55.000000000","message":"- I think uncrustify did some \u0027wrong\u0027 modifications on your patch, see comment on \u0027case\u0027 blocks.\n - If I\u0027m correct, protected in OpenOCD terms means that you have to perform a dedicated \u0027unprotect\u0027 operation. For the current MSPM0 target implementation it does not make a difference if a block is protected or not. What is the purpose of this kind of protection? If there is no hardware support for a block *write* protection, always mark all blocks as unprotected.\n - Programming with `program` works, perfect. But I\u0027m still missing some kind of documentation what the user needs to do if the following operation is performed: flash erase -\u003e reset. In this case the device is not usable until I perform `mspm0_factory_reset`. I guess that is something that cannot be handled easily by OpenOCD? This behaviour is quite special for the MSPM0 and thus needs some kind of documentation, otherwise we could receive many questions and bug reports about this behavior.","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"cb2b8cb5_49417be9","in_reply_to":"9416fdef_3c6d5240","updated":"2025-01-28 17:36:33.000000000","message":"\u003e see comment on \u0027case\u0027 blocks\noops.. sorry about that.\n\n\u003e If there is no hardware support for a block write protection, always mark all blocks as unprotected.\n\nIt is a weird one here.. hardware practically makes the concept of protected blocks un-usable by openOCD. Every time we write, it just resets the protection back.. so there is no protection state it retains across a complete operation. it allows chunks to be written at a time. There are two possible alternative to dealing with this:\na) maintain some sort of \"software list\" or protected blocks and try and maintain sanity - but this wont scale.. all we need to do is disconnect and reconnect and old history is lost. and definitely not the intent of openOCD\u0027s protect mode.\nb) do as you suggest here and mark the entire thing as un-protected.\n\nWe will go and do option (b) and add some in code documentation as to why. also added to openocd.texi for generated documentation\n\n\u003eBut I\u0027m still missing some kind of documentation what the user needs to do if the following operation is performed: flash erase -\u003e reset. \n\nDone. next rev has the documentation update for this. we have not been able to figure out how to make openOCD do it automatically, but I guess it is better to do it explicitly - and the documentation will make it clear on how to use it.","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"bb722f51_21897154","updated":"2025-01-28 17:36:33.000000000","message":"Thanks all for the reviews. Here is the updated version with the review comments incorporated","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"bac1ec758c4fdfdb95614c1111e2c5888b6bfc0d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"468754e3_0506e7ac","updated":"2024-11-26 21:50:16.000000000","message":"Validated updates works all sector of memory. When using telnet I like using just the program command as it does all the heavy lifting for me.","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"b5e77003e8622c40516bc53e86886a7a254c5740","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"708eae9e_6e35fc35","updated":"2025-02-06 15:54:50.000000000","message":"Another question : )","commit_id":"5268e63f8b4e05ac79b09b4e1277ad68b2e3c116"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"367804f32139d69b888a52eb201abbc9cfedcfe9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"6ec83115_73e96fd5","updated":"2025-02-05 22:22:15.000000000","message":"Quick question","commit_id":"5268e63f8b4e05ac79b09b4e1277ad68b2e3c116"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"dc498c54_cebe84b3","updated":"2025-02-19 16:31:51.000000000","message":"@Marc - waiting for your response on the non flash driver related comment. rest of the comments should be addressed in the new revision. Thank you for taking the time to review.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"e1175bb31eec2d9baa85f9b6018721870f86462b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"e6b5264c_91038c6e","updated":"2025-02-07 01:15:08.000000000","message":"Thanks Tomas. Hopefully this is fixed now.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"35201cf6_314b7b9b","updated":"2025-02-16 09:55:19.000000000","message":"Thanks for all the fixes! Just a few others from my side. I hope that we can merge the driver after they are fixed.\n\nI have a question on the MSPM0 in general, unrelated to the driver code.\nI experience a strange behaviour every time a execute `reset init`.\nThe first instruction that performs an access to the SRAM does not work.\nIn my test I execute code from SRAM.\nAfter I perform the first memory access, the firmware works as expected.\nThe firmware is very simple and works on multiple other targets but on MSPM0.\nThe flash memory is *not* empty.\nCan you confirm such behaviour or do you have any idea?","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f311ce48cf85ca3d4650f98c6449e4d987b423da","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"c4b0c85b_68bbb1f3","updated":"2025-02-11 11:41:17.000000000","message":"Thanks!","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"b4405d63fa112eba4a4ccbdcc015e11712c76133","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":7,"id":"a6ef77bc_82dd6901","in_reply_to":"35201cf6_314b7b9b","updated":"2025-02-18 21:44:42.000000000","message":"Hey Marc, thanks for the comments!\nRegarding your observation, could I ask when you execute the firmware where the PC reported by OpenOCD is? I\u0027m curious because whenever our devices are empty for a period of time the ROM kicks in and keeps the device there until a system reset via the sysctl module or bootrst (nRST toggle) occurs.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"3f8ec0e4dd7c7beb087bb6b7a99cb22475335716","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"d7837872_923569a1","in_reply_to":"450674e3_99f066cf","updated":"2025-02-24 18:53:02.000000000","message":"Hi Henry,\n\nyou\u0027re right. The test works if I use the unprotected SRAM memory region at `0x20200000`. Any idea how I can use the \"normal\" / ECC protected region at `0x20000000`? The RM mentions that the SRAM must be written before it can be used. However, this does not work for me. Is there more I have to consider?\n\nAlso, see my last comment on the code.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"5494e1e0cfa92c7cc4afe65617fdd5a696068008","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"511d2f61_64fbdb83","in_reply_to":"8247bf82_8fecf047","updated":"2025-02-27 20:31:49.000000000","message":"Okay, I assume that the firmware operates only in the expected memory region. I have to debug this further but this is unrelated to the patch.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"5e7b70c2a353cf75d27b4cf6772bb5432ceecedc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"450674e3_99f066cf","in_reply_to":"a4f748e2_746f9639","updated":"2025-02-23 04:08:48.000000000","message":"Hello Marc,\n\nThanks for letting me know more about your test scenario 😊.\n\nFrom what I see you are using a device that contains ECC within its SRAM. Whenever the device has SRAM with such property it\u0027s not recommended to switch around the SRAM regions as it can cause NMI\u0027s to occur which is seen in the xPSR register reading. Why I\u0027m pointing out SRAM as well is because the MSP seems to be utilizing the region of SRAM without any additional properties, so due to switching between the SRAM regions the NMI will pop-up.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"7cc7ce7fb0d8e87da15bbc40e0fb670086098ceb","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":7,"id":"f6574d04_76571d9c","in_reply_to":"a6ef77bc_82dd6901","updated":"2025-02-18 21:50:53.000000000","message":"Apologies for the additional comment. Whenever you see this scenario the PC will be somewhere in the region of 0x01000000","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"020d96fb3b52f43d6276606764c6183a7bc5fc07","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"8247bf82_8fecf047","in_reply_to":"d7837872_923569a1","updated":"2025-02-24 18:58:22.000000000","message":"Hi Marc,\n\nIf you wish to use the region of 0x2000_0000, you will need to make sure that everything such as the linker and project keeps everything within the address space of 0x2000_0000. From there if you keep this precaution it should work without issue.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"e7c20359b113ace7988afdb06ca5fec16ee070a8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"a4f748e2_746f9639","in_reply_to":"dc498c54_cebe84b3","updated":"2025-02-22 11:52:31.000000000","message":"Hi Nishanth and Henry,\n\nI experience that the MSPM0 target does not pass some (semi-)automated tests I use to verify patches. The test loads a small firmware into the SRAM and executes it. In this case it is a test for real-time transfer (RTT). At the end of the test a breakpoint is executed. The test with the same firmware works fine on other Cortex-M targets. For that reason, I do not expect a false negative test result here.\n\nI use the following code to execute the test firmware:\n\n```\nreset init\n# (1) Load firmware into SRAM, configure PC to firmware entry\n# address and execute the firmware.\nload_image /home/marc/rust-rtt-cortexm-armv6m\nreg pc 0x200000c1\nresume\n```\n\n**OpenOCD output**\n\n```\n\u003e reset init\n[mspm0x.cpu] halted due to breakpoint, current mode: Thread \nxPSR: 0xf1000000 pc: 0x000048b0 msp: 0x20208000\n\u003e # (1) Load firmware into SRAM, configure PC to firmware entry\n\u003e # address and execute the firmware.\n\u003e load_image /home/marc/rust-rtt-cortexm-armv6m\n192 bytes written at address 0x20000000\n1632 bytes written at address 0x200000c0\n60 bytes written at address 0x20000720\ndownloaded 1884 bytes in 0.007935s (231.864 KiB/s)\n\u003e reg pc 0x200000c1\npc (/32): 0x200000c1\n\u003e resume\n\n...\n\n\u003e halt\n[mspm0x.cpu] halted due to debug-request, current mode: Handler NMI\nxPSR: 0xf1000002 pc: 0x000021de msp: 0x20207fe0\n```\n\nThe core does not run into the breakpoint. When I halt the core, the PC is not in the SRAM region anymore.\nDuring a debug session I found out that the firmware crashes when the core accesses the SRAM for the first time. If I modify the test execution by writing data into the SRAM (see 0a) and perform an SRAM access by the core (see 0b),  the firmware executes successfully.\n\n```\nreset init\n\n# (0a) Write arbitrary data into SRAM.\nmww 0x20000000 0xffffffff\n\n# (0b) Place a memory access instruction \"ldr r0, [pc, #4]\"\n# into the SRAM and execute it.\nmwh 0x20004000 0x4801\nreg pc 0x20004000\nstep\nhalt\n\n# (1) Load firmware into SRAM, configure PC to firmware entry\n# address and execute the firmware.\nload_image /home/marc/rust-rtt-cortexm-armv6m\nreg pc 0x200000c1\nresume\n```\n\n**OpenOCD output**\n\n```\n\u003e reset init\n[mspm0x.cpu] halted due to debug-request, current mode: Thread \nxPSR: 0xf1000000 pc: 0x000048b0 msp: 0x20208000\n\u003e \n\u003e # (0a) Write arbitrary data into SRAM.\n\u003e mww 0x20000000 0xffffffff\n\u003e \n\u003e # (0b) Place a memory access instruction \"ldr r0, [pc, #4]\"\n\u003e # into the SRAM and execute it.\n\u003e mwh 0x20004000 0x4801\n\u003e reg pc 0x20004000\npc (/32): 0x20004000\n\u003e step\n\u003e halt\n[mspm0x.cpu] halted due to debug-request, current mode: Handler NMI\nxPSR: 0xf1000002 pc: 0x000021de msp: 0x20207fe0\n\u003e \n\u003e # (1) Load firmware into SRAM, configure PC to firmware entry\n\u003e # address and execute the firmware.\n\u003e load_image /home/marc/rust-rtt-cortexm-armv6m\n192 bytes written at address 0x20000000\n1632 bytes written at address 0x200000c0\n60 bytes written at address 0x20000720\ndownloaded 1884 bytes in 0.007837s (234.764 KiB/s)\n\u003e reg pc 0x200000c1\npc (/32): 0x200000c1\n\u003e resume\n[mspm0x.cpu] halted due to breakpoint, current mode: Handler NMI\nxPSR: 0x21000002 pc: 0x200003cc msp: 0x20207fc0\n```\n\nAs you can see, the core runs into the breakpoint as expected.\n\nNote that the flash memory is **not** empty and contains a valid firmware. Further, I experience this behaviour only after I issue a `reset init`. Once the SRAM was accessed for the first time I can run firmware from SRAM as expected - as long as I do not perform `reset init`.\n\nAny idea?","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"2667b7bb0196039de04479d5e348fe9f9b12798a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"9d0aec71_6f2bb502","in_reply_to":"f6574d04_76571d9c","updated":"2025-02-26 14:13:36.000000000","message":"Based on discussion in https://review.openocd.org/c/openocd/+/8384/9#message-020d96fb3b52f43d6276606764c6183a7bc5fc07 I am assuming this is resolved now. Marc, let me know if that is not the case.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"5072486495071cb9f5e162a1abac426fda90a213","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"2c164de0_ff7e2900","updated":"2025-02-26 12:59:02.000000000","message":"Thanks Marc. This is done now.","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"af1aac4ddb0eecb52e9fce63257b27d857675166","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"a57f3b70_384f93b4","updated":"2025-02-27 20:30:37.000000000","message":"Thanks Nishanth \u0026 Henry for the work and sorry for the many individual reviews.\n\nTested on LP-MSPM0L1306, LP-MSPM0C1104, and LP-MSPM0G3507.","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"cca77ad71783142a7a8f1870459bfd5183e6429b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"76af57f4_8e9309a6","updated":"2025-03-01 16:42:55.000000000","message":"Thanks for the review Antonio!","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"05aab414_13273e46","updated":"2025-03-01 16:29:18.000000000","message":"few minor comments below. Otherwise, it looks ok. Thanks","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"486659d8_cbb41c23","updated":"2025-03-03 14:34:19.000000000","message":"Updated with the fixes.","commit_id":"3bc6ed01228223dca4f234d579fbad6160011632"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"a141e832d87b2a1400e1f1c437cd00191321f394","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"8a1953f9_7d55e8c3","updated":"2025-03-04 22:51:57.000000000","message":"Looks good to me, expect for one inconsistency.\n\nTested on all three device series again.","commit_id":"af345713d65eb13b8116124b82e532e1137643ce"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"5137fb61eb0b0704318535be04aa2d18915cd7fd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"bf5a2bcd_dafe7cac","updated":"2025-03-03 15:21:43.000000000","message":"fixed the checkpatch error. oops..","commit_id":"af345713d65eb13b8116124b82e532e1137643ce"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"0e1246dcdd655759ed6c417c44ac154f577644f1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"1b6bdfa9_a5694d6a","updated":"2025-03-08 20:17:17.000000000","message":"Thanks for taking the time and reviewing 😊","commit_id":"7059bdb500b55a26409b67e952082c51ed4be0d8"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"dc8e6b59bccd7bd75e944d5c418b6d46c5b32e2b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"6fa5169f_198e65f2","updated":"2025-03-08 17:02:18.000000000","message":"Tomas, you are more skilled than me with this flash framework. Any comment?","commit_id":"7059bdb500b55a26409b67e952082c51ed4be0d8"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"fa6c8705519532a99ca5ec3df50007278a114d0a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"6c7606c0_09140aed","updated":"2025-03-05 12:58:39.000000000","message":"Updated.","commit_id":"7059bdb500b55a26409b67e952082c51ed4be0d8"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"8e390b0522a8936956a52706184b1b912b671c98","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"34cd0a96_b8f3a317","in_reply_to":"6fa5169f_198e65f2","updated":"2025-03-08 17:09:41.000000000","message":"No more comments from me.","commit_id":"7059bdb500b55a26409b67e952082c51ed4be0d8"}],"doc/openocd.texi":[{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":7280,"context_line":"optional region called \"Data\" starts at 0x41d00000."},{"line_number":7281,"context_line":""},{"line_number":7282,"context_line":"@example"},{"line_number":7283,"context_line":"flash bank $_FLASHNAME mspm0 0 0 0 0 $_TARGETNAME"},{"line_number":7284,"context_line":"@end example"},{"line_number":7285,"context_line":"@end deffn"},{"line_number":7286,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"745d3a47_1c9ff459","line":7283,"updated":"2024-11-15 16:03:46.000000000","message":"Please make an example how to use the other flash banks.","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":7280,"context_line":"optional region called \"Data\" starts at 0x41d00000."},{"line_number":7281,"context_line":""},{"line_number":7282,"context_line":"@example"},{"line_number":7283,"context_line":"flash bank $_FLASHNAME mspm0 0 0 0 0 $_TARGETNAME"},{"line_number":7284,"context_line":"@end example"},{"line_number":7285,"context_line":"@end deffn"},{"line_number":7286,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"c5950c97_5afbb56d","line":7283,"in_reply_to":"745d3a47_1c9ff459","updated":"2024-11-26 13:15:37.000000000","message":"Decided to add main and nonmain examples. The data region is not present on all devices, since the pattern still applies, decided to leave it out of the examples","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":true,"context_lines":[{"line_number":7403,"context_line":""},{"line_number":7404,"context_line":"@deffn {Flash Driver} {mspm0}"},{"line_number":7405,"context_line":""},{"line_number":7406,"context_line":"All Arm Cortex-M0+ MSPM microcontroller versions from Texas Instruments"},{"line_number":7407,"context_line":"include internal flash. The mspm0 flash driver automatically recognizes the"},{"line_number":7408,"context_line":"specific version\u0027s flash parameters and autoconfigures itself. The main"},{"line_number":7409,"context_line":"program flash starts at address 0x0. Non-main flash starts at 0x41c00000."}],"source_content_type":"text/x-texinfo","patch_set":7,"id":"00f0c3ef_ebc55208","line":7406,"updated":"2025-02-16 09:55:19.000000000","message":"MSPM0?","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[{"line_number":7403,"context_line":""},{"line_number":7404,"context_line":"@deffn {Flash Driver} {mspm0}"},{"line_number":7405,"context_line":""},{"line_number":7406,"context_line":"All Arm Cortex-M0+ MSPM microcontroller versions from Texas Instruments"},{"line_number":7407,"context_line":"include internal flash. The mspm0 flash driver automatically recognizes the"},{"line_number":7408,"context_line":"specific version\u0027s flash parameters and autoconfigures itself. The main"},{"line_number":7409,"context_line":"program flash starts at address 0x0. Non-main flash starts at 0x41c00000."}],"source_content_type":"text/x-texinfo","patch_set":7,"id":"51415432_7c826d61","line":7406,"in_reply_to":"00f0c3ef_ebc55208","updated":"2025-02-19 16:31:51.000000000","message":"Done","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":true,"context_lines":[{"line_number":7413,"context_line":"@b{Warning}:"},{"line_number":7414,"context_line":""},{"line_number":7415,"context_line":"@itemize @bullet"},{"line_number":7416,"context_line":"@item @b{Reset while MCU operation:} When erasing all of MAIN memory, if the"},{"line_number":7417,"context_line":"MCU is still executing from MAIN memory do not reset the device as it could"},{"line_number":7418,"context_line":"cause a double hard-fault due to the missing interrupt vector table at the"},{"line_number":7419,"context_line":"start of memory."}],"source_content_type":"text/x-texinfo","patch_set":7,"id":"e65c39c0_07399a93","line":7416,"updated":"2025-02-16 09:55:19.000000000","message":"Can you please add how to recover the device if it still happens? I assume a user would have similar issues on blank devices / device provisioning?","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[{"line_number":7413,"context_line":"@b{Warning}:"},{"line_number":7414,"context_line":""},{"line_number":7415,"context_line":"@itemize @bullet"},{"line_number":7416,"context_line":"@item @b{Reset while MCU operation:} When erasing all of MAIN memory, if the"},{"line_number":7417,"context_line":"MCU is still executing from MAIN memory do not reset the device as it could"},{"line_number":7418,"context_line":"cause a double hard-fault due to the missing interrupt vector table at the"},{"line_number":7419,"context_line":"start of memory."}],"source_content_type":"text/x-texinfo","patch_set":7,"id":"2ac98110_020c5270","line":7416,"in_reply_to":"e65c39c0_07399a93","updated":"2025-02-19 16:31:51.000000000","message":"Added: To recover from such scenario reset or power-cycle the MCU.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":true,"context_lines":[{"line_number":7419,"context_line":"start of memory."},{"line_number":7420,"context_line":""},{"line_number":7421,"context_line":"@item @b{No explicit protection support:} MSPM0 flash controller auto-protect"},{"line_number":7422,"context_line":"themselves after every flash operation. As a result of this, openOCD does not"},{"line_number":7423,"context_line":"explicitly provide any protection function and automatically un-protects"},{"line_number":7424,"context_line":"required sections as flash operations are requested."},{"line_number":7425,"context_line":"@end itemize"}],"source_content_type":"text/x-texinfo","patch_set":7,"id":"ef8de3ee_2ccfc1d8","line":7422,"updated":"2025-02-16 09:55:19.000000000","message":"openOCD -\u003e OpenOCD","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[{"line_number":7419,"context_line":"start of memory."},{"line_number":7420,"context_line":""},{"line_number":7421,"context_line":"@item @b{No explicit protection support:} MSPM0 flash controller auto-protect"},{"line_number":7422,"context_line":"themselves after every flash operation. As a result of this, openOCD does not"},{"line_number":7423,"context_line":"explicitly provide any protection function and automatically un-protects"},{"line_number":7424,"context_line":"required sections as flash operations are requested."},{"line_number":7425,"context_line":"@end itemize"}],"source_content_type":"text/x-texinfo","patch_set":7,"id":"6df87c0e_8dd89213","line":7422,"in_reply_to":"ef8de3ee_2ccfc1d8","updated":"2025-02-19 16:31:51.000000000","message":"Ack","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"}],"src/flash/nor/mspm0.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f7de156dcccadd58bd34773e6950014dadc7a6ba","unresolved":true,"context_lines":[{"line_number":106,"context_line":"struct mspm0_family_info {"},{"line_number":107,"context_line":"\tconst char *family_name;"},{"line_number":108,"context_line":"\tuint16_t part_num;"},{"line_number":109,"context_line":"\tuint8_t part_count;"},{"line_number":110,"context_line":"\tconst struct mspm0_part_info *part_info;"},{"line_number":111,"context_line":"};"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"82b871fe_ce7a68dd","line":109,"updated":"2024-07-14 17:47:42.000000000","message":"the `stdint` types are reserved for values that have to match the bit-size of a target\u0027s register or similar.\nHere it\u0027s a generic counter initialized to `ARRAY_SIZE(..)`.\nIf your purpose is to reduce the size of this struct, on 64 bit PC you gain nothing, on 32 bit PC you can use `unsigned short`. I think `unsigned char` risks to be a limitation in the long run.","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"4cf28bd0446b25ebeae7c1667dbc7fd288f5414e","unresolved":false,"context_lines":[{"line_number":106,"context_line":"struct mspm0_family_info {"},{"line_number":107,"context_line":"\tconst char *family_name;"},{"line_number":108,"context_line":"\tuint16_t part_num;"},{"line_number":109,"context_line":"\tuint8_t part_count;"},{"line_number":110,"context_line":"\tconst struct mspm0_part_info *part_info;"},{"line_number":111,"context_line":"};"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"7e40c792_166004d3","line":109,"in_reply_to":"82b871fe_ce7a68dd","updated":"2024-10-28 15:55:42.000000000","message":"Ack","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f7de156dcccadd58bd34773e6950014dadc7a6ba","unresolved":true,"context_lines":[{"line_number":390,"context_line":"\t}"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"\t/* Check if we at least know the family of devices */"},{"line_number":393,"context_line":"\tfor (int i \u003d 0; i \u003c (int)ARRAY_SIZE(mspm0_finf); i++) {"},{"line_number":394,"context_line":"\t\tif (mspm0_finf[i].part_num \u003d\u003d pnum) {"},{"line_number":395,"context_line":"\t\t\tminfo_idx \u003d i;"},{"line_number":396,"context_line":"\t\t\tminfo \u003d \u0026mspm0_finf[i];"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"5efb7ece_f3b0ca61","line":393,"updated":"2024-07-14 17:47:42.000000000","message":"Use `unsigned int` and drop the cast to ARRAY_SIZE()","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"4cf28bd0446b25ebeae7c1667dbc7fd288f5414e","unresolved":false,"context_lines":[{"line_number":390,"context_line":"\t}"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"\t/* Check if we at least know the family of devices */"},{"line_number":393,"context_line":"\tfor (int i \u003d 0; i \u003c (int)ARRAY_SIZE(mspm0_finf); i++) {"},{"line_number":394,"context_line":"\t\tif (mspm0_finf[i].part_num \u003d\u003d pnum) {"},{"line_number":395,"context_line":"\t\t\tminfo_idx \u003d i;"},{"line_number":396,"context_line":"\t\t\tminfo \u003d \u0026mspm0_finf[i];"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"309ec17f_3923c94f","line":393,"in_reply_to":"5efb7ece_f3b0ca61","updated":"2024-10-28 15:55:42.000000000","message":"Ack","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f7de156dcccadd58bd34773e6950014dadc7a6ba","unresolved":true,"context_lines":[{"line_number":467,"context_line":""},{"line_number":468,"context_line":"static void msmp0_fctl_translate_ret_err(uint32_t return_code, char *ret_str)"},{"line_number":469,"context_line":"{"},{"line_number":470,"context_line":"\tfor (unsigned long i \u003d 0; i \u003c ARRAY_SIZE(mspm0_fctl_fail_decode_strings); i++) {"},{"line_number":471,"context_line":"\t\tif (return_code \u0026 BIT(mspm0_fctl_fail_decode_strings[i].bit_offset)) {"},{"line_number":472,"context_line":"\t\t\tstrncat(ret_str, mspm0_fctl_fail_decode_strings[i].fail_string,"},{"line_number":473,"context_line":"\t\t\t\tERR_STRING_MAX);"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"a6cc9617_dda0c2fc","line":470,"updated":"2024-07-14 17:47:42.000000000","message":"why not `unsigned int`? The table doesn\u0027t look that big!","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"4cf28bd0446b25ebeae7c1667dbc7fd288f5414e","unresolved":false,"context_lines":[{"line_number":467,"context_line":""},{"line_number":468,"context_line":"static void msmp0_fctl_translate_ret_err(uint32_t return_code, char *ret_str)"},{"line_number":469,"context_line":"{"},{"line_number":470,"context_line":"\tfor (unsigned long i \u003d 0; i \u003c ARRAY_SIZE(mspm0_fctl_fail_decode_strings); i++) {"},{"line_number":471,"context_line":"\t\tif (return_code \u0026 BIT(mspm0_fctl_fail_decode_strings[i].bit_offset)) {"},{"line_number":472,"context_line":"\t\t\tstrncat(ret_str, mspm0_fctl_fail_decode_strings[i].fail_string,"},{"line_number":473,"context_line":"\t\t\t\tERR_STRING_MAX);"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"282dfce6_277502e3","line":470,"in_reply_to":"a6cc9617_dda0c2fc","updated":"2024-10-28 15:55:42.000000000","message":"Ack","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f7de156dcccadd58bd34773e6950014dadc7a6ba","unresolved":true,"context_lines":[{"line_number":481,"context_line":"{"},{"line_number":482,"context_line":"\tstruct mspm0_flash_bank *mspm0_info \u003d bank-\u003edriver_priv;"},{"line_number":483,"context_line":"\tstruct target *target \u003d bank-\u003etarget;"},{"line_number":484,"context_line":"\tuint32_t sector_num \u003d (addr \u003e\u003e 10);"},{"line_number":485,"context_line":"\tuint32_t sector_in_bank \u003d sector_num;"},{"line_number":486,"context_line":"\tuint32_t phys_sector_num \u003d sector_num;"},{"line_number":487,"context_line":"\tuint32_t sysctl_sec_status;"},{"line_number":488,"context_line":"\tuint32_t exec_upper_bank;"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"\t/*"},{"line_number":491,"context_line":"\t * If the device has dual banks we will need to check if it is configured"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"406e6d33_15247608","line":488,"range":{"start_line":484,"start_character":1,"end_line":488,"end_character":26},"updated":"2024-07-14 17:47:42.000000000","message":"are you sure you need to use uint32_t for all of these variables?\nFrom a quick check below, I think only `sysctl_sec_status` should be entitled.","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"4cf28bd0446b25ebeae7c1667dbc7fd288f5414e","unresolved":false,"context_lines":[{"line_number":481,"context_line":"{"},{"line_number":482,"context_line":"\tstruct mspm0_flash_bank *mspm0_info \u003d bank-\u003edriver_priv;"},{"line_number":483,"context_line":"\tstruct target *target \u003d bank-\u003etarget;"},{"line_number":484,"context_line":"\tuint32_t sector_num \u003d (addr \u003e\u003e 10);"},{"line_number":485,"context_line":"\tuint32_t sector_in_bank \u003d sector_num;"},{"line_number":486,"context_line":"\tuint32_t phys_sector_num \u003d sector_num;"},{"line_number":487,"context_line":"\tuint32_t sysctl_sec_status;"},{"line_number":488,"context_line":"\tuint32_t exec_upper_bank;"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"\t/*"},{"line_number":491,"context_line":"\t * If the device has dual banks we will need to check if it is configured"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"23b417c8_99e82add","line":488,"range":{"start_line":484,"start_character":1,"end_line":488,"end_character":26},"in_reply_to":"406e6d33_15247608","updated":"2024-10-28 15:55:42.000000000","message":"Ack","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f7de156dcccadd58bd34773e6950014dadc7a6ba","unresolved":true,"context_lines":[{"line_number":519,"context_line":""},{"line_number":520,"context_line":"\tif (sector_num \u003c mspm0_info-\u003emain_flash_size_kb) {"},{"line_number":521,"context_line":"\t\t/* Use CMDWEPROTA */"},{"line_number":522,"context_line":"\t\tif (phys_sector_num \u003c (uint32_t)32) {"},{"line_number":523,"context_line":"\t\t\t*sector_mask \u003d (uint32_t)1 \u003c\u003c phys_sector_num;"},{"line_number":524,"context_line":"\t\t\t*reg \u003d FCTL_REG_CMDWEPROTA;"},{"line_number":525,"context_line":"\t\t\treturn ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"b035f2ec_ce46a82e","line":522,"updated":"2024-07-14 17:47:42.000000000","message":"cast should only be used when it\u0027s really needed.\nSame below","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"4cf28bd0446b25ebeae7c1667dbc7fd288f5414e","unresolved":false,"context_lines":[{"line_number":519,"context_line":""},{"line_number":520,"context_line":"\tif (sector_num \u003c mspm0_info-\u003emain_flash_size_kb) {"},{"line_number":521,"context_line":"\t\t/* Use CMDWEPROTA */"},{"line_number":522,"context_line":"\t\tif (phys_sector_num \u003c (uint32_t)32) {"},{"line_number":523,"context_line":"\t\t\t*sector_mask \u003d (uint32_t)1 \u003c\u003c phys_sector_num;"},{"line_number":524,"context_line":"\t\t\t*reg \u003d FCTL_REG_CMDWEPROTA;"},{"line_number":525,"context_line":"\t\t\treturn ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"69ab3886_70aad58f","line":522,"in_reply_to":"b035f2ec_ce46a82e","updated":"2024-10-28 15:55:42.000000000","message":"Ack","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f7de156dcccadd58bd34773e6950014dadc7a6ba","unresolved":true,"context_lines":[{"line_number":520,"context_line":"\tif (sector_num \u003c mspm0_info-\u003emain_flash_size_kb) {"},{"line_number":521,"context_line":"\t\t/* Use CMDWEPROTA */"},{"line_number":522,"context_line":"\t\tif (phys_sector_num \u003c (uint32_t)32) {"},{"line_number":523,"context_line":"\t\t\t*sector_mask \u003d (uint32_t)1 \u003c\u003c phys_sector_num;"},{"line_number":524,"context_line":"\t\t\t*reg \u003d FCTL_REG_CMDWEPROTA;"},{"line_number":525,"context_line":"\t\t\treturn ERROR_OK;"},{"line_number":526,"context_line":"\t\t}"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"407d381c_401299c5","line":523,"updated":"2024-07-14 17:47:42.000000000","message":"`BIT(phys_sector_num)`?\nSame below","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"4cf28bd0446b25ebeae7c1667dbc7fd288f5414e","unresolved":false,"context_lines":[{"line_number":520,"context_line":"\tif (sector_num \u003c mspm0_info-\u003emain_flash_size_kb) {"},{"line_number":521,"context_line":"\t\t/* Use CMDWEPROTA */"},{"line_number":522,"context_line":"\t\tif (phys_sector_num \u003c (uint32_t)32) {"},{"line_number":523,"context_line":"\t\t\t*sector_mask \u003d (uint32_t)1 \u003c\u003c phys_sector_num;"},{"line_number":524,"context_line":"\t\t\t*reg \u003d FCTL_REG_CMDWEPROTA;"},{"line_number":525,"context_line":"\t\t\treturn ERROR_OK;"},{"line_number":526,"context_line":"\t\t}"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"4c151ad3_77808d51","line":523,"in_reply_to":"407d381c_401299c5","updated":"2024-10-28 15:55:42.000000000","message":"Ack","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f7de156dcccadd58bd34773e6950014dadc7a6ba","unresolved":true,"context_lines":[{"line_number":579,"context_line":""},{"line_number":580,"context_line":"\tint retval \u003d ERROR_OK;"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"\tstart_ms \u003d timeval_ms();"},{"line_number":583,"context_line":"\twhile ((return_code \u0026 FCTL_STATCMD_CMDDONE_MASK) !\u003d FCTL_STATCMD_CMDDONE_STATDONE) {"},{"line_number":584,"context_line":"\t\tretval \u003d target_read_u32(target, FCTL_REG_STATCMD, \u0026return_code);"},{"line_number":585,"context_line":"\t\tif (retval !\u003d ERROR_OK)"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"ba733e34_4d4ccf0b","line":582,"range":{"start_line":582,"start_character":12,"end_line":582,"end_character":22},"updated":"2024-07-14 17:47:42.000000000","message":"`timeval_ms()` returns `int64_t`.\nPlease use `int64_t` for `start_ms` and `elapsed_ms` too","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"4cf28bd0446b25ebeae7c1667dbc7fd288f5414e","unresolved":false,"context_lines":[{"line_number":579,"context_line":""},{"line_number":580,"context_line":"\tint retval \u003d ERROR_OK;"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"\tstart_ms \u003d timeval_ms();"},{"line_number":583,"context_line":"\twhile ((return_code \u0026 FCTL_STATCMD_CMDDONE_MASK) !\u003d FCTL_STATCMD_CMDDONE_STATDONE) {"},{"line_number":584,"context_line":"\t\tretval \u003d target_read_u32(target, FCTL_REG_STATCMD, \u0026return_code);"},{"line_number":585,"context_line":"\t\tif (retval !\u003d ERROR_OK)"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"82b659a4_21f1e6bc","line":582,"range":{"start_line":582,"start_character":12,"end_line":582,"end_character":22},"in_reply_to":"ba733e34_4d4ccf0b","updated":"2024-10-28 15:55:42.000000000","message":"Ack","commit_id":"01662afe85cf17d7d3e377dc8f71c67001d97d09"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":18,"context_line":"#include \u003chelper/time_support.h\u003e"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"/* MPM0 Region memory map */"},{"line_number":21,"context_line":"#define MSPM0_FLASH_BASE_NONMAIN\t\t(0x41c00000)"},{"line_number":22,"context_line":"#define MSPM0_FLASH_END_NONMAIN\t\t\t(0x41c00400)"},{"line_number":23,"context_line":"#define MSPM0_FLASH_BASE_MAIN\t\t\t(0x0)"},{"line_number":24,"context_line":"#define MSPM0_FLASH_BASE_DATA\t\t\t(0x41d00000)"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"adf1ec5b_ba9b89fd","line":21,"updated":"2024-11-15 16:03:46.000000000","message":"Parentheses are not necessary for simple values.","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":18,"context_line":"#include \u003chelper/time_support.h\u003e"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"/* MPM0 Region memory map */"},{"line_number":21,"context_line":"#define MSPM0_FLASH_BASE_NONMAIN\t\t(0x41c00000)"},{"line_number":22,"context_line":"#define MSPM0_FLASH_END_NONMAIN\t\t\t(0x41c00400)"},{"line_number":23,"context_line":"#define MSPM0_FLASH_BASE_MAIN\t\t\t(0x0)"},{"line_number":24,"context_line":"#define MSPM0_FLASH_BASE_DATA\t\t\t(0x41d00000)"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"825b560e_b99d7d58","line":21,"in_reply_to":"adf1ec5b_ba9b89fd","updated":"2024-11-26 13:15:37.000000000","message":"Ack","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":90,"context_line":"\tuint32_t traceid;"},{"line_number":91,"context_line":"\tunsigned char version;"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"\t/* Pointer to name */"},{"line_number":94,"context_line":"\tconst char *name;"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"\t/* Decoded flash information */"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"8d0bb31b_d691a145","line":93,"updated":"2024-11-15 16:03:46.000000000","message":"It\u0027s clear that this is a pointer, remove -\u003e e.g. \u0027Device name\u0027. Otherwise, you would need to make such a comment for all your pointer variables.","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":90,"context_line":"\tuint32_t traceid;"},{"line_number":91,"context_line":"\tunsigned char version;"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"\t/* Pointer to name */"},{"line_number":94,"context_line":"\tconst char *name;"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"\t/* Decoded flash information */"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"46336ff9_8ad818ce","line":93,"in_reply_to":"8d0bb31b_d691a145","updated":"2024-11-26 13:15:37.000000000","message":"Ack","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":376,"context_line":"{"},{"line_number":377,"context_line":"\tstruct mspm0_flash_bank *mspm0_info \u003d bank-\u003edriver_priv;"},{"line_number":378,"context_line":"\tstruct target *target \u003d bank-\u003etarget;"},{"line_number":379,"context_line":"\tuint32_t did, userid, flashram, flashdesc;"},{"line_number":380,"context_line":"\tunsigned char minfo_idx \u003d 0xff;"},{"line_number":381,"context_line":"\tunsigned char pinfo_idx \u003d 0xff;"},{"line_number":382,"context_line":"\tunsigned short pnum, part, manufacturer;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"12519162_c3d9cb0f","line":379,"updated":"2024-11-15 16:03:46.000000000","message":"General: do not declare all variables at the top of a function","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":376,"context_line":"{"},{"line_number":377,"context_line":"\tstruct mspm0_flash_bank *mspm0_info \u003d bank-\u003edriver_priv;"},{"line_number":378,"context_line":"\tstruct target *target \u003d bank-\u003etarget;"},{"line_number":379,"context_line":"\tuint32_t did, userid, flashram, flashdesc;"},{"line_number":380,"context_line":"\tunsigned char minfo_idx \u003d 0xff;"},{"line_number":381,"context_line":"\tunsigned char pinfo_idx \u003d 0xff;"},{"line_number":382,"context_line":"\tunsigned short pnum, part, manufacturer;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"006e14b5_0085899d","line":379,"in_reply_to":"12519162_c3d9cb0f","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":856,"context_line":"\tif (mspm0_info-\u003edid \u003d\u003d 0)"},{"line_number":857,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":858,"context_line":""},{"line_number":859,"context_line":"\tfor (i \u003d 0; i \u003c bank-\u003enum_sectors; i++)"},{"line_number":860,"context_line":"\t\tbank-\u003esectors[i].is_protected \u003d -1;"},{"line_number":861,"context_line":""},{"line_number":862,"context_line":"\tif (!mspm0_info-\u003eprotect_reg_count)"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"9e500ba8_4319d5d6","line":859,"updated":"2024-11-15 16:03:46.000000000","message":"Declare \u0027i\u0027 here","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":856,"context_line":"\tif (mspm0_info-\u003edid \u003d\u003d 0)"},{"line_number":857,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":858,"context_line":""},{"line_number":859,"context_line":"\tfor (i \u003d 0; i \u003c bank-\u003enum_sectors; i++)"},{"line_number":860,"context_line":"\t\tbank-\u003esectors[i].is_protected \u003d -1;"},{"line_number":861,"context_line":""},{"line_number":862,"context_line":"\tif (!mspm0_info-\u003eprotect_reg_count)"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"fb6c305c_86e7a1cd","line":859,"in_reply_to":"9e500ba8_4319d5d6","updated":"2024-11-26 13:15:37.000000000","message":"Ack","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":863,"context_line":"\t\treturn ERROR_OK;"},{"line_number":864,"context_line":""},{"line_number":865,"context_line":"\t/* Do a single scan read of regs before we set the status */"},{"line_number":866,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":867,"context_line":"\t\ttarget_read_u32(target,"},{"line_number":868,"context_line":"\t\t\t\tmspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":869,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"4c54c866_2518f2dc","line":866,"updated":"2024-11-15 16:03:46.000000000","message":"Same","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":863,"context_line":"\t\treturn ERROR_OK;"},{"line_number":864,"context_line":""},{"line_number":865,"context_line":"\t/* Do a single scan read of regs before we set the status */"},{"line_number":866,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":867,"context_line":"\t\ttarget_read_u32(target,"},{"line_number":868,"context_line":"\t\t\t\tmspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":869,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"551083f1_f91f0468","line":866,"in_reply_to":"4c54c866_2518f2dc","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":869,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"},{"line_number":870,"context_line":"\t}"},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"\tfor (i \u003d 0; i \u003c bank-\u003enum_sectors; i++) {"},{"line_number":873,"context_line":"\t\tint retval \u003d mspm0_protect_reg_map(bank, i, \u0026protect_reg_offset,"},{"line_number":874,"context_line":"\t\t\t\t\t\t   \u0026protect_reg_bit);"},{"line_number":875,"context_line":"\t\tif (retval) {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"8ae27f8f_d8ffdfa1","line":872,"updated":"2024-11-15 16:03:46.000000000","message":"Same","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":869,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"},{"line_number":870,"context_line":"\t}"},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"\tfor (i \u003d 0; i \u003c bank-\u003enum_sectors; i++) {"},{"line_number":873,"context_line":"\t\tint retval \u003d mspm0_protect_reg_map(bank, i, \u0026protect_reg_offset,"},{"line_number":874,"context_line":"\t\t\t\t\t\t   \u0026protect_reg_bit);"},{"line_number":875,"context_line":"\t\tif (retval) {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"443c3366_26fb4e96","line":872,"in_reply_to":"8ae27f8f_d8ffdfa1","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":908,"context_line":"\t */"},{"line_number":909,"context_line":""},{"line_number":910,"context_line":"\t/* Do a single scan read of regs before we set the status */"},{"line_number":911,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":912,"context_line":"\t\ttarget_read_u32(target,"},{"line_number":913,"context_line":"\t\t\t\tmspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":914,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"7e48dacf_ecd43dee","line":911,"updated":"2024-11-15 16:03:46.000000000","message":"Same","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":908,"context_line":"\t */"},{"line_number":909,"context_line":""},{"line_number":910,"context_line":"\t/* Do a single scan read of regs before we set the status */"},{"line_number":911,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":912,"context_line":"\t\ttarget_read_u32(target,"},{"line_number":913,"context_line":"\t\t\t\tmspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":914,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"b73eb323_29493ba3","line":911,"in_reply_to":"7e48dacf_ecd43dee","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":916,"context_line":"\t/* Flip to binary value */"},{"line_number":917,"context_line":"\tset \u003d !!set;"},{"line_number":918,"context_line":"\t/* Now set the bits that we need to set with */"},{"line_number":919,"context_line":"\tfor (i \u003d first; i \u003c\u003d last; i++) {"},{"line_number":920,"context_line":"\t\tretval \u003d"},{"line_number":921,"context_line":"\t\t    mspm0_protect_reg_map(bank, i, \u0026protect_reg_offset, \u0026protect_reg_bit);"},{"line_number":922,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"037749c2_8549cb52","line":919,"updated":"2024-11-15 16:03:46.000000000","message":"Same","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":916,"context_line":"\t/* Flip to binary value */"},{"line_number":917,"context_line":"\tset \u003d !!set;"},{"line_number":918,"context_line":"\t/* Now set the bits that we need to set with */"},{"line_number":919,"context_line":"\tfor (i \u003d first; i \u003c\u003d last; i++) {"},{"line_number":920,"context_line":"\t\tretval \u003d"},{"line_number":921,"context_line":"\t\t    mspm0_protect_reg_map(bank, i, \u0026protect_reg_offset, \u0026protect_reg_bit);"},{"line_number":922,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"16b1c113_ae0f2b05","line":919,"in_reply_to":"037749c2_8549cb52","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":932,"context_line":"\t\t\tprotect_reg_cache[protect_reg_offset] \u0026\u003d ~BIT(protect_reg_bit);"},{"line_number":933,"context_line":"\t}"},{"line_number":934,"context_line":""},{"line_number":935,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":936,"context_line":"\t\ttarget_write_u32(target,"},{"line_number":937,"context_line":"\t\t\t\t mspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":938,"context_line":"\t\t\t\t protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"02eb646d_25a3aa51","line":935,"updated":"2024-11-15 16:03:46.000000000","message":"Same","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":932,"context_line":"\t\t\tprotect_reg_cache[protect_reg_offset] \u0026\u003d ~BIT(protect_reg_bit);"},{"line_number":933,"context_line":"\t}"},{"line_number":934,"context_line":""},{"line_number":935,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":936,"context_line":"\t\ttarget_write_u32(target,"},{"line_number":937,"context_line":"\t\t\t\t mspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":938,"context_line":"\t\t\t\t protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"a5c2adea_9ad7d62c","line":935,"in_reply_to":"02eb646d_25a3aa51","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":942,"context_line":"\t * Update our local state data base, since single bit can protect up to"},{"line_number":943,"context_line":"\t * 8 sectors in some banks"},{"line_number":944,"context_line":"\t */"},{"line_number":945,"context_line":"\tfor (i \u003d 0; i \u003c bank-\u003enum_sectors; i++) {"},{"line_number":946,"context_line":"\t\tretval \u003d"},{"line_number":947,"context_line":"\t\t    mspm0_protect_reg_map(bank, i, \u0026protect_reg_offset, \u0026protect_reg_bit);"},{"line_number":948,"context_line":"\t\tif (retval) {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"0b37471b_ae44db51","line":945,"updated":"2024-11-15 16:03:46.000000000","message":"Same","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":942,"context_line":"\t * Update our local state data base, since single bit can protect up to"},{"line_number":943,"context_line":"\t * 8 sectors in some banks"},{"line_number":944,"context_line":"\t */"},{"line_number":945,"context_line":"\tfor (i \u003d 0; i \u003c bank-\u003enum_sectors; i++) {"},{"line_number":946,"context_line":"\t\tretval \u003d"},{"line_number":947,"context_line":"\t\t    mspm0_protect_reg_map(bank, i, \u0026protect_reg_offset, \u0026protect_reg_bit);"},{"line_number":948,"context_line":"\t\tif (retval) {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"02e3fbb1_df9a77ea","line":945,"in_reply_to":"0b37471b_ae44db51","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":976,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":977,"context_line":""},{"line_number":978,"context_line":"\t/* Pick a copy of the current protection config for later restoration */"},{"line_number":979,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":980,"context_line":"\t\ttarget_read_u32(target,"},{"line_number":981,"context_line":"\t\t\t\tmspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":982,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"0d561974_2496b20b","line":979,"updated":"2024-11-15 16:03:46.000000000","message":"Also here","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":976,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":977,"context_line":""},{"line_number":978,"context_line":"\t/* Pick a copy of the current protection config for later restoration */"},{"line_number":979,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":980,"context_line":"\t\ttarget_read_u32(target,"},{"line_number":981,"context_line":"\t\t\t\tmspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":982,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"4ad7ae0e_a3e5b1d2","line":979,"in_reply_to":"0d561974_2496b20b","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":1022,"context_line":"\t * Let us just Dump the protection registers back to the system."},{"line_number":1023,"context_line":"\t * That way we retain the protection status as requested by the user"},{"line_number":1024,"context_line":"\t */"},{"line_number":1025,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":1026,"context_line":"\t\ttarget_write_u32(target, mspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":1027,"context_line":"\t\t\t\t protect_reg_cache[i]);"},{"line_number":1028,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"ee9092ef_accab747","line":1025,"updated":"2024-11-15 16:03:46.000000000","message":"And here","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":1022,"context_line":"\t * Let us just Dump the protection registers back to the system."},{"line_number":1023,"context_line":"\t * That way we retain the protection status as requested by the user"},{"line_number":1024,"context_line":"\t */"},{"line_number":1025,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":1026,"context_line":"\t\ttarget_write_u32(target, mspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":1027,"context_line":"\t\t\t\t protect_reg_cache[i]);"},{"line_number":1028,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"5bb4836b_98a63e24","line":1025,"in_reply_to":"ee9092ef_accab747","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":1069,"context_line":"\t * We need to restore these regs after every write, so instead of trying"},{"line_number":1070,"context_line":"\t * to figure things out on the fly, we just context save and restore"},{"line_number":1071,"context_line":"\t */"},{"line_number":1072,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":1073,"context_line":"\t\ttarget_read_u32(target,"},{"line_number":1074,"context_line":"\t\t\t\tmspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":1075,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"11da9b87_99970bfe","line":1072,"updated":"2024-11-15 16:03:46.000000000","message":"Declare \u0027i\u0027 here","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":1069,"context_line":"\t * We need to restore these regs after every write, so instead of trying"},{"line_number":1070,"context_line":"\t * to figure things out on the fly, we just context save and restore"},{"line_number":1071,"context_line":"\t */"},{"line_number":1072,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":1073,"context_line":"\t\ttarget_read_u32(target,"},{"line_number":1074,"context_line":"\t\t\t\tmspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":1075,"context_line":"\t\t\t\t\u0026protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"d53cbf09_f324b6f7","line":1072,"in_reply_to":"11da9b87_99970bfe","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6d557889e2f714fcd11f038ce0a9d88232f9a61b","unresolved":true,"context_lines":[{"line_number":1166,"context_line":"\t * Let us just Dump the protection registers back to the system."},{"line_number":1167,"context_line":"\t * That way we retain the protection status as requested by the user"},{"line_number":1168,"context_line":"\t */"},{"line_number":1169,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":1170,"context_line":"\t\ttarget_write_u32(target,"},{"line_number":1171,"context_line":"\t\t\t\t\t\t mspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":1172,"context_line":"\t\t\t\t\t\t protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"0c247ca2_37b06a8b","line":1169,"updated":"2024-11-15 16:03:46.000000000","message":"Same","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"0b45644476c163350ceab988c756624ef1f246e0","unresolved":false,"context_lines":[{"line_number":1166,"context_line":"\t * Let us just Dump the protection registers back to the system."},{"line_number":1167,"context_line":"\t * That way we retain the protection status as requested by the user"},{"line_number":1168,"context_line":"\t */"},{"line_number":1169,"context_line":"\tfor (i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":1170,"context_line":"\t\ttarget_write_u32(target,"},{"line_number":1171,"context_line":"\t\t\t\t\t\t mspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":1172,"context_line":"\t\t\t\t\t\t protect_reg_cache[i]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"f3bcdc35_a1bcd5cc","line":1169,"in_reply_to":"0c247ca2_37b06a8b","updated":"2024-11-26 13:15:37.000000000","message":"Done","commit_id":"a38ec40239af695eeb579fbf615abf3629e7e40e"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"904a0243cd23ef8483d1310c2f767429f2a12163","unresolved":true,"context_lines":[{"line_number":321,"context_line":"\tstruct mspm0_flash_bank *mspm0_info;"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"\tswitch (bank-\u003ebase) {"},{"line_number":324,"context_line":"\t\tcase MSPM0_FLASH_BASE_NONMAIN:"},{"line_number":325,"context_line":"\t\tcase MSPM0_FLASH_BASE_MAIN:"},{"line_number":326,"context_line":"\t\tcase MSPM0_FLASH_BASE_DATA:"},{"line_number":327,"context_line":"\t\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"2db65c51_18ab090a","line":324,"updated":"2024-12-03 10:56:55.000000000","message":"Your latest patch introduced an additional indentation for all \u0027case\u0027 statements. Please undo this.","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":321,"context_line":"\tstruct mspm0_flash_bank *mspm0_info;"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"\tswitch (bank-\u003ebase) {"},{"line_number":324,"context_line":"\t\tcase MSPM0_FLASH_BASE_NONMAIN:"},{"line_number":325,"context_line":"\t\tcase MSPM0_FLASH_BASE_MAIN:"},{"line_number":326,"context_line":"\t\tcase MSPM0_FLASH_BASE_DATA:"},{"line_number":327,"context_line":"\t\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"f8c71773_3c36bc2e","line":324,"in_reply_to":"2db65c51_18ab090a","updated":"2025-01-28 17:36:33.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"904a0243cd23ef8483d1310c2f767429f2a12163","unresolved":true,"context_lines":[{"line_number":377,"context_line":"{"},{"line_number":378,"context_line":"\tstruct mspm0_flash_bank *mspm0_info \u003d bank-\u003edriver_priv;"},{"line_number":379,"context_line":"\tstruct target *target \u003d bank-\u003etarget;"},{"line_number":380,"context_line":"\tuint32_t did, userid, flashram, flashdesc;"},{"line_number":381,"context_line":"\tunsigned char minfo_idx \u003d 0xff;"},{"line_number":382,"context_line":"\tunsigned char pinfo_idx \u003d 0xff;"},{"line_number":383,"context_line":"\tunsigned char probe_status \u003d MSPM0_NO_ID_FOUND;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"eaca572f_4015d963","line":380,"updated":"2024-12-03 10:56:55.000000000","message":"As mentioned in my first review, move all variables as close as possible to where they are used in the code. No general \u0027declaration block\u0027 at the beginning of a function.","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":377,"context_line":"{"},{"line_number":378,"context_line":"\tstruct mspm0_flash_bank *mspm0_info \u003d bank-\u003edriver_priv;"},{"line_number":379,"context_line":"\tstruct target *target \u003d bank-\u003etarget;"},{"line_number":380,"context_line":"\tuint32_t did, userid, flashram, flashdesc;"},{"line_number":381,"context_line":"\tunsigned char minfo_idx \u003d 0xff;"},{"line_number":382,"context_line":"\tunsigned char pinfo_idx \u003d 0xff;"},{"line_number":383,"context_line":"\tunsigned char probe_status \u003d MSPM0_NO_ID_FOUND;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"ddcb7b1f_db5cc3bc","line":380,"in_reply_to":"eaca572f_4015d963","updated":"2025-01-28 17:36:33.000000000","message":"Done for as many as found","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"904a0243cd23ef8483d1310c2f767429f2a12163","unresolved":true,"context_lines":[{"line_number":534,"context_line":"\t{ 12, \"FAILMISC\" },"},{"line_number":535,"context_line":"};"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"static void msmp0_fctl_translate_ret_err(unsigned int return_code, char *ret_str)"},{"line_number":538,"context_line":"{"},{"line_number":539,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c ARRAY_SIZE(mspm0_fctl_fail_decode_strings); i++) {"},{"line_number":540,"context_line":"\t\tif (return_code \u0026 BIT(mspm0_fctl_fail_decode_strings[i].bit_offset)) {"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"7b579ce7_0a08d41a","line":537,"updated":"2024-12-03 10:56:55.000000000","message":"Typo? msmp0_ -\u003e mspm0_?","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"904a0243cd23ef8483d1310c2f767429f2a12163","unresolved":true,"context_lines":[{"line_number":534,"context_line":"\t{ 12, \"FAILMISC\" },"},{"line_number":535,"context_line":"};"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"static void msmp0_fctl_translate_ret_err(unsigned int return_code, char *ret_str)"},{"line_number":538,"context_line":"{"},{"line_number":539,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c ARRAY_SIZE(mspm0_fctl_fail_decode_strings); i++) {"},{"line_number":540,"context_line":"\t\tif (return_code \u0026 BIT(mspm0_fctl_fail_decode_strings[i].bit_offset)) {"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"ceaec311_f25c46cc","line":537,"range":{"start_line":537,"start_character":12,"end_line":537,"end_character":40},"updated":"2024-12-03 10:56:55.000000000","message":"Why do you need the additional blankspace at the end of the string? If there is no reason, remove the `strncat` and redelcare this function as `static const char *` and directly return the string you need.","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":534,"context_line":"\t{ 12, \"FAILMISC\" },"},{"line_number":535,"context_line":"};"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"static void msmp0_fctl_translate_ret_err(unsigned int return_code, char *ret_str)"},{"line_number":538,"context_line":"{"},{"line_number":539,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c ARRAY_SIZE(mspm0_fctl_fail_decode_strings); i++) {"},{"line_number":540,"context_line":"\t\tif (return_code \u0026 BIT(mspm0_fctl_fail_decode_strings[i].bit_offset)) {"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"e75a30fb_c760984d","line":537,"in_reply_to":"7b579ce7_0a08d41a","updated":"2025-01-28 17:36:33.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":534,"context_line":"\t{ 12, \"FAILMISC\" },"},{"line_number":535,"context_line":"};"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"static void msmp0_fctl_translate_ret_err(unsigned int return_code, char *ret_str)"},{"line_number":538,"context_line":"{"},{"line_number":539,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c ARRAY_SIZE(mspm0_fctl_fail_decode_strings); i++) {"},{"line_number":540,"context_line":"\t\tif (return_code \u0026 BIT(mspm0_fctl_fail_decode_strings[i].bit_offset)) {"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"8f13e6ca_ebf46bca","line":537,"range":{"start_line":537,"start_character":12,"end_line":537,"end_character":40},"in_reply_to":"ceaec311_f25c46cc","updated":"2025-01-28 17:36:33.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"904a0243cd23ef8483d1310c2f767429f2a12163","unresolved":true,"context_lines":[{"line_number":724,"context_line":"\treturn retval;"},{"line_number":725,"context_line":"}"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":"static int msmp0_fctl_wait_cmd_ok(struct flash_bank *bank)"},{"line_number":728,"context_line":"{"},{"line_number":729,"context_line":"\tstruct target *target \u003d bank-\u003etarget;"},{"line_number":730,"context_line":"\tstruct mspm0_flash_bank *mspm0_info \u003d bank-\u003edriver_priv;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"795b0d71_dd08cc76","line":727,"updated":"2024-12-03 10:56:55.000000000","message":"Typo? msmp0_ -\u003e mspm0_?","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":724,"context_line":"\treturn retval;"},{"line_number":725,"context_line":"}"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":"static int msmp0_fctl_wait_cmd_ok(struct flash_bank *bank)"},{"line_number":728,"context_line":"{"},{"line_number":729,"context_line":"\tstruct target *target \u003d bank-\u003etarget;"},{"line_number":730,"context_line":"\tstruct mspm0_flash_bank *mspm0_info \u003d bank-\u003edriver_priv;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"0336060c_29f7e8e4","line":727,"in_reply_to":"795b0d71_dd08cc76","updated":"2025-01-28 17:36:33.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"904a0243cd23ef8483d1310c2f767429f2a12163","unresolved":true,"context_lines":[{"line_number":833,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":834,"context_line":"\t}"},{"line_number":835,"context_line":"\t*protect_reg_offset \u003d 2;"},{"line_number":836,"context_line":"\t*protect_reg_bit \u003d (sector_in_bank - 256) / 8;"},{"line_number":837,"context_line":"\treturn ERROR_OK;"},{"line_number":838,"context_line":"}"},{"line_number":839,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":4,"id":"97948c94_71f6f439","line":836,"updated":"2024-12-03 10:56:55.000000000","message":"Add a blank line before the return statement.","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":833,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":834,"context_line":"\t}"},{"line_number":835,"context_line":"\t*protect_reg_offset \u003d 2;"},{"line_number":836,"context_line":"\t*protect_reg_bit \u003d (sector_in_bank - 256) / 8;"},{"line_number":837,"context_line":"\treturn ERROR_OK;"},{"line_number":838,"context_line":"}"},{"line_number":839,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":4,"id":"9ff255bf_cc44fcfd","line":836,"in_reply_to":"97948c94_71f6f439","updated":"2025-01-28 17:36:33.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"bc5754ce1021cdefbde8eb5a9c7e16fca54edb7f","unresolved":true,"context_lines":[{"line_number":1126,"context_line":"\tif (mspm0_info-\u003edid \u003d\u003d 0)"},{"line_number":1127,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":1128,"context_line":""},{"line_number":1129,"context_line":"\tif (offset % mspm0_info-\u003eflash_word_size_bytes) {"},{"line_number":1130,"context_line":"\t\tLOG_ERROR(\"%s: Offset 0x%0\" PRIx32 \" Must be aligned to %d bytes\","},{"line_number":1131,"context_line":"\t\t\tmspm0_info-\u003ename, offset, mspm0_info-\u003eflash_word_size_bytes);"},{"line_number":1132,"context_line":"\t\treturn ERROR_FLASH_DST_BREAKS_ALIGNMENT;"},{"line_number":1133,"context_line":"\t}"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"\t/*"},{"line_number":1136,"context_line":"\t * Pick a copy of the current protection config for later restoration"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"c1d51e40_c670870a","line":1133,"range":{"start_line":1129,"start_character":1,"end_line":1133,"end_character":2},"updated":"2025-01-03 21:31:15.000000000","message":"Set bank-\u003ewrite_start_alignment and write_end_alignment instead","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"292fe116caf73eaf32e23ef3a54e22d57780706c","unresolved":true,"context_lines":[{"line_number":1126,"context_line":"\tif (mspm0_info-\u003edid \u003d\u003d 0)"},{"line_number":1127,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":1128,"context_line":""},{"line_number":1129,"context_line":"\tif (offset % mspm0_info-\u003eflash_word_size_bytes) {"},{"line_number":1130,"context_line":"\t\tLOG_ERROR(\"%s: Offset 0x%0\" PRIx32 \" Must be aligned to %d bytes\","},{"line_number":1131,"context_line":"\t\t\tmspm0_info-\u003ename, offset, mspm0_info-\u003eflash_word_size_bytes);"},{"line_number":1132,"context_line":"\t\treturn ERROR_FLASH_DST_BREAKS_ALIGNMENT;"},{"line_number":1133,"context_line":"\t}"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"\t/*"},{"line_number":1136,"context_line":"\t * Pick a copy of the current protection config for later restoration"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"8baf2458_ad8ae7ee","line":1133,"range":{"start_line":1129,"start_character":1,"end_line":1133,"end_character":2},"in_reply_to":"0ba542f2_d90931f4","updated":"2025-01-31 03:17:01.000000000","message":"I meant: remove the marked check and instead of it introduce setting of `bank-\u003ewrite_start_alignment` and `write_end_alignment` in flash_bank_command or probe. See doc for details or grep for the variables in other flash drivers!","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"e1175bb31eec2d9baa85f9b6018721870f86462b","unresolved":false,"context_lines":[{"line_number":1126,"context_line":"\tif (mspm0_info-\u003edid \u003d\u003d 0)"},{"line_number":1127,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":1128,"context_line":""},{"line_number":1129,"context_line":"\tif (offset % mspm0_info-\u003eflash_word_size_bytes) {"},{"line_number":1130,"context_line":"\t\tLOG_ERROR(\"%s: Offset 0x%0\" PRIx32 \" Must be aligned to %d bytes\","},{"line_number":1131,"context_line":"\t\t\tmspm0_info-\u003ename, offset, mspm0_info-\u003eflash_word_size_bytes);"},{"line_number":1132,"context_line":"\t\treturn ERROR_FLASH_DST_BREAKS_ALIGNMENT;"},{"line_number":1133,"context_line":"\t}"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"\t/*"},{"line_number":1136,"context_line":"\t * Pick a copy of the current protection config for later restoration"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"2610d464_feb0c999","line":1133,"range":{"start_line":1129,"start_character":1,"end_line":1133,"end_character":2},"in_reply_to":"1f5bcc32_cffa326e","updated":"2025-02-07 01:15:08.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"367804f32139d69b888a52eb201abbc9cfedcfe9","unresolved":true,"context_lines":[{"line_number":1126,"context_line":"\tif (mspm0_info-\u003edid \u003d\u003d 0)"},{"line_number":1127,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":1128,"context_line":""},{"line_number":1129,"context_line":"\tif (offset % mspm0_info-\u003eflash_word_size_bytes) {"},{"line_number":1130,"context_line":"\t\tLOG_ERROR(\"%s: Offset 0x%0\" PRIx32 \" Must be aligned to %d bytes\","},{"line_number":1131,"context_line":"\t\t\tmspm0_info-\u003ename, offset, mspm0_info-\u003eflash_word_size_bytes);"},{"line_number":1132,"context_line":"\t\treturn ERROR_FLASH_DST_BREAKS_ALIGNMENT;"},{"line_number":1133,"context_line":"\t}"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"\t/*"},{"line_number":1136,"context_line":"\t * Pick a copy of the current protection config for later restoration"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"d0762083_243901a4","line":1133,"range":{"start_line":1129,"start_character":1,"end_line":1133,"end_character":2},"in_reply_to":"8baf2458_ad8ae7ee","updated":"2025-02-05 22:22:15.000000000","message":"Sorry, could you explain what you mean exactly?","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":1126,"context_line":"\tif (mspm0_info-\u003edid \u003d\u003d 0)"},{"line_number":1127,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":1128,"context_line":""},{"line_number":1129,"context_line":"\tif (offset % mspm0_info-\u003eflash_word_size_bytes) {"},{"line_number":1130,"context_line":"\t\tLOG_ERROR(\"%s: Offset 0x%0\" PRIx32 \" Must be aligned to %d bytes\","},{"line_number":1131,"context_line":"\t\t\tmspm0_info-\u003ename, offset, mspm0_info-\u003eflash_word_size_bytes);"},{"line_number":1132,"context_line":"\t\treturn ERROR_FLASH_DST_BREAKS_ALIGNMENT;"},{"line_number":1133,"context_line":"\t}"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"\t/*"},{"line_number":1136,"context_line":"\t * Pick a copy of the current protection config for later restoration"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"0ba542f2_d90931f4","line":1133,"range":{"start_line":1129,"start_character":1,"end_line":1133,"end_character":2},"in_reply_to":"c1d51e40_c670870a","updated":"2025-01-28 17:36:33.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"e70a89981a783bb7ca84f064216a4d97639ef09e","unresolved":true,"context_lines":[{"line_number":1126,"context_line":"\tif (mspm0_info-\u003edid \u003d\u003d 0)"},{"line_number":1127,"context_line":"\t\treturn ERROR_FLASH_BANK_NOT_PROBED;"},{"line_number":1128,"context_line":""},{"line_number":1129,"context_line":"\tif (offset % mspm0_info-\u003eflash_word_size_bytes) {"},{"line_number":1130,"context_line":"\t\tLOG_ERROR(\"%s: Offset 0x%0\" PRIx32 \" Must be aligned to %d bytes\","},{"line_number":1131,"context_line":"\t\t\tmspm0_info-\u003ename, offset, mspm0_info-\u003eflash_word_size_bytes);"},{"line_number":1132,"context_line":"\t\treturn ERROR_FLASH_DST_BREAKS_ALIGNMENT;"},{"line_number":1133,"context_line":"\t}"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"\t/*"},{"line_number":1136,"context_line":"\t * Pick a copy of the current protection config for later restoration"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"1f5bcc32_cffa326e","line":1133,"range":{"start_line":1129,"start_character":1,"end_line":1133,"end_character":2},"in_reply_to":"d0762083_243901a4","updated":"2025-02-06 02:45:34.000000000","message":"I completely misread the comment apologies :)\n\nI see what you mean now regarding the error catch rather than doing that force the alignment upon every write with the start/end alignment variable within the bank struct","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"bc5754ce1021cdefbde8eb5a9c7e16fca54edb7f","unresolved":true,"context_lines":[{"line_number":1149,"context_line":"\t}"},{"line_number":1150,"context_line":""},{"line_number":1151,"context_line":"\t/* Add proper memory offset for bank being written to */"},{"line_number":1152,"context_line":"\tswitch (bank-\u003ebase) {"},{"line_number":1153,"context_line":"\t\tcase MSPM0_FLASH_BASE_MAIN:"},{"line_number":1154,"context_line":"\t\t\taddr +\u003d MSPM0_FLASH_BASE_MAIN;"},{"line_number":1155,"context_line":"\t\t\tbreak;"},{"line_number":1156,"context_line":"\t\tcase MSPM0_FLASH_BASE_NONMAIN:"},{"line_number":1157,"context_line":"\t\t\taddr +\u003d MSPM0_FLASH_BASE_NONMAIN;"},{"line_number":1158,"context_line":"\t\t\tbreak;"},{"line_number":1159,"context_line":"\t\tcase MSPM0_FLASH_BASE_DATA:"},{"line_number":1160,"context_line":"\t\t\taddr +\u003d MSPM0_FLASH_BASE_DATA;"},{"line_number":1161,"context_line":"\t\t\tbreak;"},{"line_number":1162,"context_line":"\t\tdefault:"},{"line_number":1163,"context_line":"\t\t\tLOG_ERROR(\"%s: Invalid bank of memory\", mspm0_info-\u003ename);"},{"line_number":1164,"context_line":"\t\t\treturn ERROR_FLASH_BANK_INVALID;"},{"line_number":1165,"context_line":"\t}"},{"line_number":1166,"context_line":""},{"line_number":1167,"context_line":"\twhile (count) {"},{"line_number":1168,"context_line":"\t\tunsigned int num_bytes_to_write;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"8721af07_a15f4023","line":1165,"range":{"start_line":1152,"start_character":1,"end_line":1165,"end_character":2},"updated":"2025-01-03 21:31:15.000000000","message":"Probe checks base addr. Simplify to\n```\n addr \u003d bank-\u003ebase + offset;\n```","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":1149,"context_line":"\t}"},{"line_number":1150,"context_line":""},{"line_number":1151,"context_line":"\t/* Add proper memory offset for bank being written to */"},{"line_number":1152,"context_line":"\tswitch (bank-\u003ebase) {"},{"line_number":1153,"context_line":"\t\tcase MSPM0_FLASH_BASE_MAIN:"},{"line_number":1154,"context_line":"\t\t\taddr +\u003d MSPM0_FLASH_BASE_MAIN;"},{"line_number":1155,"context_line":"\t\t\tbreak;"},{"line_number":1156,"context_line":"\t\tcase MSPM0_FLASH_BASE_NONMAIN:"},{"line_number":1157,"context_line":"\t\t\taddr +\u003d MSPM0_FLASH_BASE_NONMAIN;"},{"line_number":1158,"context_line":"\t\t\tbreak;"},{"line_number":1159,"context_line":"\t\tcase MSPM0_FLASH_BASE_DATA:"},{"line_number":1160,"context_line":"\t\t\taddr +\u003d MSPM0_FLASH_BASE_DATA;"},{"line_number":1161,"context_line":"\t\t\tbreak;"},{"line_number":1162,"context_line":"\t\tdefault:"},{"line_number":1163,"context_line":"\t\t\tLOG_ERROR(\"%s: Invalid bank of memory\", mspm0_info-\u003ename);"},{"line_number":1164,"context_line":"\t\t\treturn ERROR_FLASH_BANK_INVALID;"},{"line_number":1165,"context_line":"\t}"},{"line_number":1166,"context_line":""},{"line_number":1167,"context_line":"\twhile (count) {"},{"line_number":1168,"context_line":"\t\tunsigned int num_bytes_to_write;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"8783ce9b_812904f2","line":1165,"range":{"start_line":1152,"start_character":1,"end_line":1165,"end_character":2},"in_reply_to":"8721af07_a15f4023","updated":"2025-01-28 17:36:33.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"bc5754ce1021cdefbde8eb5a9c7e16fca54edb7f","unresolved":true,"context_lines":[{"line_number":1176,"context_line":"\t\t * NOTE: we are going to assume the device does not support multi-word"},{"line_number":1177,"context_line":"\t\t * programming - there does not seem to be discoverability!"},{"line_number":1178,"context_line":"\t\t */"},{"line_number":1179,"context_line":"\t\tif (count \u003c mspm0_info-\u003eflash_word_size_bytes)"},{"line_number":1180,"context_line":"\t\t\tnum_bytes_to_write \u003d count % mspm0_info-\u003eflash_word_size_bytes;"},{"line_number":1181,"context_line":"\t\telse"},{"line_number":1182,"context_line":"\t\t\tnum_bytes_to_write \u003d mspm0_info-\u003eflash_word_size_bytes;"},{"line_number":1183,"context_line":""},{"line_number":1184,"context_line":"\t\t/* Data bytes to write */"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"78e9021d_dc2e2139","line":1181,"range":{"start_line":1179,"start_character":2,"end_line":1181,"end_character":6},"updated":"2025-01-03 21:31:15.000000000","message":"Does division remainder make sense?\n```\nif (count \u003c divisor)\n    result \u003d count % divisor;\n```\nisn\u0027t it same as\n```\nif (count \u003c divisor)\n    result \u003d count;\n```","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"\t\t * NOTE: we are going to assume the device does not support multi-word"},{"line_number":1177,"context_line":"\t\t * programming - there does not seem to be discoverability!"},{"line_number":1178,"context_line":"\t\t */"},{"line_number":1179,"context_line":"\t\tif (count \u003c mspm0_info-\u003eflash_word_size_bytes)"},{"line_number":1180,"context_line":"\t\t\tnum_bytes_to_write \u003d count % mspm0_info-\u003eflash_word_size_bytes;"},{"line_number":1181,"context_line":"\t\telse"},{"line_number":1182,"context_line":"\t\t\tnum_bytes_to_write \u003d mspm0_info-\u003eflash_word_size_bytes;"},{"line_number":1183,"context_line":""},{"line_number":1184,"context_line":"\t\t/* Data bytes to write */"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"5cbc33ac_34a498ce","line":1181,"range":{"start_line":1179,"start_character":2,"end_line":1181,"end_character":6},"in_reply_to":"78e9021d_dc2e2139","updated":"2025-01-28 17:36:33.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"904a0243cd23ef8483d1310c2f767429f2a12163","unresolved":true,"context_lines":[{"line_number":1212,"context_line":"\t\t\tuint32_t write_value;"},{"line_number":1213,"context_line":""},{"line_number":1214,"context_line":"\t\t\t/* Make sure alignments are handled correctly */"},{"line_number":1215,"context_line":"\t\t\t(void)memcpy(\u0026write_value, buffer, sizeof(unsigned int));"},{"line_number":1216,"context_line":""},{"line_number":1217,"context_line":"\t\t\tretval \u003d target_write_u32(target, data_reg, write_value);"},{"line_number":1218,"context_line":"\t\t\tif (retval)"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"ddc129b8_499d958a","line":1215,"updated":"2024-12-03 10:56:55.000000000","message":"`write_value` is of type `uin32_t` but you use `sizeof(unsigned int)`, why?","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":1212,"context_line":"\t\t\tuint32_t write_value;"},{"line_number":1213,"context_line":""},{"line_number":1214,"context_line":"\t\t\t/* Make sure alignments are handled correctly */"},{"line_number":1215,"context_line":"\t\t\t(void)memcpy(\u0026write_value, buffer, sizeof(unsigned int));"},{"line_number":1216,"context_line":""},{"line_number":1217,"context_line":"\t\t\tretval \u003d target_write_u32(target, data_reg, write_value);"},{"line_number":1218,"context_line":"\t\t\tif (retval)"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"ed203862_567b311d","line":1215,"in_reply_to":"c116bd54_6f21e4ea","updated":"2025-01-28 17:36:33.000000000","message":"Done","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"bc5754ce1021cdefbde8eb5a9c7e16fca54edb7f","unresolved":true,"context_lines":[{"line_number":1212,"context_line":"\t\t\tuint32_t write_value;"},{"line_number":1213,"context_line":""},{"line_number":1214,"context_line":"\t\t\t/* Make sure alignments are handled correctly */"},{"line_number":1215,"context_line":"\t\t\t(void)memcpy(\u0026write_value, buffer, sizeof(unsigned int));"},{"line_number":1216,"context_line":""},{"line_number":1217,"context_line":"\t\t\tretval \u003d target_write_u32(target, data_reg, write_value);"},{"line_number":1218,"context_line":"\t\t\tif (retval)"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"c116bd54_6f21e4ea","line":1215,"in_reply_to":"ddc129b8_499d958a","updated":"2025-01-03 21:31:15.000000000","message":"Moreover `memcpy()` from uint8_t * buffer to uint32_t variable is clearly an endianness bug.\n\nThe inner loop should be replaced by one `target_memory_write()` - it will be faster and no need to convert byte order.","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"904a0243cd23ef8483d1310c2f767429f2a12163","unresolved":true,"context_lines":[{"line_number":1219,"context_line":"\t\t\t\treturn retval;"},{"line_number":1220,"context_line":"\t\t\tsub_count \u003d"},{"line_number":1221,"context_line":"\t\t\t\t(num_bytes_to_write \u003c"},{"line_number":1222,"context_line":"\t\t\t\tsizeof(unsigned int)) ? num_bytes_to_write : 4;"},{"line_number":1223,"context_line":"\t\t\tbuffer +\u003d sub_count;"},{"line_number":1224,"context_line":"\t\t\tdata_reg +\u003d sub_count;"},{"line_number":1225,"context_line":"\t\t\tnum_bytes_to_write -\u003d sub_count;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"8eb30df3_73240ac0","line":1222,"updated":"2024-12-03 10:56:55.000000000","message":"Probably the same bug here?","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"d8857d222ca9a68c8523e05fd290fe3fe37cd234","unresolved":false,"context_lines":[{"line_number":1219,"context_line":"\t\t\t\treturn retval;"},{"line_number":1220,"context_line":"\t\t\tsub_count \u003d"},{"line_number":1221,"context_line":"\t\t\t\t(num_bytes_to_write \u003c"},{"line_number":1222,"context_line":"\t\t\t\tsizeof(unsigned int)) ? num_bytes_to_write : 4;"},{"line_number":1223,"context_line":"\t\t\tbuffer +\u003d sub_count;"},{"line_number":1224,"context_line":"\t\t\tdata_reg +\u003d sub_count;"},{"line_number":1225,"context_line":"\t\t\tnum_bytes_to_write -\u003d sub_count;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"4ab30c08_5452eb85","line":1222,"in_reply_to":"8eb30df3_73240ac0","updated":"2025-01-28 17:36:33.000000000","message":"In fact, this gets dropped with target_memory_write since we do not need to go through the loop anymore 😊","commit_id":"e1ff327c7980b0f34e0dc0ce56bf63788f655214"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"292fe116caf73eaf32e23ef3a54e22d57780706c","unresolved":true,"context_lines":[{"line_number":1026,"context_line":"\t\tif (retval)"},{"line_number":1027,"context_line":"\t\t\treturn retval;"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"\t\tretval \u003d target_write_memory(target, FCTL_REG_CMDDATA0, 1, num_bytes_to_write, buffer);"},{"line_number":1030,"context_line":"\t\tif (retval)"},{"line_number":1031,"context_line":"\t\t\treturn retval;"},{"line_number":1032,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":6,"id":"b9cd26f3_597a4f07","line":1029,"range":{"start_line":1029,"start_character":58,"end_line":1029,"end_character":79},"updated":"2025-01-31 03:17:01.000000000","message":"Do you really want to write bytes? Check target_memory_write() doc.\nTo keep writing by 32-bit words as was in the previous code use\n`target_write_memory(target, FCTL_REG_CMDDATA0, 4, num_bytes_to_write / 4, buffer)`","commit_id":"5268e63f8b4e05ac79b09b4e1277ad68b2e3c116"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"a8672f617309810892855f2017de7009820a12d4","unresolved":true,"context_lines":[{"line_number":1026,"context_line":"\t\tif (retval)"},{"line_number":1027,"context_line":"\t\t\treturn retval;"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"\t\tretval \u003d target_write_memory(target, FCTL_REG_CMDDATA0, 1, num_bytes_to_write, buffer);"},{"line_number":1030,"context_line":"\t\tif (retval)"},{"line_number":1031,"context_line":"\t\t\treturn retval;"},{"line_number":1032,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":6,"id":"a86f0c4b_c604be4a","line":1029,"range":{"start_line":1029,"start_character":58,"end_line":1029,"end_character":79},"in_reply_to":"3beb13a5_4b208126","updated":"2025-02-06 16:47:13.000000000","message":"Well, if `FCTL_REG_CMDDATAx` registers support byte-wise write and `bytes_en` value ensures that no uninitialized byte from `FCTL_REG_CMDDATAx` will be written to flash, then it could be. If transfer unit (b/h/w) doesn\u0027t matter, use `target_write_buffer()` - it will select the biggest possible size.","commit_id":"5268e63f8b4e05ac79b09b4e1277ad68b2e3c116"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"e1175bb31eec2d9baa85f9b6018721870f86462b","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"\t\tif (retval)"},{"line_number":1027,"context_line":"\t\t\treturn retval;"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"\t\tretval \u003d target_write_memory(target, FCTL_REG_CMDDATA0, 1, num_bytes_to_write, buffer);"},{"line_number":1030,"context_line":"\t\tif (retval)"},{"line_number":1031,"context_line":"\t\t\treturn retval;"},{"line_number":1032,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":6,"id":"c9bf8081_7c4707d7","line":1029,"range":{"start_line":1029,"start_character":58,"end_line":1029,"end_character":79},"in_reply_to":"a86f0c4b_c604be4a","updated":"2025-02-07 01:15:08.000000000","message":"Done","commit_id":"5268e63f8b4e05ac79b09b4e1277ad68b2e3c116"},{"author":{"_account_id":1002327,"name":"Henry Nguyen","email":"h-nguyen8@ti.com","username":"HenryNguyen01"},"change_message_id":"b5e77003e8622c40516bc53e86886a7a254c5740","unresolved":true,"context_lines":[{"line_number":1026,"context_line":"\t\tif (retval)"},{"line_number":1027,"context_line":"\t\t\treturn retval;"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"\t\tretval \u003d target_write_memory(target, FCTL_REG_CMDDATA0, 1, num_bytes_to_write, buffer);"},{"line_number":1030,"context_line":"\t\tif (retval)"},{"line_number":1031,"context_line":"\t\t\treturn retval;"},{"line_number":1032,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":6,"id":"3beb13a5_4b208126","line":1029,"range":{"start_line":1029,"start_character":58,"end_line":1029,"end_character":79},"in_reply_to":"b9cd26f3_597a4f07","updated":"2025-02-06 15:54:50.000000000","message":"While I do agree that the approach would be faster, would it not be better to keep it as is instead? The way I read the API documentation is we will write an x amount of y sized bytes.\n\nDoing it in the method highlighted removes the dependency of num_bytes_to_write being a multiple of 4.","commit_id":"5268e63f8b4e05ac79b09b4e1277ad68b2e3c116"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":true,"context_lines":[{"line_number":549,"context_line":"\t}"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"\t/* If unknown error notify the user*/"},{"line_number":552,"context_line":"\treturn (\"FAILUNKNOWN\");"},{"line_number":553,"context_line":"}"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"static int mspm0_fctl_get_sector_reg(struct flash_bank *bank, unsigned int addr,"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"45b37dc5_21b590d7","line":552,"updated":"2025-02-16 09:55:19.000000000","message":"Return \u0027(\u0027 here.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[{"line_number":549,"context_line":"\t}"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"\t/* If unknown error notify the user*/"},{"line_number":552,"context_line":"\treturn (\"FAILUNKNOWN\");"},{"line_number":553,"context_line":"}"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"static int mspm0_fctl_get_sector_reg(struct flash_bank *bank, unsigned int addr,"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"16453bc9_d94c0326","line":552,"in_reply_to":"45b37dc5_21b590d7","updated":"2025-02-19 16:31:51.000000000","message":"Dropped the \"(\" and \")\"","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":true,"context_lines":[{"line_number":689,"context_line":"\tret \u003d mspm0_address_check(bank, addr);"},{"line_number":690,"context_line":"\tswitch (ret) {"},{"line_number":691,"context_line":"\tcase ERROR_FLASH_SECTOR_INVALID:"},{"line_number":692,"context_line":"\t\tLOG_ERROR(\"%s: Unable to map sector protect reg for address 0x%08\" PRIx32,"},{"line_number":693,"context_line":"\t\tmspm0_info-\u003ename, addr);"},{"line_number":694,"context_line":"\t\tbreak;"},{"line_number":695,"context_line":"\tcase ERROR_FLASH_DST_OUT_OF_BANK:"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"637af7fa_52a70c48","line":692,"updated":"2025-02-16 09:55:19.000000000","message":"Please do not prefix all log message with the part name. The part name is quite long and provides no additional information to the user - there is only a single flash bank.\n\nSame for almost all LOG_XXX() functions.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[{"line_number":689,"context_line":"\tret \u003d mspm0_address_check(bank, addr);"},{"line_number":690,"context_line":"\tswitch (ret) {"},{"line_number":691,"context_line":"\tcase ERROR_FLASH_SECTOR_INVALID:"},{"line_number":692,"context_line":"\t\tLOG_ERROR(\"%s: Unable to map sector protect reg for address 0x%08\" PRIx32,"},{"line_number":693,"context_line":"\t\tmspm0_info-\u003ename, addr);"},{"line_number":694,"context_line":"\t\tbreak;"},{"line_number":695,"context_line":"\tcase ERROR_FLASH_DST_OUT_OF_BANK:"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"7f5a9df1_50312ffd","line":692,"in_reply_to":"637af7fa_52a70c48","updated":"2025-02-19 16:31:51.000000000","message":"Ack","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":true,"context_lines":[{"line_number":739,"context_line":"\tint64_t start_ms;"},{"line_number":740,"context_line":"\tint64_t elapsed_ms;"},{"line_number":741,"context_line":""},{"line_number":742,"context_line":"\tint retval \u003d ERROR_OK;"},{"line_number":743,"context_line":""},{"line_number":744,"context_line":"\tstart_ms \u003d timeval_ms();"},{"line_number":745,"context_line":"\twhile ((return_code \u0026 FCTL_STATCMD_CMDDONE_MASK) !\u003d FCTL_STATCMD_CMDDONE_STATDONE) {"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"53615d6a_a5ee110d","line":742,"updated":"2025-02-16 09:55:19.000000000","message":"Default value of \u0027retval\u0027 is never used.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[{"line_number":739,"context_line":"\tint64_t start_ms;"},{"line_number":740,"context_line":"\tint64_t elapsed_ms;"},{"line_number":741,"context_line":""},{"line_number":742,"context_line":"\tint retval \u003d ERROR_OK;"},{"line_number":743,"context_line":""},{"line_number":744,"context_line":"\tstart_ms \u003d timeval_ms();"},{"line_number":745,"context_line":"\twhile ((return_code \u0026 FCTL_STATCMD_CMDDONE_MASK) !\u003d FCTL_STATCMD_CMDDONE_STATDONE) {"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"f6d6c7a2_01fca4ec","line":742,"in_reply_to":"53615d6a_a5ee110d","updated":"2025-02-19 16:31:51.000000000","message":"Done","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":true,"context_lines":[{"line_number":743,"context_line":""},{"line_number":744,"context_line":"\tstart_ms \u003d timeval_ms();"},{"line_number":745,"context_line":"\twhile ((return_code \u0026 FCTL_STATCMD_CMDDONE_MASK) !\u003d FCTL_STATCMD_CMDDONE_STATDONE) {"},{"line_number":746,"context_line":"\t\tretval \u003d target_read_u32(target, FCTL_REG_STATCMD, \u0026return_code);"},{"line_number":747,"context_line":"\t\tif (retval !\u003d ERROR_OK)"},{"line_number":748,"context_line":"\t\t\treturn retval;"},{"line_number":749,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"53567b2c_faf47efb","line":746,"updated":"2025-02-16 09:55:19.000000000","message":"retval can be declared here.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[{"line_number":743,"context_line":""},{"line_number":744,"context_line":"\tstart_ms \u003d timeval_ms();"},{"line_number":745,"context_line":"\twhile ((return_code \u0026 FCTL_STATCMD_CMDDONE_MASK) !\u003d FCTL_STATCMD_CMDDONE_STATDONE) {"},{"line_number":746,"context_line":"\t\tretval \u003d target_read_u32(target, FCTL_REG_STATCMD, \u0026return_code);"},{"line_number":747,"context_line":"\t\tif (retval !\u003d ERROR_OK)"},{"line_number":748,"context_line":"\t\t\treturn retval;"},{"line_number":749,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"87da6003_cdde88c7","line":746,"in_reply_to":"53567b2c_faf47efb","updated":"2025-02-19 16:31:51.000000000","message":"Done","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":true,"context_lines":[{"line_number":790,"context_line":"\t * erase operation. Unfortunately, this means that we cannot do a unitary"},{"line_number":791,"context_line":"\t * unprotect operation independent of flash erase operation"},{"line_number":792,"context_line":"\t */"},{"line_number":793,"context_line":"\tretval \u003d mspm0_fctl_unprotect_sector(bank, addr);"},{"line_number":794,"context_line":"\tif (retval) {"},{"line_number":795,"context_line":"\t\tLOG_ERROR(\"%s: Unprotecting sector of memory at address 0x%08\" PRIx32"},{"line_number":796,"context_line":"\t\t\t\" failed\", mspm0_info-\u003ename, addr);"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"827307c7_b88a22d0","line":793,"updated":"2025-02-16 09:55:19.000000000","message":"Declare retval here, the default value is overwritten here and thus useless.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[{"line_number":790,"context_line":"\t * erase operation. Unfortunately, this means that we cannot do a unitary"},{"line_number":791,"context_line":"\t * unprotect operation independent of flash erase operation"},{"line_number":792,"context_line":"\t */"},{"line_number":793,"context_line":"\tretval \u003d mspm0_fctl_unprotect_sector(bank, addr);"},{"line_number":794,"context_line":"\tif (retval) {"},{"line_number":795,"context_line":"\t\tLOG_ERROR(\"%s: Unprotecting sector of memory at address 0x%08\" PRIx32"},{"line_number":796,"context_line":"\t\t\t\" failed\", mspm0_info-\u003ename, addr);"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"c89c529f_4660511c","line":793,"in_reply_to":"827307c7_b88a22d0","updated":"2025-02-19 16:31:51.000000000","message":"Done","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1bc7812bbc4d687458ed8ade4ba079df0daebf53","unresolved":true,"context_lines":[{"line_number":1077,"context_line":"\t * reporting.  Note that it doesn\u0027t write, so we don\u0027t care about"},{"line_number":1078,"context_line":"\t * whether the target is halted or not."},{"line_number":1079,"context_line":"\t */"},{"line_number":1080,"context_line":"\tretval \u003d mspm0_read_part_info(bank);"},{"line_number":1081,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":1082,"context_line":"\t\treturn retval;"},{"line_number":1083,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"4469518b_736c3d59","line":1080,"updated":"2025-02-16 09:55:19.000000000","message":"Declare retval here, default value is useless.","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"43d584484c56b455c50deb401f2e2ee3ecd716fa","unresolved":false,"context_lines":[{"line_number":1077,"context_line":"\t * reporting.  Note that it doesn\u0027t write, so we don\u0027t care about"},{"line_number":1078,"context_line":"\t * whether the target is halted or not."},{"line_number":1079,"context_line":"\t */"},{"line_number":1080,"context_line":"\tretval \u003d mspm0_read_part_info(bank);"},{"line_number":1081,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":1082,"context_line":"\t\treturn retval;"},{"line_number":1083,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"f94e132a_2dbc330c","line":1080,"in_reply_to":"4469518b_736c3d59","updated":"2025-02-19 16:31:51.000000000","message":"Done","commit_id":"51b22da0561cac50eabc138e15f941b91ad58d3b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"3f8ec0e4dd7c7beb087bb6b7a99cb22475335716","unresolved":true,"context_lines":[{"line_number":751,"context_line":"\t}"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"\tif ((return_code \u0026 FCTL_STATCMD_CMDPASS_MASK) !\u003d FCTL_STATCMD_CMDPASS_STATPASS) {"},{"line_number":754,"context_line":"\t\tchar *error_string \u003d calloc(ERR_STRING_MAX + 1, sizeof(char));"},{"line_number":755,"context_line":"\t\tif (error_string) {"},{"line_number":756,"context_line":"\t\t\tstrncat(error_string, mspm0_fctl_translate_ret_err(return_code),"},{"line_number":757,"context_line":"\t\t\t\t\tERR_STRING_MAX);"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"852bce5b_146c3522","line":754,"updated":"2025-02-24 18:53:02.000000000","message":"This memory allocation and `strncat()` is not necessary, you can print the result of `mspm0_fctl_translate_ret_err()` directly.","commit_id":"a93df1c9aee2202884bb38fbd3f09e80a9b568b6"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"5072486495071cb9f5e162a1abac426fda90a213","unresolved":false,"context_lines":[{"line_number":751,"context_line":"\t}"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"\tif ((return_code \u0026 FCTL_STATCMD_CMDPASS_MASK) !\u003d FCTL_STATCMD_CMDPASS_STATPASS) {"},{"line_number":754,"context_line":"\t\tchar *error_string \u003d calloc(ERR_STRING_MAX + 1, sizeof(char));"},{"line_number":755,"context_line":"\t\tif (error_string) {"},{"line_number":756,"context_line":"\t\t\tstrncat(error_string, mspm0_fctl_translate_ret_err(return_code),"},{"line_number":757,"context_line":"\t\t\t\t\tERR_STRING_MAX);"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"d2e051ef_b871f620","line":754,"in_reply_to":"852bce5b_146c3522","updated":"2025-02-26 12:59:02.000000000","message":"Done","commit_id":"a93df1c9aee2202884bb38fbd3f09e80a9b568b6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":355,"context_line":""},{"line_number":356,"context_line":"\tcommand_print_sameline(cmd,"},{"line_number":357,"context_line":"\t\t\"\\nTI MSPM0 information: Chip is \""},{"line_number":358,"context_line":"\t\t\"%s rev %d Device Unique ID: %d\\n\","},{"line_number":359,"context_line":"\t\tmspm0_info-\u003ename, mspm0_info-\u003eversion,"},{"line_number":360,"context_line":"\t\tmspm0_info-\u003etraceid);"},{"line_number":361,"context_line":"\tcommand_print_sameline(cmd,"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"f06c4e00_05981753","line":358,"updated":"2025-03-01 16:29:18.000000000","message":"Last parameter `mspm0_info-\u003etraceid` is of type `uint32_t`.\nUse format `... %\" PRIu32 \"\\n\",`","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":355,"context_line":""},{"line_number":356,"context_line":"\tcommand_print_sameline(cmd,"},{"line_number":357,"context_line":"\t\t\"\\nTI MSPM0 information: Chip is \""},{"line_number":358,"context_line":"\t\t\"%s rev %d Device Unique ID: %d\\n\","},{"line_number":359,"context_line":"\t\tmspm0_info-\u003ename, mspm0_info-\u003eversion,"},{"line_number":360,"context_line":"\t\tmspm0_info-\u003etraceid);"},{"line_number":361,"context_line":"\tcommand_print_sameline(cmd,"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"8ce9da40_38e52ae4","line":358,"in_reply_to":"f06c4e00_05981753","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":359,"context_line":"\t\tmspm0_info-\u003ename, mspm0_info-\u003eversion,"},{"line_number":360,"context_line":"\t\tmspm0_info-\u003etraceid);"},{"line_number":361,"context_line":"\tcommand_print_sameline(cmd,"},{"line_number":362,"context_line":"\t\t\"main flash: %dKiB in %d bank(s), sram: %dKiB, data flash: %dKiB\","},{"line_number":363,"context_line":"\t\tmspm0_info-\u003emain_flash_size_kb,"},{"line_number":364,"context_line":"\t\tmspm0_info-\u003emain_flash_num_banks, mspm0_info-\u003esram_size_kb,"},{"line_number":365,"context_line":"\t\tmspm0_info-\u003edata_flash_size_kb);"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"da474621_833ec8fb","line":362,"updated":"2025-03-01 16:29:18.000000000","message":"All the parameters are `unsigned int`. Use format string `%u`","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":359,"context_line":"\t\tmspm0_info-\u003ename, mspm0_info-\u003eversion,"},{"line_number":360,"context_line":"\t\tmspm0_info-\u003etraceid);"},{"line_number":361,"context_line":"\tcommand_print_sameline(cmd,"},{"line_number":362,"context_line":"\t\t\"main flash: %dKiB in %d bank(s), sram: %dKiB, data flash: %dKiB\","},{"line_number":363,"context_line":"\t\tmspm0_info-\u003emain_flash_size_kb,"},{"line_number":364,"context_line":"\t\tmspm0_info-\u003emain_flash_num_banks, mspm0_info-\u003esram_size_kb,"},{"line_number":365,"context_line":"\t\tmspm0_info-\u003edata_flash_size_kb);"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"d27e5979_5239627b","line":362,"in_reply_to":"da474621_833ec8fb","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":484,"context_line":"\tswitch (probe_status) {"},{"line_number":485,"context_line":"\tcase MSPM0_NO_ID_FOUND:"},{"line_number":486,"context_line":"\t\tmspm0_info-\u003ename \u003d \"mspm0x\";"},{"line_number":487,"context_line":"\t\tLOG_INFO(\"Unidentified PART[0x%\" PRIx32 \"]/variant[0x%\" PRIx32"},{"line_number":488,"context_line":"\t\t\t\"], unknown DeviceID[0x%\" PRIx32"},{"line_number":489,"context_line":"\t\t\t\"]. Attempting to proceed as %s.\", part, variant, pnum,"},{"line_number":490,"context_line":"\t\t\tmspm0_info-\u003ename);"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"23661dfe_26868fb6","line":487,"updated":"2025-03-01 16:29:18.000000000","message":"none of the parameter is `uint32_t`. Use `%x` instead of `PRIx32`","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":484,"context_line":"\tswitch (probe_status) {"},{"line_number":485,"context_line":"\tcase MSPM0_NO_ID_FOUND:"},{"line_number":486,"context_line":"\t\tmspm0_info-\u003ename \u003d \"mspm0x\";"},{"line_number":487,"context_line":"\t\tLOG_INFO(\"Unidentified PART[0x%\" PRIx32 \"]/variant[0x%\" PRIx32"},{"line_number":488,"context_line":"\t\t\t\"], unknown DeviceID[0x%\" PRIx32"},{"line_number":489,"context_line":"\t\t\t\"]. Attempting to proceed as %s.\", part, variant, pnum,"},{"line_number":490,"context_line":"\t\t\tmspm0_info-\u003ename);"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"d483e6eb_a8b50e71","line":487,"in_reply_to":"23661dfe_26868fb6","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":491,"context_line":"\t\tbreak;"},{"line_number":492,"context_line":"\tcase MSPM0_DEV_ID_FOUND:"},{"line_number":493,"context_line":"\t\tmspm0_info-\u003ename \u003d mspm0_finf[minfo_idx].family_name;"},{"line_number":494,"context_line":"\t\tLOG_INFO(\"Unidentified PART[0x%\" PRIx32 \"]/variant[0x%\" PRIx32"},{"line_number":495,"context_line":"\t\t\t\"], known DeviceID[0x%\" PRIx32"},{"line_number":496,"context_line":"\t\t\t\"]. Attempting to proceed as %s.\", part, variant, pnum,"},{"line_number":497,"context_line":"\t\t\tmspm0_info-\u003ename);"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"a24bd366_f8a2f778","line":494,"updated":"2025-03-01 16:29:18.000000000","message":"ditto","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":491,"context_line":"\t\tbreak;"},{"line_number":492,"context_line":"\tcase MSPM0_DEV_ID_FOUND:"},{"line_number":493,"context_line":"\t\tmspm0_info-\u003ename \u003d mspm0_finf[minfo_idx].family_name;"},{"line_number":494,"context_line":"\t\tLOG_INFO(\"Unidentified PART[0x%\" PRIx32 \"]/variant[0x%\" PRIx32"},{"line_number":495,"context_line":"\t\t\t\"], known DeviceID[0x%\" PRIx32"},{"line_number":496,"context_line":"\t\t\t\"]. Attempting to proceed as %s.\", part, variant, pnum,"},{"line_number":497,"context_line":"\t\t\tmspm0_info-\u003ename);"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"186adc57_1cc11897","line":494,"in_reply_to":"a24bd366_f8a2f778","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":519,"context_line":"\t */"},{"line_number":520,"context_line":"\tmspm0_info-\u003eflash_word_size_bytes \u003d 8;"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"\tLOG_DEBUG(\"Detected: main flash: %dKb in %d banks, sram: %dKb, data flash: %dKb\","},{"line_number":523,"context_line":"\t\tmspm0_info-\u003emain_flash_size_kb, mspm0_info-\u003emain_flash_num_banks,"},{"line_number":524,"context_line":"\t\tmspm0_info-\u003esram_size_kb, mspm0_info-\u003edata_flash_size_kb);"},{"line_number":525,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":9,"id":"8ff7c022_f7fc3f74","line":522,"updated":"2025-03-01 16:29:18.000000000","message":"`%u`","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":519,"context_line":"\t */"},{"line_number":520,"context_line":"\tmspm0_info-\u003eflash_word_size_bytes \u003d 8;"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"\tLOG_DEBUG(\"Detected: main flash: %dKb in %d banks, sram: %dKb, data flash: %dKb\","},{"line_number":523,"context_line":"\t\tmspm0_info-\u003emain_flash_size_kb, mspm0_info-\u003emain_flash_num_banks,"},{"line_number":524,"context_line":"\t\tmspm0_info-\u003esram_size_kb, mspm0_info-\u003edata_flash_size_kb);"},{"line_number":525,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":9,"id":"131abe81_a61483dc","line":522,"in_reply_to":"8ff7c022_f7fc3f74","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":575,"context_line":"\t\tbank-\u003ebase \u003d\u003d MSPM0_FLASH_BASE_MAIN) {"},{"line_number":576,"context_line":"\t\tret \u003d target_read_u32(target, SYSCTL_SECCFG_SECSTATUS, \u0026sysctl_sec_status);"},{"line_number":577,"context_line":"\t\tif (ret !\u003d ERROR_OK)"},{"line_number":578,"context_line":"\t\t\tgoto error;"},{"line_number":579,"context_line":"\t\texec_upper_bank \u003d mspm0_extract_val(sysctl_sec_status, 12, 12);"},{"line_number":580,"context_line":"\t\tif (exec_upper_bank) {"},{"line_number":581,"context_line":"\t\t\tif (sector_num \u003e (mspm0_info-\u003emain_flash_size_kb / 2)) {"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"95580acb_1752b00c","line":578,"updated":"2025-03-01 16:29:18.000000000","message":"There is nothing in the exit-on-error path. Here use directly\n`return ret;`\nand drop the label `error:` below","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":575,"context_line":"\t\tbank-\u003ebase \u003d\u003d MSPM0_FLASH_BASE_MAIN) {"},{"line_number":576,"context_line":"\t\tret \u003d target_read_u32(target, SYSCTL_SECCFG_SECSTATUS, \u0026sysctl_sec_status);"},{"line_number":577,"context_line":"\t\tif (ret !\u003d ERROR_OK)"},{"line_number":578,"context_line":"\t\t\tgoto error;"},{"line_number":579,"context_line":"\t\texec_upper_bank \u003d mspm0_extract_val(sysctl_sec_status, 12, 12);"},{"line_number":580,"context_line":"\t\tif (exec_upper_bank) {"},{"line_number":581,"context_line":"\t\t\tif (sector_num \u003e (mspm0_info-\u003emain_flash_size_kb / 2)) {"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"7260c830_b75b8fad","line":578,"in_reply_to":"95580acb_1752b00c","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":637,"context_line":""},{"line_number":638,"context_line":"\tif (ret !\u003d ERROR_OK) {"},{"line_number":639,"context_line":"\t\tLOG_ERROR(\"Unable to map sector protect reg for address 0x%08\" PRIx32,"},{"line_number":640,"context_line":"\t\t\taddr);"},{"line_number":641,"context_line":"\t}"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"error:"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"bdc0461a_a74c4180","line":640,"updated":"2025-03-01 16:29:18.000000000","message":"`addr` is of type `unsigned int`. Use format string `%08x`\n`PRIx32` is reserved for `uint32_t`.","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":637,"context_line":""},{"line_number":638,"context_line":"\tif (ret !\u003d ERROR_OK) {"},{"line_number":639,"context_line":"\t\tLOG_ERROR(\"Unable to map sector protect reg for address 0x%08\" PRIx32,"},{"line_number":640,"context_line":"\t\t\taddr);"},{"line_number":641,"context_line":"\t}"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"error:"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"2e63ac72_3bb2cdec","line":640,"in_reply_to":"bdc0461a_a74c4180","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":688,"context_line":"\tret \u003d mspm0_address_check(bank, addr);"},{"line_number":689,"context_line":"\tswitch (ret) {"},{"line_number":690,"context_line":"\tcase ERROR_FLASH_SECTOR_INVALID:"},{"line_number":691,"context_line":"\t\tLOG_ERROR(\"Unable to map sector protect reg for address 0x%08\" PRIx32,"},{"line_number":692,"context_line":"\t\t\taddr);"},{"line_number":693,"context_line":"\t\tbreak;"},{"line_number":694,"context_line":"\tcase ERROR_FLASH_DST_OUT_OF_BANK:"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"980fe76f_0af97d1a","line":691,"updated":"2025-03-01 16:29:18.000000000","message":"%x","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":688,"context_line":"\tret \u003d mspm0_address_check(bank, addr);"},{"line_number":689,"context_line":"\tswitch (ret) {"},{"line_number":690,"context_line":"\tcase ERROR_FLASH_SECTOR_INVALID:"},{"line_number":691,"context_line":"\t\tLOG_ERROR(\"Unable to map sector protect reg for address 0x%08\" PRIx32,"},{"line_number":692,"context_line":"\t\t\taddr);"},{"line_number":693,"context_line":"\t\tbreak;"},{"line_number":694,"context_line":"\tcase ERROR_FLASH_DST_OUT_OF_BANK:"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"1cc63994_b006ccbd","line":691,"in_reply_to":"980fe76f_0af97d1a","updated":"2025-03-03 14:34:19.000000000","message":"used %08x for addr for consistency","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":692,"context_line":"\t\t\taddr);"},{"line_number":693,"context_line":"\t\tbreak;"},{"line_number":694,"context_line":"\tcase ERROR_FLASH_DST_OUT_OF_BANK:"},{"line_number":695,"context_line":"\t\tLOG_ERROR(\"Unable to determine which bank to use 0x%08\" PRIx32,"},{"line_number":696,"context_line":"\t\t\taddr);"},{"line_number":697,"context_line":"\t\tbreak;"},{"line_number":698,"context_line":"\tdefault:"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"5d32e633_6218a531","line":695,"updated":"2025-03-01 16:29:18.000000000","message":"%x","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":692,"context_line":"\t\t\taddr);"},{"line_number":693,"context_line":"\t\tbreak;"},{"line_number":694,"context_line":"\tcase ERROR_FLASH_DST_OUT_OF_BANK:"},{"line_number":695,"context_line":"\t\tLOG_ERROR(\"Unable to determine which bank to use 0x%08\" PRIx32,"},{"line_number":696,"context_line":"\t\t\taddr);"},{"line_number":697,"context_line":"\t\tbreak;"},{"line_number":698,"context_line":"\tdefault:"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"b2cf5ccf_5b4ab46a","line":695,"in_reply_to":"5d32e633_6218a531","updated":"2025-03-03 14:34:19.000000000","message":"used %08x for addr for consistency","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":718,"context_line":"\t */"},{"line_number":719,"context_line":"\tint retval \u003d target_write_u32(target, FCTL_REG_CMDTYPE, cmd);"},{"line_number":720,"context_line":"\tif (retval)"},{"line_number":721,"context_line":"\t\tgoto flash_cfg_error;"},{"line_number":722,"context_line":"\tif (byte_en !\u003d 0) {"},{"line_number":723,"context_line":"\t\tretval \u003d target_write_u32(target, FCTL_REG_CMDBYTEN, byte_en);"},{"line_number":724,"context_line":"\t\tif (retval)"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"79f44f9c_6c228a66","line":721,"updated":"2025-03-01 16:29:18.000000000","message":"return retval;","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":718,"context_line":"\t */"},{"line_number":719,"context_line":"\tint retval \u003d target_write_u32(target, FCTL_REG_CMDTYPE, cmd);"},{"line_number":720,"context_line":"\tif (retval)"},{"line_number":721,"context_line":"\t\tgoto flash_cfg_error;"},{"line_number":722,"context_line":"\tif (byte_en !\u003d 0) {"},{"line_number":723,"context_line":"\t\tretval \u003d target_write_u32(target, FCTL_REG_CMDBYTEN, byte_en);"},{"line_number":724,"context_line":"\t\tif (retval)"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"ddbba77f_8896bb05","line":721,"in_reply_to":"79f44f9c_6c228a66","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":722,"context_line":"\tif (byte_en !\u003d 0) {"},{"line_number":723,"context_line":"\t\tretval \u003d target_write_u32(target, FCTL_REG_CMDBYTEN, byte_en);"},{"line_number":724,"context_line":"\t\tif (retval)"},{"line_number":725,"context_line":"\t\t\tgoto flash_cfg_error;"},{"line_number":726,"context_line":"\t}"},{"line_number":727,"context_line":"\tretval \u003d target_write_u32(target, FCTL_REG_CMDADDR, addr);"},{"line_number":728,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":9,"id":"86432835_18c41e04","line":725,"updated":"2025-03-01 16:29:18.000000000","message":"ditto","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":722,"context_line":"\tif (byte_en !\u003d 0) {"},{"line_number":723,"context_line":"\t\tretval \u003d target_write_u32(target, FCTL_REG_CMDBYTEN, byte_en);"},{"line_number":724,"context_line":"\t\tif (retval)"},{"line_number":725,"context_line":"\t\t\tgoto flash_cfg_error;"},{"line_number":726,"context_line":"\t}"},{"line_number":727,"context_line":"\tretval \u003d target_write_u32(target, FCTL_REG_CMDADDR, addr);"},{"line_number":728,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":9,"id":"f1ea3895_626cfbc3","line":725,"in_reply_to":"86432835_18c41e04","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":724,"context_line":"\t\tif (retval)"},{"line_number":725,"context_line":"\t\t\tgoto flash_cfg_error;"},{"line_number":726,"context_line":"\t}"},{"line_number":727,"context_line":"\tretval \u003d target_write_u32(target, FCTL_REG_CMDADDR, addr);"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"flash_cfg_error:"},{"line_number":730,"context_line":"\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"e430dfe9_96673434","line":727,"updated":"2025-03-01 16:29:18.000000000","message":"return target_write_u32(...);","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":724,"context_line":"\t\tif (retval)"},{"line_number":725,"context_line":"\t\t\tgoto flash_cfg_error;"},{"line_number":726,"context_line":"\t}"},{"line_number":727,"context_line":"\tretval \u003d target_write_u32(target, FCTL_REG_CMDADDR, addr);"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"flash_cfg_error:"},{"line_number":730,"context_line":"\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"802c7648_95c7be63","line":727,"in_reply_to":"e430dfe9_96673434","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":789,"context_line":"\tretval \u003d target_write_u32(target, FCTL_REG_CMDEXEC, FCTL_CMDEXEC_VAL_EXECUTE);"},{"line_number":790,"context_line":"\tif (retval)"},{"line_number":791,"context_line":"\t\treturn retval;"},{"line_number":792,"context_line":"\tretval \u003d mspm0_fctl_wait_cmd_ok(bank);"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"\treturn retval;"},{"line_number":795,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"3d468ffe_fca0700f","line":792,"updated":"2025-03-01 16:29:18.000000000","message":"directly\nreturn mspm0_fctl_wait_cmd_ok(bank);","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":789,"context_line":"\tretval \u003d target_write_u32(target, FCTL_REG_CMDEXEC, FCTL_CMDEXEC_VAL_EXECUTE);"},{"line_number":790,"context_line":"\tif (retval)"},{"line_number":791,"context_line":"\t\treturn retval;"},{"line_number":792,"context_line":"\tretval \u003d mspm0_fctl_wait_cmd_ok(bank);"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"\treturn retval;"},{"line_number":795,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"1b8ebc88_6b5b603c","line":792,"in_reply_to":"3d468ffe_fca0700f","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":823,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c bank-\u003enum_sectors; i++)"},{"line_number":824,"context_line":"\t\tbank-\u003esectors[i].is_protected \u003d 0;"},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"\tif (!mspm0_info-\u003eprotect_reg_count)"},{"line_number":827,"context_line":"\t\treturn ERROR_OK;"},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"\treturn ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"4f43e7bc_d7175356","line":826,"updated":"2025-03-01 16:29:18.000000000","message":"either `true` or `false`, the function returns `ERROR_OK` !\nSomething incorrect? Or this test is useless?","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":823,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c bank-\u003enum_sectors; i++)"},{"line_number":824,"context_line":"\t\tbank-\u003esectors[i].is_protected \u003d 0;"},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"\tif (!mspm0_info-\u003eprotect_reg_count)"},{"line_number":827,"context_line":"\t\treturn ERROR_OK;"},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"\treturn ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"9298e5aa_a8e7510a","line":826,"in_reply_to":"4f43e7bc_d7175356","updated":"2025-03-03 14:34:19.000000000","message":"oversight. the check is useless, dropped","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":861,"context_line":"\t\t\tunsigned int addr \u003d csa * mspm0_info-\u003esector_size;"},{"line_number":862,"context_line":"\t\t\tretval \u003d mspm0_fctl_sector_erase(bank, addr);"},{"line_number":863,"context_line":"\t\t\tif (retval)"},{"line_number":864,"context_line":"\t\t\t\tLOG_ERROR(\"Sector erase on MAIN failed at address 0x%08\""},{"line_number":865,"context_line":"\t\t\t\t\tPRIx32 \"(sector: %d)\", addr, csa);"},{"line_number":866,"context_line":"\t\t}"},{"line_number":867,"context_line":"\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"a65394e5_d0d06b37","line":864,"updated":"2025-03-01 16:29:18.000000000","message":"%x fro addr, %u for csa","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":861,"context_line":"\t\t\tunsigned int addr \u003d csa * mspm0_info-\u003esector_size;"},{"line_number":862,"context_line":"\t\t\tretval \u003d mspm0_fctl_sector_erase(bank, addr);"},{"line_number":863,"context_line":"\t\t\tif (retval)"},{"line_number":864,"context_line":"\t\t\t\tLOG_ERROR(\"Sector erase on MAIN failed at address 0x%08\""},{"line_number":865,"context_line":"\t\t\t\t\tPRIx32 \"(sector: %d)\", addr, csa);"},{"line_number":866,"context_line":"\t\t}"},{"line_number":867,"context_line":"\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"ea95f587_75fb98e1","line":864,"in_reply_to":"a65394e5_d0d06b37","updated":"2025-03-03 14:34:19.000000000","message":"Consistency: maintained 0x%08x for addr, fixed csa","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":876,"context_line":"\t\t\t(csa * mspm0_info-\u003esector_size));"},{"line_number":877,"context_line":"\t\t\tretval \u003d mspm0_fctl_sector_erase(bank, addr);"},{"line_number":878,"context_line":"\t\t\tif (retval)"},{"line_number":879,"context_line":"\t\t\t\tLOG_ERROR(\"Sector erase on DATA bank failed at address 0x%08\""},{"line_number":880,"context_line":"\t\t\t\t\tPRIx32 \"(sector: %d)\", addr, csa);"},{"line_number":881,"context_line":"\t\t}"},{"line_number":882,"context_line":"\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"d1f31eba_2127e7e1","line":879,"updated":"2025-03-01 16:29:18.000000000","message":"ditto","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":876,"context_line":"\t\t\t(csa * mspm0_info-\u003esector_size));"},{"line_number":877,"context_line":"\t\t\tretval \u003d mspm0_fctl_sector_erase(bank, addr);"},{"line_number":878,"context_line":"\t\t\tif (retval)"},{"line_number":879,"context_line":"\t\t\t\tLOG_ERROR(\"Sector erase on DATA bank failed at address 0x%08\""},{"line_number":880,"context_line":"\t\t\t\t\tPRIx32 \"(sector: %d)\", addr, csa);"},{"line_number":881,"context_line":"\t\t}"},{"line_number":882,"context_line":"\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"466bf670_80af1ffa","line":879,"in_reply_to":"d1f31eba_2127e7e1","updated":"2025-03-03 14:34:19.000000000","message":"Consistency: maintained 0x%08x for addr, fixed csa","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":896,"context_line":"\t * That way we retain the protection status as requested by the user"},{"line_number":897,"context_line":"\t */"},{"line_number":898,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":899,"context_line":"\t\tretval \u003d target_write_u32(target, mspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":900,"context_line":"\t\t\tprotect_reg_cache[i]);"},{"line_number":901,"context_line":"\t\tif (retval) {"},{"line_number":902,"context_line":"\t\t\tLOG_ERROR(\"Failed re-applying protection status of flashctl\");"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"6454f32e_a842d780","line":899,"updated":"2025-03-01 16:29:18.000000000","message":"this overwrites `retval` set in the former `switch/case`\nIs it what you really want?","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":896,"context_line":"\t * That way we retain the protection status as requested by the user"},{"line_number":897,"context_line":"\t */"},{"line_number":898,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c mspm0_info-\u003eprotect_reg_count; i++) {"},{"line_number":899,"context_line":"\t\tretval \u003d target_write_u32(target, mspm0_info-\u003eprotect_reg_base + (i * 4),"},{"line_number":900,"context_line":"\t\t\tprotect_reg_cache[i]);"},{"line_number":901,"context_line":"\t\tif (retval) {"},{"line_number":902,"context_line":"\t\t\tLOG_ERROR(\"Failed re-applying protection status of flashctl\");"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"c83a7cf2_13793c76","line":899,"in_reply_to":"6454f32e_a842d780","updated":"2025-03-03 14:34:19.000000000","message":"returned with the error before entering the for loop. Nice catch 😊","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":1026,"context_line":"\t\t\tprotect_reg_cache[i]);"},{"line_number":1027,"context_line":"\t\tif (retval) {"},{"line_number":1028,"context_line":"\t\t\tLOG_ERROR(\"Failed re-applying protection status of flashctl\");"},{"line_number":1029,"context_line":"\t\t\tbreak;"},{"line_number":1030,"context_line":"\t\t}"},{"line_number":1031,"context_line":"\t}"},{"line_number":1032,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":9,"id":"1d7f25b7_f7b9bcea","line":1029,"updated":"2025-03-01 16:29:18.000000000","message":"directly\n`return retval;`","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"\t\t\tprotect_reg_cache[i]);"},{"line_number":1027,"context_line":"\t\tif (retval) {"},{"line_number":1028,"context_line":"\t\t\tLOG_ERROR(\"Failed re-applying protection status of flashctl\");"},{"line_number":1029,"context_line":"\t\t\tbreak;"},{"line_number":1030,"context_line":"\t\t}"},{"line_number":1031,"context_line":"\t}"},{"line_number":1032,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":9,"id":"3616fe8c_2b11112a","line":1029,"in_reply_to":"1d7f25b7_f7b9bcea","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d2d6d94f53c23a1ebc4c686c3b3880f0c77c92e3","unresolved":true,"context_lines":[{"line_number":1030,"context_line":"\t\t}"},{"line_number":1031,"context_line":"\t}"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"\treturn retval;"},{"line_number":1034,"context_line":"}"},{"line_number":1035,"context_line":""},{"line_number":1036,"context_line":"static int mspm0_probe(struct flash_bank *bank)"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"6362e53f_af1b00b8","line":1033,"updated":"2025-03-01 16:29:18.000000000","message":"and here\n`return ERROR_OK;`\n\nStatic analyzer could complain that:\n`if (count \u003d\u003d 0 \u0026\u0026 mspm0_info-\u003eprotect_reg_count \u003d\u003d 0)`\nwe would arrive here with `retval` not initialized.","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"1b5d35b569cd6945a832a886b22afb82b8c6c63a","unresolved":false,"context_lines":[{"line_number":1030,"context_line":"\t\t}"},{"line_number":1031,"context_line":"\t}"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"\treturn retval;"},{"line_number":1034,"context_line":"}"},{"line_number":1035,"context_line":""},{"line_number":1036,"context_line":"static int mspm0_probe(struct flash_bank *bank)"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"eef96e11_e5117dbe","line":1033,"in_reply_to":"6362e53f_af1b00b8","updated":"2025-03-03 14:34:19.000000000","message":"Done","commit_id":"b042ccc0e1868c81c88218f178c7347fc413e6ec"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"a141e832d87b2a1400e1f1c437cd00191321f394","unresolved":true,"context_lines":[{"line_number":712,"context_line":"\t * will execute."},{"line_number":713,"context_line":"\t */"},{"line_number":714,"context_line":"\tint retval \u003d target_write_u32(target, FCTL_REG_CMDTYPE, cmd);"},{"line_number":715,"context_line":"\tif (retval)"},{"line_number":716,"context_line":"\t\treturn retval;"},{"line_number":717,"context_line":"\tif (byte_en !\u003d 0) {"},{"line_number":718,"context_line":"\t\tretval \u003d target_write_u32(target, FCTL_REG_CMDBYTEN, byte_en);"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"afae2a3f_1905907c","line":715,"updated":"2025-03-04 22:51:57.000000000","message":"I would prefer to have `if (retval !\u003d ERROR_OK)` like for the other checks above. It is cleaner and easier to understand in my opinion.\n\nPlease fix for the other check below as well.\n\n@antonio you did not mark this, what is your opinion?","commit_id":"af345713d65eb13b8116124b82e532e1137643ce"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"8e390b0522a8936956a52706184b1b912b671c98","unresolved":false,"context_lines":[{"line_number":712,"context_line":"\t * will execute."},{"line_number":713,"context_line":"\t */"},{"line_number":714,"context_line":"\tint retval \u003d target_write_u32(target, FCTL_REG_CMDTYPE, cmd);"},{"line_number":715,"context_line":"\tif (retval)"},{"line_number":716,"context_line":"\t\treturn retval;"},{"line_number":717,"context_line":"\tif (byte_en !\u003d 0) {"},{"line_number":718,"context_line":"\t\tretval \u003d target_write_u32(target, FCTL_REG_CMDBYTEN, byte_en);"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"55501473_503ab798","line":715,"in_reply_to":"632d6d55_4d85f556","updated":"2025-03-08 17:09:41.000000000","message":"Good idea!","commit_id":"af345713d65eb13b8116124b82e532e1137643ce"},{"author":{"_account_id":1001678,"name":"Nishanth Menon","email":"nm@ti.com","username":"nmenon"},"change_message_id":"fa6c8705519532a99ca5ec3df50007278a114d0a","unresolved":false,"context_lines":[{"line_number":712,"context_line":"\t * will execute."},{"line_number":713,"context_line":"\t */"},{"line_number":714,"context_line":"\tint retval \u003d target_write_u32(target, FCTL_REG_CMDTYPE, cmd);"},{"line_number":715,"context_line":"\tif (retval)"},{"line_number":716,"context_line":"\t\treturn retval;"},{"line_number":717,"context_line":"\tif (byte_en !\u003d 0) {"},{"line_number":718,"context_line":"\t\tretval \u003d target_write_u32(target, FCTL_REG_CMDBYTEN, byte_en);"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"c0b4deac_2ee00b6a","line":715,"in_reply_to":"afae2a3f_1905907c","updated":"2025-03-05 12:58:39.000000000","message":"Done.","commit_id":"af345713d65eb13b8116124b82e532e1137643ce"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"dc8e6b59bccd7bd75e944d5c418b6d46c5b32e2b","unresolved":false,"context_lines":[{"line_number":712,"context_line":"\t * will execute."},{"line_number":713,"context_line":"\t */"},{"line_number":714,"context_line":"\tint retval \u003d target_write_u32(target, FCTL_REG_CMDTYPE, cmd);"},{"line_number":715,"context_line":"\tif (retval)"},{"line_number":716,"context_line":"\t\treturn retval;"},{"line_number":717,"context_line":"\tif (byte_en !\u003d 0) {"},{"line_number":718,"context_line":"\t\tretval \u003d target_write_u32(target, FCTL_REG_CMDBYTEN, byte_en);"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"632d6d55_4d85f556","line":715,"in_reply_to":"c0b4deac_2ee00b6a","updated":"2025-03-08 17:02:18.000000000","message":"Fully agree with you, Marc.\nWe should also add it in the coding style.","commit_id":"af345713d65eb13b8116124b82e532e1137643ce"}]}
