12345678910111213141516171819202122232425262728293031323334 |
- FUNC void flash_init (void) {
- unsigned int reg_val;
- // flash data to CPU CRC disable
- _WDWORD(0x0082001c, (_RDWORD(0x0082001c))&(~(1<<26)));
- // flash status register data to be written
- _WDWORD(0x0082001c, (_RDWORD(0x0082001c))&(~(0xffff<<10)));
-
- // cpu data writting enable
- _WDWORD(0x0082001c, (_RDWORD(0x0082001c))|(1<<9));
- // flash operation command : WRSR2
- reg_val = _RDWORD(0x00820000);
- reg_val &= (~(0x1f<<24)); // clr op_type_sw
- reg_val |= (0x07<<24) | (1<<29) | (1<<30); // op_sw, wp_value
- _WDWORD(0x00820000, reg_val);
- _sleep_(1000);
- while(_RDWORD(0x00820000) & (0x01<<31)){;}
- // flash operation command : CE
- reg_val = _RDWORD(0x00820000);
- reg_val &= (~(0x1f<<24)); // clr op_type_sw
- reg_val |= (0x10<<24) | (1<<29) | (1<<30); // op_sw, wp_value
- _WDWORD(0x00820000, reg_val);
- _sleep_(10000);
- while(_RDWORD(0x00820000) & (0x01<<31)){;}
- }
- flash_init();
- LOAD ./obj/BK3231S_Test_Firmware.axf INCREMENTAL
- //LOAD ./obj/BK3231S_Test_Firmware.axf NOCODE
|