)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"4c5303f37006c4d9d5bb338ab948bee61b1b6a38","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"f59801c0_833e0405","updated":"2026-02-10 21:34:51.000000000","message":"Looks nice!","commit_id":"ccdbc5d7c5d5a699b91d2d2acca91ce4b6a7f656"}],"src/flash/nor/efm32.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"05ff7f64c15c4e5092cc588353f44ef8c3a70bed","unresolved":true,"context_lines":[{"line_number":107,"context_line":"\tsize_t flash_write_code_len;"},{"line_number":108,"context_line":"};"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"/* see contrib/loaders/flash/efm32.S for src */"},{"line_number":111,"context_line":"static const uint8_t efm32_flash_write_code_s0_s1[] \u003d {"},{"line_number":112,"context_line":"\t/* #define EFM32_MSC_WRITECTRL_OFFSET      0x008 */"},{"line_number":113,"context_line":"\t/* #define EFM32_MSC_WRITECMD_OFFSET       0x00c */"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"d282bab8_7de0a3df","line":110,"updated":"2026-02-06 20:23:31.000000000","message":"The way we work with target flash loaders evolved since the state frozen in efm32.c\nPlease do not write the commented hex code here, prepare build in contrib/loaders/flash/ and include the result instead. See e.g. contrib/loaders/flash/stm32","commit_id":"01b176659a830939eb5133181b6e05e754cece06"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"b24f44c6deeadfa5c4bb859674b7df69339cf392","unresolved":true,"context_lines":[{"line_number":107,"context_line":"\tsize_t flash_write_code_len;"},{"line_number":108,"context_line":"};"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"/* see contrib/loaders/flash/efm32.S for src */"},{"line_number":111,"context_line":"static const uint8_t efm32_flash_write_code_s0_s1[] \u003d {"},{"line_number":112,"context_line":"\t/* #define EFM32_MSC_WRITECTRL_OFFSET      0x008 */"},{"line_number":113,"context_line":"\t/* #define EFM32_MSC_WRITECMD_OFFSET       0x00c */"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"e2998ecb_300e800a","line":110,"in_reply_to":"b4aa0627_fbfa4ec7","updated":"2026-02-06 21:02:03.000000000","message":"I think that Makefile could compile the same source with different preprocessor defines and output two inc files.\nYou may also create efm32.h with definitions common to both the loader and flash driver.","commit_id":"01b176659a830939eb5133181b6e05e754cece06"},{"author":{"_account_id":1002493,"name":"Jérôme Pouiller","email":"jerome.pouiller@silabs.com","username":"jerome-pouiller"},"change_message_id":"7579b71d172972810c812f16ee7cc4458098cf60","unresolved":true,"context_lines":[{"line_number":107,"context_line":"\tsize_t flash_write_code_len;"},{"line_number":108,"context_line":"};"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"/* see contrib/loaders/flash/efm32.S for src */"},{"line_number":111,"context_line":"static const uint8_t efm32_flash_write_code_s0_s1[] \u003d {"},{"line_number":112,"context_line":"\t/* #define EFM32_MSC_WRITECTRL_OFFSET      0x008 */"},{"line_number":113,"context_line":"\t/* #define EFM32_MSC_WRITECMD_OFFSET       0x00c */"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"b4aa0627_fbfa4ec7","line":110,"in_reply_to":"d282bab8_7de0a3df","updated":"2026-02-06 20:40:24.000000000","message":"Should I create a file for Series 0/1 and another for Series 2 or there is a clever way to support both version?","commit_id":"01b176659a830939eb5133181b6e05e754cece06"},{"author":{"_account_id":1002493,"name":"Jérôme Pouiller","email":"jerome.pouiller@silabs.com","username":"jerome-pouiller"},"change_message_id":"68aa4332985031cc091f6963b62d77a10b23993a","unresolved":false,"context_lines":[{"line_number":107,"context_line":"\tsize_t flash_write_code_len;"},{"line_number":108,"context_line":"};"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"/* see contrib/loaders/flash/efm32.S for src */"},{"line_number":111,"context_line":"static const uint8_t efm32_flash_write_code_s0_s1[] \u003d {"},{"line_number":112,"context_line":"\t/* #define EFM32_MSC_WRITECTRL_OFFSET      0x008 */"},{"line_number":113,"context_line":"\t/* #define EFM32_MSC_WRITECMD_OFFSET       0x00c */"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"1be67ad5_acc0f4e6","line":110,"in_reply_to":"e2998ecb_300e800a","updated":"2026-02-10 17:25:34.000000000","message":"Finally, I have prefered to create two files.\nIt was not so easy to merge them and I didn\u0027t want to have an over-engineered design only for two cases (it would be different if we had more assembly variant to support).","commit_id":"01b176659a830939eb5133181b6e05e754cece06"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"4c5303f37006c4d9d5bb338ab948bee61b1b6a38","unresolved":true,"context_lines":[{"line_number":896,"context_line":"\t\treturn ret;"},{"line_number":897,"context_line":""},{"line_number":898,"context_line":"\t/* memory buffer */"},{"line_number":899,"context_line":"\twhile (target_alloc_working_area_try(target, buffer_size, \u0026source) !\u003d ERROR_OK) {"},{"line_number":900,"context_line":"\t\tbuffer_size /\u003d 2;"},{"line_number":901,"context_line":"\t\tbuffer_size \u0026\u003d ~3UL; /* Make sure it\u0027s 4 byte aligned */"},{"line_number":902,"context_line":"\t\tif (buffer_size \u003c\u003d 256) {"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"9c46fdda_0eb5097e","line":899,"updated":"2026-02-10 21:34:51.000000000","message":"Just a tip for an eventual update: the cycle of `target_alloc_working_area_try()` is replaced in the newer code by `target_get_working_area_avail()`. Just for the case you have lot of time ;-)","commit_id":"ccdbc5d7c5d5a699b91d2d2acca91ce4b6a7f656"},{"author":{"_account_id":1002493,"name":"Jérôme Pouiller","email":"jerome.pouiller@silabs.com","username":"jerome-pouiller"},"change_message_id":"c1de6d24028eeac78f2f177e22df4ec4490e9aa2","unresolved":false,"context_lines":[{"line_number":896,"context_line":"\t\treturn ret;"},{"line_number":897,"context_line":""},{"line_number":898,"context_line":"\t/* memory buffer */"},{"line_number":899,"context_line":"\twhile (target_alloc_working_area_try(target, buffer_size, \u0026source) !\u003d ERROR_OK) {"},{"line_number":900,"context_line":"\t\tbuffer_size /\u003d 2;"},{"line_number":901,"context_line":"\t\tbuffer_size \u0026\u003d ~3UL; /* Make sure it\u0027s 4 byte aligned */"},{"line_number":902,"context_line":"\t\tif (buffer_size \u003c\u003d 256) {"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"cc0c7156_723dd67f","line":899,"in_reply_to":"9c46fdda_0eb5097e","updated":"2026-02-26 16:48:44.000000000","message":"Done","commit_id":"ccdbc5d7c5d5a699b91d2d2acca91ce4b6a7f656"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"aa95db950cdc37de7ebcd613322a01949fd0fcad","unresolved":true,"context_lines":[{"line_number":88,"context_line":"\t},"},{"line_number":89,"context_line":"};"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"/* Offsets relative to msc_regbase */"},{"line_number":92,"context_line":"struct efm32_msc_offset {"},{"line_number":93,"context_line":"#define EFM32_MSC_WRITECTRL_WREN_MASK        0x0001"},{"line_number":94,"context_line":"\ttarget_addr_t off_writectrl;"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"4aaa6f4a_eeb64c83","line":91,"updated":"2026-03-07 11:09:12.000000000","message":"Use `//` for single-line comments.","commit_id":"a9534f7cd71a235f5c28beecd2a97f91667e5139"},{"author":{"_account_id":1002493,"name":"Jérôme Pouiller","email":"jerome.pouiller@silabs.com","username":"jerome-pouiller"},"change_message_id":"658db7d5d1d6c668cb7a48da02f654eb76261b34","unresolved":false,"context_lines":[{"line_number":88,"context_line":"\t},"},{"line_number":89,"context_line":"};"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"/* Offsets relative to msc_regbase */"},{"line_number":92,"context_line":"struct efm32_msc_offset {"},{"line_number":93,"context_line":"#define EFM32_MSC_WRITECTRL_WREN_MASK        0x0001"},{"line_number":94,"context_line":"\ttarget_addr_t off_writectrl;"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"895dd90d_4c387628","line":91,"in_reply_to":"4aaa6f4a_eeb64c83","updated":"2026-03-08 10:14:03.000000000","message":"Done","commit_id":"a9534f7cd71a235f5c28beecd2a97f91667e5139"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"aa95db950cdc37de7ebcd613322a01949fd0fcad","unresolved":true,"context_lines":[{"line_number":113,"context_line":"\tsize_t flash_write_code_len;"},{"line_number":114,"context_line":"};"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"/* see contrib/loaders/flash/efm32.S for src */"},{"line_number":117,"context_line":"static const uint8_t efm32_flash_write_code_s0_s1[] \u003d {"},{"line_number":118,"context_line":"#include \"../../../contrib/loaders/flash/silabs/silabs_s0_s1.inc\""},{"line_number":119,"context_line":"};"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"51da8845_4c387853","line":116,"updated":"2026-03-07 11:09:12.000000000","message":"Same.","commit_id":"a9534f7cd71a235f5c28beecd2a97f91667e5139"},{"author":{"_account_id":1002493,"name":"Jérôme Pouiller","email":"jerome.pouiller@silabs.com","username":"jerome-pouiller"},"change_message_id":"658db7d5d1d6c668cb7a48da02f654eb76261b34","unresolved":false,"context_lines":[{"line_number":113,"context_line":"\tsize_t flash_write_code_len;"},{"line_number":114,"context_line":"};"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"/* see contrib/loaders/flash/efm32.S for src */"},{"line_number":117,"context_line":"static const uint8_t efm32_flash_write_code_s0_s1[] \u003d {"},{"line_number":118,"context_line":"#include \"../../../contrib/loaders/flash/silabs/silabs_s0_s1.inc\""},{"line_number":119,"context_line":"};"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"18930434_75ffe55b","line":116,"in_reply_to":"51da8845_4c387853","updated":"2026-03-08 10:14:03.000000000","message":"Done","commit_id":"a9534f7cd71a235f5c28beecd2a97f91667e5139"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"aa95db950cdc37de7ebcd613322a01949fd0fcad","unresolved":true,"context_lines":[{"line_number":572,"context_line":"\t */"},{"line_number":573,"context_line":"\tstruct efm32_flash_chip *efm32_info \u003d bank-\u003edriver_priv;"},{"line_number":574,"context_line":"\tuint32_t status \u003d 0;"},{"line_number":575,"context_line":"\tint ret \u003d 0;"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"\tLOG_DEBUG(\"erasing flash page at 0x%08\" PRIx32, addr);"},{"line_number":578,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":8,"id":"2245e71d_adb82d98","line":575,"updated":"2026-03-07 11:09:12.000000000","message":"`ret` is overwritten two lines below, remove this declaration and assignment.","commit_id":"a9534f7cd71a235f5c28beecd2a97f91667e5139"},{"author":{"_account_id":1002493,"name":"Jérôme Pouiller","email":"jerome.pouiller@silabs.com","username":"jerome-pouiller"},"change_message_id":"658db7d5d1d6c668cb7a48da02f654eb76261b34","unresolved":false,"context_lines":[{"line_number":572,"context_line":"\t */"},{"line_number":573,"context_line":"\tstruct efm32_flash_chip *efm32_info \u003d bank-\u003edriver_priv;"},{"line_number":574,"context_line":"\tuint32_t status \u003d 0;"},{"line_number":575,"context_line":"\tint ret \u003d 0;"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"\tLOG_DEBUG(\"erasing flash page at 0x%08\" PRIx32, addr);"},{"line_number":578,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":8,"id":"014d8532_5f00a6a2","line":575,"in_reply_to":"2245e71d_adb82d98","updated":"2026-03-08 10:14:03.000000000","message":"Done","commit_id":"a9534f7cd71a235f5c28beecd2a97f91667e5139"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"aa95db950cdc37de7ebcd613322a01949fd0fcad","unresolved":true,"context_lines":[{"line_number":975,"context_line":"\t * performed twice per dword */"},{"line_number":976,"context_line":"\tstruct efm32_flash_chip *efm32_info \u003d bank-\u003edriver_priv;"},{"line_number":977,"context_line":"\tuint32_t status \u003d 0;"},{"line_number":978,"context_line":"\tint ret \u003d 0;"},{"line_number":979,"context_line":""},{"line_number":980,"context_line":"\t/* if not called, GDB errors will be reported during large writes */"},{"line_number":981,"context_line":"\tkeep_alive();"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"33d86e2e_845953bc","line":978,"updated":"2026-03-07 11:09:12.000000000","message":"Same here.","commit_id":"a9534f7cd71a235f5c28beecd2a97f91667e5139"},{"author":{"_account_id":1002493,"name":"Jérôme Pouiller","email":"jerome.pouiller@silabs.com","username":"jerome-pouiller"},"change_message_id":"658db7d5d1d6c668cb7a48da02f654eb76261b34","unresolved":false,"context_lines":[{"line_number":975,"context_line":"\t * performed twice per dword */"},{"line_number":976,"context_line":"\tstruct efm32_flash_chip *efm32_info \u003d bank-\u003edriver_priv;"},{"line_number":977,"context_line":"\tuint32_t status \u003d 0;"},{"line_number":978,"context_line":"\tint ret \u003d 0;"},{"line_number":979,"context_line":""},{"line_number":980,"context_line":"\t/* if not called, GDB errors will be reported during large writes */"},{"line_number":981,"context_line":"\tkeep_alive();"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"a85bd790_8b87b62c","line":978,"in_reply_to":"33d86e2e_845953bc","updated":"2026-03-08 10:14:03.000000000","message":"Done","commit_id":"a9534f7cd71a235f5c28beecd2a97f91667e5139"}],"src/flash/nor/stm32f1x.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"05ff7f64c15c4e5092cc588353f44ef8c3a70bed","unresolved":false,"context_lines":[{"line_number":455,"context_line":""},{"line_number":456,"context_line":"\tstatic const uint8_t stm32x_flash_write_code[] \u003d {"},{"line_number":457,"context_line":"#include \"../../../contrib/loaders/flash/stm32/stm32f1x.inc\""},{"line_number":458,"context_line":"\t};"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"\t/* flash write code */"},{"line_number":461,"context_line":"\tif (target_alloc_working_area(target, sizeof(stm32x_flash_write_code),"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"de8ef11d_8ec9c98d","side":"PARENT","line":458,"updated":"2026-02-06 20:23:31.000000000","message":"Example how to include the loader code","commit_id":"9f80f2728bd840c6a318386c7b7bf6454e8d00d7"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"4c5303f37006c4d9d5bb338ab948bee61b1b6a38","unresolved":true,"context_lines":[{"line_number":471,"context_line":"\t\treturn retval;"},{"line_number":472,"context_line":"\t}"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"\t/* memory buffer */"},{"line_number":475,"context_line":"\tbuffer_size \u003d target_get_working_area_avail(target);"},{"line_number":476,"context_line":"\tbuffer_size \u003d MIN(hwords_count * 2 + 8, MAX(buffer_size, 256));"},{"line_number":477,"context_line":"\t/* Normally we allocate all available working area."},{"line_number":478,"context_line":"\t * MIN shrinks buffer_size if the size of the written block is smaller."},{"line_number":479,"context_line":"\t * MAX prevents using async algo if the available working area is smaller"},{"line_number":480,"context_line":"\t * than 256, the following allocation fails with"},{"line_number":481,"context_line":"\t * ERROR_TARGET_RESOURCE_NOT_AVAILABLE and slow flashing takes place."},{"line_number":482,"context_line":"\t */"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"\tretval \u003d target_alloc_working_area(target, buffer_size, \u0026source);"},{"line_number":485,"context_line":"\t/* Allocated size is always 32-bit word aligned */"},{"line_number":486,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":487,"context_line":"\t\ttarget_free_working_area(target, write_algorithm);"},{"line_number":488,"context_line":"\t\tLOG_WARNING(\"no large enough working area available, can\u0027t do block memory writes\");"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"04cc30e4_d2b12228","line":485,"range":{"start_line":474,"start_character":1,"end_line":485,"end_character":51},"updated":"2026-02-10 21:34:51.000000000","message":"Example of `target_get_working_area_avail()` usage","commit_id":"ccdbc5d7c5d5a699b91d2d2acca91ce4b6a7f656"},{"author":{"_account_id":1002493,"name":"Jérôme Pouiller","email":"jerome.pouiller@silabs.com","username":"jerome-pouiller"},"change_message_id":"c1de6d24028eeac78f2f177e22df4ec4490e9aa2","unresolved":false,"context_lines":[{"line_number":471,"context_line":"\t\treturn retval;"},{"line_number":472,"context_line":"\t}"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"\t/* memory buffer */"},{"line_number":475,"context_line":"\tbuffer_size \u003d target_get_working_area_avail(target);"},{"line_number":476,"context_line":"\tbuffer_size \u003d MIN(hwords_count * 2 + 8, MAX(buffer_size, 256));"},{"line_number":477,"context_line":"\t/* Normally we allocate all available working area."},{"line_number":478,"context_line":"\t * MIN shrinks buffer_size if the size of the written block is smaller."},{"line_number":479,"context_line":"\t * MAX prevents using async algo if the available working area is smaller"},{"line_number":480,"context_line":"\t * than 256, the following allocation fails with"},{"line_number":481,"context_line":"\t * ERROR_TARGET_RESOURCE_NOT_AVAILABLE and slow flashing takes place."},{"line_number":482,"context_line":"\t */"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"\tretval \u003d target_alloc_working_area(target, buffer_size, \u0026source);"},{"line_number":485,"context_line":"\t/* Allocated size is always 32-bit word aligned */"},{"line_number":486,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":487,"context_line":"\t\ttarget_free_working_area(target, write_algorithm);"},{"line_number":488,"context_line":"\t\tLOG_WARNING(\"no large enough working area available, can\u0027t do block memory writes\");"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"d21bbc4b_f53c0900","line":485,"range":{"start_line":474,"start_character":1,"end_line":485,"end_character":51},"in_reply_to":"04cc30e4_d2b12228","updated":"2026-02-26 16:48:44.000000000","message":"Done","commit_id":"ccdbc5d7c5d5a699b91d2d2acca91ce4b6a7f656"}]}
