File tree 1 file changed +3
-2
lines changed
src/rp2_common/pico_cyw43_driver
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ static async_context_t *cyw43_async_context = NULL;
23
23
24
24
#if CYW43_USE_PARTITION_FIRMWARE
25
25
#include "pico/bootrom.h"
26
+ #include "hardware/flash.h"
26
27
#include "boot/picobin.h"
27
28
#include <stdlib.h>
28
29
@@ -161,8 +162,8 @@ bool cyw43_driver_init(async_context_t *context) {
161
162
assert (ret == 3 );
162
163
163
164
uint32_t location_and_permissions = buffer [1 ];
164
- uint32_t saddr = ((location_and_permissions >> PICOBIN_PARTITION_LOCATION_FIRST_SECTOR_LSB ) & 0x1fffu ) * 4096 ;
165
- uint32_t eaddr = (((location_and_permissions >> PICOBIN_PARTITION_LOCATION_LAST_SECTOR_LSB ) & 0x1fffu ) + 1 ) * 4096 ;
165
+ uint32_t saddr = ((location_and_permissions >> PICOBIN_PARTITION_LOCATION_FIRST_SECTOR_LSB ) & 0x1fffu ) * FLASH_SECTOR_SIZE ;
166
+ uint32_t eaddr = (((location_and_permissions >> PICOBIN_PARTITION_LOCATION_LAST_SECTOR_LSB ) & 0x1fffu ) + 1 ) * FLASH_SECTOR_SIZE ;
166
167
// Starts with metadata block
167
168
while (saddr < eaddr && * (uint32_t * )(XIP_NOCACHE_NOALLOC_NOTRANSLATE_BASE + saddr ) != PICOBIN_BLOCK_MARKER_END ) {
168
169
saddr += 4 ;
You can’t perform that action at this time.
0 commit comments