Beispiel #1
0
bool spifs_format(void)
{
    SPIFlash handler;

    // Wait for exclusive access to the SPI master bus.
    osMutexWait(spiMasterMutex, osWaitForever);

    // Open the SPI flash device.
    spi_flash_open(SPI0, SPI_MODE0, false, Freq_1Mbps, &handler);

    // Erase the chip.
    spi_flash_erase_chip(&handler);

    // Close the SPI flash device.
    spi_flash_close(&handler);

    // Release exclusive access to the SPI master bus.
    osMutexRelease(spiMasterMutex);

    return true;
}
Beispiel #2
0
/**
 * erase active bios flash
 *
 * \return status code
 */
unsigned char bios_flash_erase(void)
{
	debug_uart_printf(DBG_GRP_FRU, 2, "Erase BIOS Flash\n");

	return spi_flash_erase_chip(&bios_flash);
}