)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"953a3b9ec18d3936a6a0ed3fc733d4439eeb5a74","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"e3f0b4ee_b196373e","updated":"2021-09-19 09:03:25.000000000","message":"\n\u003e ... and allowed all adapter speeds to work over SWD.\n\nPlease be aware it\u0027s adapter dependent. If the adapter properly handles SWD WAIT state then yes, both this change and 5270 allows all adapter speeds.\nOn the other hand e.g. FT2232H based adapter (where SWD WAIT generates ERROR_WAIT) flashing stops working at adapter speed 4200 kHz with this change and a little bit lower (3600 kHz) with change 5270. IMO there no gain in setting adapter speed so high, as the devices have 128 kB flash max and influence to flashing speed is minimal at these frequencies.\n\n","commit_id":"dc410355a5323a8140fc74f83c86d8d46b929c33"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"92e42557e4b5b3d7a4bfe29e1b4c0d0c883ea86b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"cb7fbf16_e31d6ca9","updated":"2021-09-15 14:14:18.000000000","message":"FTR, this was used for so long in ST openocd fork, and it works like a charm","commit_id":"dc410355a5323a8140fc74f83c86d8d46b929c33"},{"author":{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},"change_message_id":"8efb1e94ae5a85798ecfabb8b911ec1449f0462a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"f8ea3ea1_6508e2b6","updated":"2021-10-29 09:36:41.000000000","message":"I did more speed tests using various interfaces and adapter speeds and this microcontroller:\nSTM32L053R8 (64kB/8kB)\nTested with default power up CPU clock source MSI 2MHz and also with HSI 16MHz.\n\nResults are shown as:\n  (this patch) / (current openocd version)\n\nFirst column is for write:\n  flash write_bank 0 rnd_64kB.bin\ndone after erase (flash erase_sector 0 0 15).\n\nSecond column is for write with erase:\n  flash write_image erase rnd_64kB.bin 0x08000000\n\n****************\n\nST-LINK/V2-1 (V2J38M27)\n\nMSI 2MHz\n 240kHz      4.726 KiB/s /  5.186 KiB/s      4.177 KiB/s / 3.142 KiB/s\n 950kHz      9.705 KiB/s /  9.364 KiB/s      7.649 KiB/s / 4.265 KiB/s\n1800kHz     11.420 KiB/s / 10.694 KiB/s      8.680 KiB/s / 4.597 KiB/s\n4000kHz     12.791 KiB/s / 11.507 KiB/s      9.446 KiB/s / 4.816 KiB/s\n\nHSI 16MHz\n 240kHz      4.696 KiB/s /  5.126 KiB/s      4.146 KiB/s / 3.145 KiB/s\n 950kHz      9.596 KiB/s /  9.448 KiB/s      7.608 KiB/s / 4.277 KiB/s\n1800kHz     11.646 KiB/s / 11.108 KiB/s      8.823 KiB/s / 4.570 KiB/s\n4000kHz     13.307 KiB/s / 12.545 KiB/s      9.772 KiB/s / 4.819 KiB/s\n\nST-LINK/V3 (V3J8M3B5S1)\n\nMSI 2MHz\n 200kHz      6.582 KiB/s /  6.481 KiB/s      5.553 KiB/s / 3.568 KiB/s\n1000kHz     11.960 KiB/s / 10.552 KiB/s      9.024 KiB/s / 4.570 KiB/s\n3300kHz     14.206 KiB/s / 12.498 KiB/s     10.193 KiB/s / 4.856 KiB/s\n8000kHz     14.981 KiB/s / 12.617 KiB/s     10.586 KiB/s / 4.871 KiB/s\n24000kHz      fail       /   fail             fail       /  fail\n\nHSI 16MHz\n 200kHz      6.342 KiB/s /  6.669 KiB/s      5.435 KiB/s / 3.579 KiB/s\n1000kHz     12.157 KiB/s / 11.522 KiB/s      9.130 KiB/s / 4.660 KiB/s\n3300kHz     14.837 KiB/s / 13.233 KiB/s     10.641 KiB/s / 4.829 KiB/s\n8000kHz     15.818 KiB/s / 13.738 KiB/s     11.071 KiB/s / 4.965 KiB/s\n24000kHz      fail       /   fail             fail       /  fail\n\nMCU-Link (NXP, USB HS, CMSIS-DAP HID)\n\nMSI 2MHz\n 200kHz      4.895 KiB/s /  5.331 KiB/s      4.298 KiB/s / 3.111 KiB/s\n1000kHz      7.907 KiB/s /   error wr        6.436 KiB/s /  error wr\n4000kHz      8.428 KiB/s /   error wr        6.724 KiB/s /  error wr\n8000kHz      8.653 KiB/s /   error wr        6.922 KiB/s /  error wr\n12000kHz     8.659 KiB/s /   error wr        7.030 KiB/s /  error wr\n16000kHz      fail       /   fail             fail       /  fail\n\nHSI 16MHz\n 200kHz      4.949 KiB/s /  5.391 KiB/s      4.335 KiB/s / 3.116 KiB/s\n1000kHz      8.068 KiB/s /   error wr        6.484 KiB/s /  error wr\n4000kHz      8.591 KiB/s /   error wr        7.090 KiB/s /  error wr\n8000kHz      8.488 KiB/s /   error wr        7.030 KiB/s /  error wr\n12000kHz     9.162 KiB/s /   error wr        7.190 KiB/s /  error wr\n16000kHz      fail       /   fail             fail       /  fail\n\nnanoDAP (v2.2, CMSIS-DAP HID)\n\nMSI 2MHz\n 200kHz      2.016 KiB/s /  2.165 KiB/s      1.896 KiB/s / 1.617 KiB/s\n1000kHz      4.761 KiB/s /  5.181 KiB/s      4.183 KiB/s / 3.069 KiB/s\n2000kHz      5.352 KiB/s /  5.921 KiB/s      4.630 KiB/s / 3.314 KiB/s\n4000kHz       error wr   /   error wr         error wr   /  error wr\n\nHSI 16MHz\n 200kHz      2.032 KiB/s /  2.174 KiB/s      1.912 KiB/s / 1.623 KiB/s\n1000kHz      4.808 KiB/s /  5.235 KiB/s      4.225 KiB/s / 3.089 KiB/s\n2000kHz      5.409 KiB/s /  5.992 KiB/s      4.681 KiB/s / 3.338 KiB/s\n4000kHz       error wr   /   error wr         error wr   /  error wr\n\nDAP-Link (STM32F103, CMSIS-DAP BULK)\n\nMSI 2MHz\n 200kHz           -      /  3.285 KiB/s           -      / 2.291 KiB/s\n1000kHz           -      /   error wr             -      /  error wr\n2000kHz           -      /   error wr             -      /  error wr\n4000kHz           -      /   error wr             -      /  error wr\n\nHSI 16MHz\n 200kHz           -      /  3.309 KiB/s           -      / 2.301 KiB/s\n1000kHz           -      /   error wr             -      /  error wr\n2000kHz           -      /   error wr             -      /  error wr\n4000kHz           -      /   error wr             -      /  error wr\n\n****************\n\nMy conclusions:\n\nThis patch makes flash writing (without erase) only a little bit faster than current version, but only at higher adapter speeds.\n\nFlash writing connected with erase (as everyone knows flash should be erased before write) is significantly faster (twice as fast).\n\nFull flash erase (64kB) lasts about 1.78s for this patch, 8.03s for current version. This is 4 times faster!\nProbably it is due to use assembler erase procedure running on device.\n\nCurrent version of openocd has some problem with CMSIS-DAP interface on this microntroller driver (writing error at speeds faster then 300kHz).\nThere is no such problem with this interface with stm32f0x microcontrollers that works very fast even on higher adapter speeds.\n\nThis patch needs to be rewrite to be compatible with current openocd sources.\n","commit_id":"dc410355a5323a8140fc74f83c86d8d46b929c33"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d0efaac522f4dabb79ad7ccda3219b1153e5afee","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"70febb25_5a4dbb78","updated":"2021-09-17 19:27:14.000000000","message":"Ok, it works.\n\n\u003e Patch Set 1:\n\u003e \n\u003e ... sped up my STM32l082KZU enormously and allowed all adapter speeds to work over SWD.\n\nDidn\u0027t notice any speed up in comparison to 5270: flash/nor/stm32lx.c: remove target flash loader | https://review.openocd.org/c/openocd/+/5270\n\nTested with CMSIS-DAP v2 on USB FS, adapter speed 2500:\n\n5270:\n\u003e flash write_image data60kb.bin 0x8001000\nwrote 61440 bytes from file data60kb.bin in 6.374686s (9.412 KiB/s)\n\nThis change:\n\u003e flash write_image data60kb.bin 0x8001000\nwrote 61440 bytes from file data60kb.bin in 6.454989s (9.295 KiB/s)\n\nAsking again: Why should we maintain the loader code which doesn\u0027t noticeably improve flashing speed?\nIMO the only worth loader should use async algo instead of ineffective isolated algo runs for each chunk.\n\n","commit_id":"dc410355a5323a8140fc74f83c86d8d46b929c33"},{"author":{"_account_id":1001926,"name":"Jelle De Vleeschouwer","username":"jelledevleeschouwer"},"change_message_id":"4e9d779e1bbc946ce7f95314148db64ff3323ff1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"15671a97_b27d8099","updated":"2021-09-15 14:31:26.000000000","message":"Tested OK with stm32l082cz just now","commit_id":"dc410355a5323a8140fc74f83c86d8d46b929c33"},{"author":{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},"change_message_id":"1657166d93391820b68b107e8d965cffdd012c65","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"56b61b03_78ed17e8","in_reply_to":"585da786_e2925b70","updated":"2021-11-02 09:41:10.000000000","message":"I\u0027m not advanced in git.. Thanks Tomas for the lesson!\nPULL option was causing compilation errors so I used option RESET TO..\nI finally got old sources and all my work shows incorrect results.","commit_id":"dc410355a5323a8140fc74f83c86d8d46b929c33"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"b3a52242cedf2a43c6288c84137c0cd7ce93bcab","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"ec41fd15_953faef0","in_reply_to":"70febb25_5a4dbb78","updated":"2021-10-14 13:43:41.000000000","message":"regarding speed gain:\n\nI have tested #5598 vs #5270, using\n - STM32L152C-DISCOVERY\n   DEV_ID: 0x427 \u003d\u003d\u003e STM32L1xx (Cat.3 - Medium+ Density) - Rev: V\n - STLINK V2J35S0 (HLA)\n\n\u003e\u003e flash fillw 0x8000000 0xdeadbeef 0x1000 (16KiB)\n\n  | with loader fix     |  without loader      | adapter speed | gain (KiB/s) |\n  |---------------------|----------------------|---------------|--------------|\n  |  2.41s ( 6.6 KiB/s) |  2.66s ( 5.9  KiB/s) |  240 kHz      | x 1.1        |\n  |  0.85s (18.7 KiB/s) |  1.19s (13.38 KiB/s) | 1800 kHz      | x 1.4        |\n  |  0.73s (21.8 KiB/s) |  1.14s (14.04 KiB/s) | 4000 kHz      | x 1.5        |\n\n\u003e\u003e flash fillw 0x8000000 0xdeadbeef 0x10000 (256KiB)\n\n  | with loader fix     | without loader       | adapter speed | gain (KiB/s) |\n  |---------------------|----------------------|---------------|--------------|\n  | 11.24s (22.7 KiB/s) | 15.67s (16.3  KiB/s) | 4000 kHz      | x 1.4        |","commit_id":"dc410355a5323a8140fc74f83c86d8d46b929c33"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"dfb271fb771975bb9c5355f646a0daa551863584","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"a04eda33_7318277d","in_reply_to":"ec41fd15_953faef0","updated":"2021-10-21 19:28:51.000000000","message":"I re-tested STM32L051C8 with STLINK V2J29S0 and flashing speeds are very close again: with loader 11.544 versus no loader 11.163 KiB/s - both @ 1800 kHz.\nLet\u0027s hope the loader speeds up at least L1 devices as you reported.","commit_id":"dc410355a5323a8140fc74f83c86d8d46b929c33"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"552d61eec116381732b975389e7560aa9a12b033","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"585da786_e2925b70","in_reply_to":"f8ea3ea1_6508e2b6","updated":"2021-10-29 13:36:07.000000000","message":"Thanks for testing.\n\n\u003e Flash writing connected with erase (as everyone knows flash should be erased before write) is significantly faster (twice as fast).\n\nThis patch does not change the erase code at all. You probably tested with https://review.openocd.org/c/openocd/+/5597/2 flash/nor/stm32lx: speed up erases\n\n\u003e Current version of openocd has some problem with CMSIS-DAP interface on this microntroller driver (writing error at speeds faster then 300kHz).\n\nIf we exclude insane high adapter speeds (and DAP-Link, which you didn\u0027t test\nwith this patch), your results confirm that CMSIS-DAP works with this patch,\ndon\u0027t they?\nActually the problem is stalled AHB bus during flash writes and therefore SWD returns WAIT for too long on any AP r/w. Different adapters handle WAIT differently, ST-Link driver just waits up to 255 msec, much longer than 64 internal WAIT retries in CMSIS-DAP adapter (it takes about 64*48 swd clocks \u003d 3ms @ 1000kHz - very close to Tprog\u003d3.2ms).\nThe fixed loader makes it better as it waits for RDY in a loop.\n\n\u003e This patch needs to be rewrite to be compatible with current openocd sources.\n\nWhat do you mean? git cherry-pick works. The conflicts are from #5597","commit_id":"dc410355a5323a8140fc74f83c86d8d46b929c33"}]}
