Skip to content

STM32: Can't Factory Reset #6903

Closed
Closed

Description

@braiden

Expected Behavior:

  1. While Holding User Button
  2. Press Reset Button
  3. Release User Button after 3 flashes
  4. Devices echos back 3 flashes
  5. Files-system should be restored to default state.

?

Or am I misunderstanding how it's supposed to work?

I had to change this line:

mounted_flash = init_flash_fs(reset_mode);

to: mounted_flash = init_flash_fs(state.reset_mode);

... since

MICROPY_BOARD_BEFORE_SOFT_RESET_LOOP(&state);
only updates state.reset_mode not reset_mode.

Activity

  1. chrismas9 commented on Feb 15, 2021

    @chrismas9
    Contributor

    Release User Button after 3 flashes

    That depends on the board and how many LEDs are configured. Boards with one LED will flash it three times for FS reset. Boards with three or more LEDs (eg pyboard) count in binary on LED2 and LED3 so FS reset is when both are on. Boards with two LEDs also count in binary but you only see bit 0. When LED2 comes on count is 1. When it goes out count is 2. When it comes on again count is 3. So FS reset is second flash. Many Nucleo boards only have two LEDs.

  2. braiden commented on Feb 15, 2021

    @braiden
    ContributorAuthor

    My board, WeAct_F411CE, has 1 led, active low. So three flash, reset_mode = 3 I believe, and PR should resolve.

    Maybe the bug exists only for boards where MICROPY_HW_USES_BOOTLOADER is false.

  3. dhylands commented on Feb 15, 2021

    @dhylands
    Contributor

    I can confirm that using the latest master than the file system reset no longer works on my PYBV11 board.

    I'm releasing when both orange and green LEDs are lit and the files listed in my filesystem before the reset are still there after the reset.

  4. dhylands commented on Feb 15, 2021

    @dhylands
    Contributor

    I can confirm that the filesystem reset doesn't work on my PYBV11 with the latest master and that the filesystem reset works properly on my PYBV11 with PR #6904

  5. dpgeorge commented on Mar 10, 2021

    @dpgeorge
    Member

    Thanks for the report, and sorry it took a bit of time to get to it.

  6. added a commit that references this issue on Oct 11, 2025
    85ea4ac
  7. added a commit that references this issue on May 23, 2026
    7adca5f
  8. added a commit that references this issue on Sep 21, 2026
    b0cf67d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions