Format External Flash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 12:18 AM
Hello team,
Is there any way to format the external flash of microcontroller, the reason is that that flash is acting as USB MSC Device. As soon as it connects to PC a popup will arise for disk format. Am planning to do complete mass erase of flash , along with that do i need FATfs system so that windows can recognize it as a device. Kindly guide me sample code or example for the same.
Thanks & regards,
Shikamaru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-17 7:00 AM - edited ‎2024-07-17 7:00 AM
Hello @Shikamaru ,
you can use STM32CubeProgrammer , it is an excellent tool for programming and erasing internal & external flash memory. Here’s how you can use it to perform a mass erase and format the external flash:
Download and Install STM32CubeProgrammer:
- You can download STM32CubeProgrammer from the STMicroelectronics website.
Connect Your Microcontroller:
- Connect your STM32 microcontroller to your PC using a USB cable or ST-LINK programmer.
Open STM32CubeProgrammer:
- Launch the STM32CubeProgrammer application.
Select the Target:
- In the "ST-LINK Configuration" tab, select the appropriate interface (e.g., ST-LINK, USB, UART) and connect to your target microcontroller.
Mass Erase:
- in the "Erasing & Programming" tab Select the "Full chip erase" option to perform a mass erase of the flash memory
Br
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-17 7:28 AM
> flash is acting as USB MSC Device.
No, it is the STM32 acting as USB MSC Device towards the host (PC) and interpreting the host requests. The flash is acting as "dumb memory" (unless it is a SD/MMC card).
> do i need FATfs system so that windows can recognize it as a device.
No, the Windows (host) will act as the flesystem. You need filesystem on the STM32 side (FATFS or other) only if the STM32 program itself is the user of the storage. (but they can take turns: STM32 can mount the storage and deal with the files while the host is not looking).
