← index #4832Issue #6903
Related · high · value 1.812
QUERY · ISSUE

stm32: Factory reset from code

openby TravisJoeopened 2019-06-05updated 2022-01-01
port-stm32

I believe factory reset should be available as an alternative to USR. USR might not be practical or accessible for custom boards or how the device might be enclosed or accessed.

This might also be related to ways to clear/format/erase the filesystem from code.

Basically recovery and housecleaning.

CANDIDATE · ISSUE

STM32: Can't Factory Reset

closedby braidenopened 2021-02-15updated 2021-03-10
bugport-stm32

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:
https://github.com/micropython/micropython/blob/bffb71f523e4bcc21b913af291deeb67091bed88/ports/stm32/main.c#L534

to: mounted_flash = init_flash_fs(state.reset_mode);

... since https://github.com/micropython/micropython/blob/bffb71f523e4bcc21b913af291deeb67091bed88/ports/stm32/main.c#L475 only updates state.reset_mode not reset_mode.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied