- /* Do BlankCheck on Sector at 0xA0000 */
- Puts4("Blank Check of FLASH Sector at 0xA0000 ... ");
- error = FLASH_SectorBlankCheck(0xA0000, 0x4000);
- if( error == 1 )
- {
- Puts4("done.\n");
- }
- else
- {
- Puts4("failed.\n");
- }
-
- /* Show Current Content of 0xA0000 ... 0xA001F */
- i=0;
- Puts4("\nCurrent Content of FLASH at 0xA0000 ... 0xA001F:\n");
- while(i < 0x20)
- {
- Puts4("0x"); Puthex4( *(unsigned char *)(0xA0000 + i), 2); Puts4(" ");
- i++;
- if( (i % 0x10) == 0 ) Puts4("\n");
- }
- Puts4("\n");
-
- /* SectorErase of FLASH Memory 0xA0000*/
- Puts4("Sector Erase of 0xA0000 ... ");
- error = FLASH_SectorErase(0xA0000);
- error = FLASH_SectorErase(0xA0004);
- if( error == 1 )
- {
- Puts4("done.\n");
- }
- else
- {
- global_error = 1;
- Puts4("failed.\n");
- }
-
- /* Do BlankCheck on Sectors at 0xA0000 */
- Puts4("Blank Check of FLASH Sector at 0xA0000 ... ");
- error = FLASH_SectorBlankCheck(0xA0000, 0x4000);
- if( error == 1 )
- {
- Puts4("done.\n");
- }
- else
- {
- global_error = 1;
- Puts4("failed.\n");
- }
-
- /* Show Current Content of 0xA0000 ... 0xA001F */
- i=0;
- Puts4("\nCurrent Content of FLASH at 0xA0000 ... 0xA001F:\n");
- while(i < 0x20)
- {
- Puts4("0x"); Puthex4( *(unsigned char *)(0xA0000 + i), 2); Puts4(" ");
- i++;
- if( (i % 0x10) == 0 ) Puts4("\n");
- }
- Puts4("\n");
-
- /* Write 0x55AA to 0xA0002 */
- Puts4("Write 0x55AA to 0xA0002 ... ");
- error = FLASH_WriteHalfWord(0xA0002,0x55AA);
- if( error == 1 )
- {
- Puts4("done.\n");
- }
- else
- {
- global_error = 1;
- Puts4("failed.\n");
+ i = 0;
+ baseaddr = 0xf4000;
+ for (; i <0x30; i+=4) {
+ error = FLASH_SectorErase(baseaddr + i);
+ Puts4("\nerased: ");
+ Puts4(error == 1 ? "[success] " : "[failed] ");
+ Puthex4(baseaddr + i, 6);