Reproduction
After inserting and removing the SD card, an error occurs when deleting a file."
But it is possible to successfully delete the file.
The code is as follows: main.py is used to test SD card read and write operations, sdcard.py is used to implement SD card read and write functionality, sd_block_dev.py is used to implement the SD card block device, and AbstractBlockDevInterface.py is used to implement the block device interface.
Port, board and/or hardware RP2
MicroPython version MicroPython v1.23.0 on RP2
Reproduction After inserting and removing the SD card, an error occurs when deleting a file." But it is possible to successfully delete the file.
The code is as follows: main.py is used to test SD card read and write operations, sdcard.py is used to implement SD card read and write functionality, sd_block_dev.py is used to implement the SD card block device, and AbstractBlockDevInterface.py is used to implement the block device interface.
The implementation of SD card read and write functionality is referenced from the repository: https://github.com/micropython/micropython-lib/blob/master/micropython/drivers/storage/sdcard/sdcard.py