Skip to content
Snippets Groups Projects
Commit e871cd64 authored by cnlohr's avatar cnlohr
Browse files

Still not working.

parent a39484bb
No related branches found
No related tags found
No related merge requests found
......@@ -34,9 +34,11 @@ int main()
while(1);
}
uint32_t * ptr = (uint32_t*)0x08002700;
volatile uint32_t * ptr = (uint32_t*)0x08003700;
printf( "Memory at: 0x08002710: %08lx %08lx\n", ptr[0], ptr[1] );
printf( "FLASH->CTLR = %08lx\n", FLASH->CTLR );
//Erase Page
FLASH->CTLR = CR_PAGE_ER;
FLASH->ADDR = (intptr_t)ptr;
......@@ -47,7 +49,7 @@ int main()
// Clear buffer and prep for flashing.
FLASH->CTLR = CR_PAGE_PG;
FLASH->CTLR = CR_PAGE_PG; // synonym of FTPG.
FLASH->CTLR = CR_BUF_RST | CR_PAGE_PG;
// Note: It takes about 8 clock cycles for this to finish.
while( FLASH->STATR & FLASH_STATR_BSY );
......@@ -68,6 +70,7 @@ int main()
printf( "FLASH->STATR = %08lx\n", FLASH->STATR );
while( FLASH->STATR & FLASH_STATR_BSY );
printf( "FLASH->STATR = %08lx\n", FLASH->STATR );
printf( "Memory at: 0x08002710: %08lx %08lx\n", ptr[0], ptr[1] );
while(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment