device apm32f103ze if 1 speed 1000 con sleep 100 w4 0x40022004 0x45670123 // Unlock flash control register w4 0x40022004 0xCDEF89AB w4 0x40022008 0x45670123 // Unlock option byte control register W4 0x40022008 0xCDEF89AB w4 0x40022010 0x00000220 // Set OPTER (Option Byte Erase) and OPTWRE (Option Bytes Write Enable) w4 0x40022010 0x00000260 // Set STRT (Start, in order to start erase procedure) sleep 1500 // It is not possible to check the Status register in a commander file, therefore we sleep 1500 // just wait here a fixed amount of time w1 0x1FFFF800 0xBB // Set ROP to Level 1. 0xAA = Level 0; 0xCC = Level 2 sleep 1500 // It is not possible to check the Status register in a commander file, therefore we sleep 1500 // just wait here a fixed amount of time r q