2023-03-15 05:58 AM
in this condition using to continuously erase the data.
uint8_t erase_cmd[6]={0x20, 0x00, 0x00, 0x00, 0x00, 0x95};
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET); // Chip select pin
HAL_SPI_Transmit(&hspi1, erase_cmd, sizeof(erase_cmd), HAL_MAX_DELAY);
HAL_SPI_Receive(&hspi1, &status, 1, HAL_MAX_DELAY);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_SET);
2023-04-12 06:39 AM
Hello @mrsmile,
You may need to refer to the datasheet to check erase command.
Also, could you please check buffer status in the receive function?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.