We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b9fc5a commit d120000Copy full SHA for d120000
1 file changed
hal/rp2350.c
@@ -26,6 +26,9 @@
26
#include <target.h>
27
#include "image.h"
28
#include "printf.h"
29
+
30
+#include "hardware/flash.h"
31
32
#ifdef TZEN
33
#include "armv8m_tz.h"
34
#include "pico/bootrom.h"
@@ -221,7 +224,8 @@ void hal_prepare_boot(void)
221
224
222
225
int RAMFUNCTION hal_flash_write(uint32_t address, const uint8_t *data, int len)
223
226
{
- return 0; /* on success. */
227
+ flash_range_program(address - XIP_BASE, data, len);
228
+ return 0;
229
}
230
231
void RAMFUNCTION hal_flash_unlock(void)
@@ -234,6 +238,7 @@ void RAMFUNCTION hal_flash_lock(void)
234
238
235
239
int RAMFUNCTION hal_flash_erase(uint32_t address, int len)
236
240
237
241
+ flash_range_erase(address - XIP_BASE, len);
242
243
244
0 commit comments