← index #5548Issue #4606
Related · high · value 2.254
QUERY · ISSUE

STM32: Not able to build mboot without USB and user switch

openby marc-baopened 2020-01-18updated 2020-01-20
port-stm32

I'm trying to do a board without a USB or switch, using the STM32F411. I want to use MBOOT to update the FW only when it is called from within an application so have no need for a USB or switch. It will use an external SPI flash chip. I've got this working on the basic pyboard.

I've declared the below - yet MBOOT gives multiple errors when calling sudo make BOARD=NAME__ USE_MBOOT=1 clean all

#define MICROPY_HW_HAS_SWITCH (0)
#define MICROPY_HW_ENABLE_USB (0)
#define MICROPY_HW_USB_FS (0)

Is there a way to use MBOOT without a USB or switch?

CANDIDATE · ISSUE

Unable to get mboot to work on PYBV11 (or PYBV10)

closedby dhylandsopened 2019-03-14updated 2019-03-15
port-stm32

I'm just trying to reproduce using mboot on the PYBV11. I was using the latest master c9eb7eb449a246c607fa92a5313e3137d728fbcb

I started by doing a regular micropython build:

cd ports/stm32
make BOARD=PYBV11 clean all deploy

which brought up Micropython fine.

I then put the board in DFU mode and built and flashed mboot

cd ports/stm32/mboot
make BOARD=PYBV11 clean all deploy

I used the USR switch to get mboot into mboot mode (red LED flashing) and dfu-util -l shows:

683 >dfu-util -l
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 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/

Found DFU: [0483:df11] ver=2200, devnum=30, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/04*016Kg,01*064Kg,07*128Kg", serial="336F338F3433"

I then went back to the stm32 directory and build micropython for mboot:

cd ports/stm32
make BOARD=PYBV11 USE_MBOOT=1 clean all deploy

The flashing built a single segment image and it seemed to flash ok:

Writing build-PYBV11/firmware.dfu to the board
File: build-PYBV11/firmware.dfu
    b'DfuSe' v1, image size: 333373, targets: 1
    b'Target' 0, alt setting: 0, name: "ST...", size: 333088, elements: 1
      0, address: 0x08020000, size: 333080
    usb: 0483:df11, device: 0x0000, dfu: 0x011a, b'UFD', 16, 0x687e6871
Writing memory...
0x08020000  333080 [=========================] 100% 
Exiting DFU...

However, when I reset the board, I just get the 3 dimly lit LEDs. Pushing the USR button gets me back into DFU mode.

Before investigating further, I wanted to make sure that I'm not missing a step.

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