public static async Task FlashPrepareAsync(this Samba nxt) { // Put the clock in PLL/2 mode await nxt.WriteWordAsync(0xFFFFFC30, 0x7); // Unlock the flash chip await nxt.UnlockAllRegionsAsync(); // Send the flash writing routine await nxt.SendFileAsync(0x202000, Nxt.Flash.Bin); }
static async Task FlashBlockAsync(this Samba nxt, uint blockNum, byte[] buf) { // Set the target block number await nxt.WriteWordAsync(0x202300, blockNum); // Send the block to flash await nxt.SendFileAsync(0x202100, buf); // Jump into the flash writing routine await nxt.GoAsync(0x202000); }