)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"743dfa45ba875952cc7fb78c561abe85052daef6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"241f5bf9_7cb35142","updated":"2021-08-27 15:13:00.000000000","message":"just a rebase","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"84fbbdd7b82a9c0c6627738a6dcb19f5cbfc9fa4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":19,"id":"0972ca77_d7c0304f","updated":"2021-09-02 13:23:44.000000000","message":"sorry missed to update the loader binary","commit_id":"57b241b0f7f3b6f51841810ec77ed189a68b21d3"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"be98817996d60921600a7a616a518b43e3727d54","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"15d86849_9e76be29","updated":"2021-09-02 14:47:40.000000000","message":"re-tested on STM32G474RE, WL55JC and U575ZI","commit_id":"b79bcfecd2ee24a263374a9bdc949a1e67500d19"}],"contrib/loaders/flash/stm32/stm32l4x.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"aa8d590c5e050ddee7386a27cef025094a14177e","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"\t\t\tif (*flash_sr \u0026 FLASH_ERROR) {"},{"line_number":79,"context_line":"\t\t\t\twork_area-\u003erp \u003d 0; /* set rp to zero 0 on error */"},{"line_number":80,"context_line":"\t\t\t\tbreak;"},{"line_number":81,"context_line":"\t\t\t}"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"\t\t\t/* wrap if reach the fifo_end, and update rp in memory */"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"ceda9b01_bcedc6b6","line":80,"range":{"start_line":80,"start_character":4,"end_line":80,"end_character":10},"updated":"2021-03-17 06:59:17.000000000","message":"In the case of error we should exit both nested loops, not just inner one","commit_id":"67ebb92998256c3d32c98ff9dc3462b5ec81ac42"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"e0898693fccbb012e5d0a9857b84ca6afb3c6307","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"\t\t\tif (*flash_sr \u0026 FLASH_ERROR) {"},{"line_number":79,"context_line":"\t\t\t\twork_area-\u003erp \u003d 0; /* set rp to zero 0 on error */"},{"line_number":80,"context_line":"\t\t\t\tbreak;"},{"line_number":81,"context_line":"\t\t\t}"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"\t\t\t/* wrap if reach the fifo_end, and update rp in memory */"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"ceda9b01_9c8242cc","line":80,"range":{"start_line":80,"start_character":4,"end_line":80,"end_character":10},"in_reply_to":"ceda9b01_bcedc6b6","updated":"2021-03-17 12:26:13.000000000","message":"thanks !","commit_id":"67ebb92998256c3d32c98ff9dc3462b5ec81ac42"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"b3736cd52115086d2a3ecdf100ec6a9804b7bbe9","unresolved":false,"context_lines":[{"line_number":20,"context_line":" * IMPORTANT:"},{"line_number":21,"context_line":" * when updating this loader and re-compiling it, the stack arguments could be placed"},{"line_number":22,"context_line":" * at a different offset from sp register."},{"line_number":23,"context_line":" * according the AAPCS, only the 4 32-bit first arguments are passed in the registers r0 to r4"},{"line_number":24,"context_line":" * the arguments starting from number 5 is passed in the stack."},{"line_number":25,"context_line":" * to make it work, you need to:"},{"line_number":26,"context_line":" *   - check the generated listing \u0027stm32l4x.lst"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"ceda9b01_9c532243","line":23,"range":{"start_line":23,"start_character":93,"end_line":23,"end_character":94},"updated":"2021-03-18 06:53:09.000000000","message":"r3 ;-)","commit_id":"1e27274b78b4b81402bf37146a72c0199781407f"},{"author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"change_message_id":"7c01997ed088537a8133a657ea4f191314d725c3","unresolved":true,"context_lines":[{"line_number":32,"context_line":"\t\t   uint32_t count)"},{"line_number":33,"context_line":"{"},{"line_number":34,"context_line":"\tuint8_t *rp_cache  \u003d work_area-\u003efifo.rp; /* optimization to avoid reading from memory each time */"},{"line_number":35,"context_line":"\tuint8_t *fifo_start \u003d rp_cache; /* used to wrap when we reach fifo_end */"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"\t/* enable flash programming */"},{"line_number":38,"context_line":"\t*(work_area-\u003eflash_cr) \u003d FLASH_PG;"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"32fe51db_2c39c598","line":35,"updated":"2021-08-28 04:45:58.000000000","message":"please sync line wrapping to something usable. The web diff viewer is using less chars as you :)","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"72a5eb211cb2cf934f669441d15985ca26e66efc","unresolved":false,"context_lines":[{"line_number":32,"context_line":"\t\t   uint32_t count)"},{"line_number":33,"context_line":"{"},{"line_number":34,"context_line":"\tuint8_t *rp_cache  \u003d work_area-\u003efifo.rp; /* optimization to avoid reading from memory each time */"},{"line_number":35,"context_line":"\tuint8_t *fifo_start \u003d rp_cache; /* used to wrap when we reach fifo_end */"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"\t/* enable flash programming */"},{"line_number":38,"context_line":"\t*(work_area-\u003eflash_cr) \u003d FLASH_PG;"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"3b53ab89_e4d7324e","line":35,"in_reply_to":"32fe51db_2c39c598","updated":"2021-08-31 18:06:23.000000000","message":"Done","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"}],"src/flash/nor/stm32l4x.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"9cee1cb05656a97a510486746ceb5bb1cf2d028e","unresolved":false,"context_lines":[{"line_number":1348,"context_line":"\t * plus one dword for rp and one for wp */"},{"line_number":1349,"context_line":"\tassert(stm32l4_info-\u003edata_width % 8 \u003d\u003d 0); /* data_width should be multiple of dword */"},{"line_number":1350,"context_line":"\tbuffer_size \u003d target_get_working_area_avail(target) \u0026 ~(stm32l4_info-\u003edata_width - 1);"},{"line_number":1351,"context_line":"\tbuffer_size \u003d buffer_size - stm32l4_info-\u003edata_width + 8;"},{"line_number":1352,"context_line":""},{"line_number":1353,"context_line":"\tif (buffer_size \u003c 256) {"},{"line_number":1354,"context_line":"\t\tLOG_WARNING(\"large enough working area not available, can\u0027t do block memory writes\");"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"ceda9b01_7c8bde1b","line":1351,"range":{"start_line":1351,"start_character":29,"end_line":1351,"end_character":53},"updated":"2021-03-16 23:13:43.000000000","message":"Ugly! What about this?\n\n const size_t extra_size \u003d sizeof(struct stm32l4_work_area);\n buffer_size \u003d target_get_working_area_avail(target) - extra_size;\n\n if (buffer_size \u003c 256)\n...\n else if (buffer_size \u003e 16384)\n...\n buffer_size \u0026\u003d ~(stm32l4_info-\u003edata_width - 1);\n...\n target_alloc_working_area(target, extra_size + buffer_size, \u0026source)","commit_id":"cec9e2b077763332fd48efe5908404688a09d35b"},{"author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"change_message_id":"7c01997ed088537a8133a657ea4f191314d725c3","unresolved":true,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"6fc2df51_f8c5c554","line":1383,"updated":"2021-08-28 04:45:58.000000000","message":"I would expect here something like:\n  struct stm32l4_work_area wa \u003d { ... };\n\n  target_write_buffer(target, source-\u003eaddress, sizeof(wa), \u0026wa);","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"change_message_id":"0b91771a4f67ce0e428a665b6089827fd06cf36c","unresolved":true,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"758266b4_d13b3dcb","line":1383,"in_reply_to":"0b6c787b_c7948559","updated":"2021-08-31 18:46:34.000000000","message":"For example here:\nhttps://review.openocd.org/c/openocd/+/5950/15/contrib/loaders/flash/npcx/npcx_flash.h#159","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"change_message_id":"c0b1b6522bdad1fc26d1a77b51a46ef08aa6c029","unresolved":false,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"53016c51_aa12a73d","line":1383,"in_reply_to":"1c7b15d4_c5f79513","updated":"2021-09-02 04:20:02.000000000","message":"allocating safe value. Sounds good.","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"change_message_id":"d57bf2cd6fcb7ccbfaee00a7019f6f13a61a606d","unresolved":true,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"0b6c787b_c7948559","line":1383,"in_reply_to":"23226da7_dde05c72","updated":"2021-08-31 18:44:57.000000000","message":"yes, if it is defined and used as pointer. But \"struct stm32l4_work_area\" is shared storage, it makes no real sense to define a pointer in it.","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"adc5e329b5d64631f2447728e0c588a81a28da22","unresolved":false,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"1c7b15d4_c5f79513","line":1383,"in_reply_to":"54df79d9_12663bd7","updated":"2021-09-01 20:53:53.000000000","message":"well I\u0027m all ears on how to extract automatically:\n  should I instrument the Makefile to extract the stack usage from stm32l4x.su\n  then put it in separate .h file as define ? then include it ...\n\nanother possibility is to set a safe value, the same way as in the npcx patch (they allocated 400 bytes for the stack, I can allocate a safe value of 100 bytes and forget about the .su file.\n\nwhat do you think ?","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"264e2ea7ea73cb19fd6e79f8bd4906029e613ae9","unresolved":true,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"ba2cf0a6_02d2fe7c","line":1383,"in_reply_to":"6fc2df51_f8c5c554","updated":"2021-08-31 11:30:22.000000000","message":"I was afreaid of doing this because of the endianness.\nIDK if the OS is big endian, how this will be managed.\nanyway, I will give it a try.","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"change_message_id":"6bbe2a61ed1a9f077da7c01ae767e406a9390e60","unresolved":false,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"d34355bd_ecea14c7","line":1383,"in_reply_to":"720a6a99_074db6a4","updated":"2021-09-01 04:16:00.000000000","message":"nice! 😊\n\nNow we only need to get rid of the LDR_STACK_SIZE.\nHow about this way https://review.openocd.org/c/openocd/+/5950/15/contrib/loaders/flash/npcx/npcx_flash.c#339","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"9079bcdacc0638a1672eff98ef6561d0603e3fdf","unresolved":false,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"720a6a99_074db6a4","line":1383,"in_reply_to":"758266b4_d13b3dcb","updated":"2021-08-31 21:29:08.000000000","message":"I hope this is better now.","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"change_message_id":"fbe42ef8fbbf57780cb052b3f3ac40b4b896f05b","unresolved":false,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"54df79d9_12663bd7","line":1383,"in_reply_to":"9eb0f12f_0ef49a7b","updated":"2021-09-01 09:10:37.000000000","message":"Updating manually SP is error prone. There is no advantage of having it. The SP can be calculated and set by the loader automatically, the same way as it is done on many relocatable bootloaders. Or automatically extract this information from binary and set SP from OpenOCD.","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"change_message_id":"2d4244e91d095af3c8ab01983bb3bd7cbe02db03","unresolved":true,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"bc2fec89_c1340397","line":1383,"in_reply_to":"ba2cf0a6_02d2fe7c","updated":"2021-08-31 16:41:30.000000000","message":"Use target_buffer_set_u32() to set variable of the struct?","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"72a5eb211cb2cf934f669441d15985ca26e66efc","unresolved":true,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"23226da7_dde05c72","line":1383,"in_reply_to":"bc2fec89_c1340397","updated":"2021-08-31 18:06:23.000000000","message":"checking further, using the same struct is not possible since in 64 hosts, the (uint32_t*) pointer size is 64 in contradiction with the target host.\n\nusing  target_buffer_set_u32() will require the creation of a new buffer; stgh like:\n\n\n\tuint8_t wa_stack_args[16];\n\ttarget_buffer_set_u32(target, wa_stack_args,\n\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));\n\n\t/* .... */\n\n\ttarget_write_buffer(target, source-\u003eaddress, sizeof(wa_stack_args),\n\t\t\t(const uint8_t *) \u0026wa_stack_args);\n\nbut this is already the same as the current code, maybe more complicated.","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"21dfe1d71e25abe8f3e180d116bbaf9c76f3ea2d","unresolved":false,"context_lines":[{"line_number":1380,"context_line":"\tbuf_set_u32(reg_params[3].value, 0, 32, count);"},{"line_number":1381,"context_line":"\tbuf_set_u32(reg_params[4].value, 0, 32, source-\u003eaddress + LDR_STACK_OFFSET + LDR_STACK_SIZE);"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_SR_OFFSET,"},{"line_number":1384,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_SR_INDEX));"},{"line_number":1385,"context_line":"\ttarget_write_u32(target, source-\u003eaddress + LDR_CR_OFFSET,"},{"line_number":1386,"context_line":"\t\t\tstm32l4_get_flash_reg_by_index(bank, STM32_FLASH_CR_INDEX));"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"9eb0f12f_0ef49a7b","line":1383,"in_reply_to":"d34355bd_ecea14c7","updated":"2021-09-01 08:19:09.000000000","message":"I would prefer keeping the LDR_STACK_SIZE, because getting rid of it will require\nadding a full linker file like theirs: https://review.openocd.org/c/openocd/+/5950/15/contrib/loaders/flash/npcx/npcx_flash.lds\nplus the trick you mentioned to place the sp register.\n\nfurthermore, the major drawback of this method is that the loader is no more relocatable, thus and the work area address will be fixed in the RAM memory space.","commit_id":"923002553958d2a8ea32d03988294e2631f5bc97"}]}
