[ARM] how to erase the previous data in SD card(SPI communication) by using erase command in stm32f103c8(HAL library)

Status
Not open for further replies.

Mr smile

Newbie
Joined
Mar 15, 2023
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
1
in this condition using to continuously erase the data.

Code:
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);
 

hello,
CMD32(0x20) its working for erase the data on continuously. but i need to the output for erase the previous data and store Current data to stored.
i'm using this function. but still this is continuously erase the data.
 

Attachments

  • SD.PNG
    21.4 KB · Views: 79

Referring to SD specification, the question makes little sense for me.

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…