← index #4832PR #4752
Related · high · value 0.203
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 · PULL REQUEST

stm32: Move factory reset files and code to separate source file.

closedby dpgeorgeopened 2019-05-06updated 2019-05-07

The new function factory_reset_make_files() populates the given filesystem with the default factory files. It is defined with weak linkage so it can be overridden by a board.

This commit also brings some minor user-facing changes:

  • boot.py is now no longer created unconditionally if it doesn't exist, it is now only created when the filesystem is formatted and the other files are populated (so, before, if the user deleted boot.py it would be recreated at next boot; now it won't be).

  • pybcdc.inf and README.txt are only created if the board has USB, because they only really make sense if the filesystem is exposed via USB.

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