Page 1 of 1

BLACK STM32F407ZGT: factory resetting

Posted: Tue Jul 30, 2019 2:02 am
by yuanyanhui
I flashed a BLACK STM32F407ZGT using mcauser's github repo. After resetting the board while connected to the computer, it says main.py was corrupted. How to do a factory resetting on this board? There are instructions for the official pyboard. But it uses green and yellow LEDs to control the timing of releasing the reset button. It seems this method does not apply to BLACK STM32F407ZGT.

Re: BLACK STM32F407ZGT: factory resetting

Posted: Tue Jul 30, 2019 3:01 am
by yuanyanhui
Reflashed firmware and the problem is still there. I even executed some Arduino code to make sure micropython was wiped out before reflashing. Why?

Re: BLACK STM32F407ZGT: factory resetting

Posted: Tue Jul 30, 2019 5:16 am
by jimmo
To factory reset the filesystem: holding down hte USR button after reset, it cycles through four stages. If you have a single LED then it flashes the number of times to indicate which stage. If you release USR in stage 3 it will reset the filesystem.

Re: BLACK STM32F407ZGT: factory resetting

Posted: Tue Jul 30, 2019 7:24 am
by yuanyanhui
@jimmo Thank you for your help. Using button K1 and RST, the board was reset successfully. I still got two questions regarding the file system:
1. Why reflashing micropython doesn't erase the corrupted file system.
2. Arduino code is burned using stlink, while micropython using dfu. Are codes flashed into different memory locations with these two methods?

Re: BLACK STM32F407ZGT: factory resetting

Posted: Tue Jul 30, 2019 8:03 am
by jimmo
The flashing process only writes the areas where it needs to. You can optionally do a full erase during flashing if you want. (Mass erase, as opposed to the page-erase that the flash process does).

MicroPython keeps the code and filesystem in separate areas of flash, so flashing code will not overwrite the filesystem. This is actually really handy while doing MicroPython firmware development, not having to re-upload test code and libraries every time.

If your Arduino sketch was small it likely only wrote a small section of flash, leaving everything else intact.

Re: BLACK STM32F407ZGT: factory resetting

Posted: Tue Jul 30, 2019 10:17 am
by yuanyanhui
Thanks again for the clarification.

Re: BLACK STM32F407ZGT: factory resetting

Posted: Fri Aug 09, 2019 3:52 am
by mcauser
Is it possible to trigger the filesystem reset from the REPL?