Hello Everyone,
this is my first post so sorry if im at the wrong place but im kind of stuck with this specific problem:
The plan is to use mcuboot to enable dfu for the rp2040. Mcuboot works fine out of the box, the partitioning and flashing bootloader and slot0 image works like a charm. Now as for the actual upgrade, the default swap using offset should be used. Therefore i flash an image to the correct address of slot1. After reboot the bootloader recognizes it and i can read the mcuboot header no problem. So far so good, now to do the upgrade i call boot_request_upgrade(BOOT_UPGRADE_TEST). In the logs i see that it writes the 16bytes magic and 1byte swap info to the correct addresses. But when i check the flash by doing a flash dump, there is nothing actually written there. So i tried writing the mcuboot trailer manually before flashing and it worked, not a solution though but tells me the bootloader works fine. Next i investigated the code and saw that the mcuboot uses the zephyr drivers for the pico to write to the flash. So i tried using the same functions to write manually to the flash. I somehow tried a lot of different ones and the only one that actually worked is flash_range_program(), which writes a whole page at ones, so my manual data and everything else thats currently in the ram. So it is somehow possible to write to flash but the function which is also used by mcuboot and the zephyr drivers called flash_write_partial() does nothing. I tried so many things that at this point im questioning if the problem may lie in the drivers itself. I also cant seem to find anyone online who has every used mcuboot with the raspberry pi.
Im on the newest versions and all i want is a simple test program with a single print that changes to proof the dfu working. In the future the new image wont be flashed of course but for now afaik this should be working.
Im thankful for any tips, points, things i could try, anything at all.
Thanks in advance!
this is my first post so sorry if im at the wrong place but im kind of stuck with this specific problem:
The plan is to use mcuboot to enable dfu for the rp2040. Mcuboot works fine out of the box, the partitioning and flashing bootloader and slot0 image works like a charm. Now as for the actual upgrade, the default swap using offset should be used. Therefore i flash an image to the correct address of slot1. After reboot the bootloader recognizes it and i can read the mcuboot header no problem. So far so good, now to do the upgrade i call boot_request_upgrade(BOOT_UPGRADE_TEST). In the logs i see that it writes the 16bytes magic and 1byte swap info to the correct addresses. But when i check the flash by doing a flash dump, there is nothing actually written there. So i tried writing the mcuboot trailer manually before flashing and it worked, not a solution though but tells me the bootloader works fine. Next i investigated the code and saw that the mcuboot uses the zephyr drivers for the pico to write to the flash. So i tried using the same functions to write manually to the flash. I somehow tried a lot of different ones and the only one that actually worked is flash_range_program(), which writes a whole page at ones, so my manual data and everything else thats currently in the ram. So it is somehow possible to write to flash but the function which is also used by mcuboot and the zephyr drivers called flash_write_partial() does nothing. I tried so many things that at this point im questioning if the problem may lie in the drivers itself. I also cant seem to find anyone online who has every used mcuboot with the raspberry pi.
Im on the newest versions and all i want is a simple test program with a single print that changes to proof the dfu working. In the future the new image wont be flashed of course but for now afaik this should be working.
Im thankful for any tips, points, things i could try, anything at all.
Thanks in advance!
Statistics: Posted by zere — Wed Feb 11, 2026 3:17 pm — Replies 0 — Views 32