File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 2626#include <target.h>
2727#include "image.h"
2828#include "printf.h"
29+
30+ #include "hardware/flash.h"
31+
2932#ifdef TZEN
3033#include "armv8m_tz.h"
3134#include "pico/bootrom.h"
@@ -221,7 +224,8 @@ void hal_prepare_boot(void)
221224
222225int RAMFUNCTION hal_flash_write (uint32_t address , const uint8_t * data , int len )
223226{
224- return 0 ; /* on success. */
227+ flash_range_program (address - XIP_BASE , data , len );
228+ return 0 ;
225229}
226230
227231void RAMFUNCTION hal_flash_unlock (void )
@@ -234,6 +238,7 @@ void RAMFUNCTION hal_flash_lock(void)
234238
235239int RAMFUNCTION hal_flash_erase (uint32_t address , int len )
236240{
237- return 0 ; /* on success. */
241+ flash_range_erase (address - XIP_BASE , len );
242+ return 0 ;
238243}
239244
You can’t perform that action at this time.
0 commit comments