mcauser / BLACK_F407VE

MicroPython board definition for the MCUDev Black STM32F407VET6 board
MIT License
122 stars 47 forks source link

Corrupt board filesystem #5

Closed japuzzo closed 4 years ago

japuzzo commented 6 years ago

This may be due to how I am deploying to the board. The mac keeps erroring out on deploy:

[~/micropython/ports/stm32]$ make BOARD=BLACK_F407VE deploy
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Writing build-BLACK_F407VE/firmware.dfu to the board
Traceback (most recent call last):
  File "../../tools/pydfu.py", line 20, in <module>
    import usb.core
ImportError: No module named usb.core
make: *** [deploy] Error 1

The only way I have found is to use 'dfu-util' which can easily be installed with brew.

[/micropython/ports/stm32]$ make USE_PYDFU=0 BOARD=BLACK_F407VE deploy
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Writing build-BLACK_F407VE/firmware.dfu to the board
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash  "
file contains 1 DFU images
parsing DFU image 1
image for alternate setting 0, (2 elements, total size = 315148)
parsing element 1, address = 0x08000000, size = 14712
Download    [=========================] 100%        14712 bytes
Download done.
parsing element 2, address = 0x08020000, size = 300420
Download    [=========================] 100%       300420 bytes
Download done.
done parsing DfuSe file

So I can attach to the board via the expected port of "/dev/cu.usbmodem1422" ( mac adds the cu.)

Traceback (most recent call last):
  File "main.py", line 1, in <module>
NameError: name 'ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ' is not defined
MicroPython v1.9.3-588-g6b4b6d38-dirty on 2018-05-01; BLACK STM32F407VE with STM32F407VE
Type "help()" for more information.
>>> 

On first mount of the FS all the files contained garbage text. I can manually place boot.py and main.py on the mount and it seems to work. Just not sure if that's the right way to go. Is there any way to re-flash the FS? Any suggestions?

mcauser commented 5 years ago

Fix for ImportError: No module named usb.core: pip3 install pyusb

mcauser commented 5 years ago

You could try erasing and reflashing the dfu file: dfu-util -s :mass-erase:force -a 0 -d 0483:df11 -D build-BLACK_F407VE/firmware.dfu