File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ ENTRY( _reset )
55MEMORY
66{
77 FLASH (rxai!w) : ORIGIN = 0x20020100 , LENGTH = 256K - 0x100
8- RAM (wxa!ri) : ORIGIN = 0x80000000 , LENGTH = 16K
8+ RAM (wxa!ri) : ORIGIN = 0x80001000 , LENGTH = 12K
99}
1010
1111SECTIONS
Original file line number Diff line number Diff line change 11#include <stdint.h>
22#include "hal.h"
3+ #include "target.h"
4+ #include "wolfboot/wolfboot.h"
5+
36#define PAGESIZE (0x1000) /* Flash sector: 4K */
47extern uint8_t flash_page [];
58
9+
10+ #ifdef APP_DEBUG_WRITE_PAGE
11+ __attribute__((used ,naked ,section (".ramcode.user" )))
12+ void write_page (uint32_t dst )
13+ {
14+ asm volatile ("addi sp, sp, -4" );
15+ asm volatile ("sw ra, 0(sp)" );
16+ if (dst == 0x60000 )
17+ wolfBoot_erase_partition (0x01 );
18+ hal_flash_write (dst , flash_page , PAGESIZE );
19+ asm volatile ("lw a4, 0(sp)" );
20+ asm volatile ("addi sp, sp, 4" );
21+ asm volatile ("jr a4" );
22+ }
23+ #endif
24+
625__attribute__((used ,section (".ramcode.user" )))
726void write_page (uint32_t dst )
827{
9- hal_flash_erase (dst , PAGESIZE );
28+ if (dst == 0x60000 )
29+ wolfBoot_erase_partition (0x01 );
1030 hal_flash_write (dst , flash_page , PAGESIZE );
1131}
You can’t perform that action at this time.
0 commit comments