No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
Hi!
I am trying to make mboot for default PYBV10 board.
I added MBOOT_BOOTPIN_PIN related defines in /PYBV10/mpconfigboard.h:
#define MBOOT_BOOTPIN_PIN (pin_A0)
#define MBOOT_BOOTPIN_PULL (MP_HAL_PIN_PULL_UP)
#define MBOOT_BOOTPIN_ACTIVE (0)
After $ make V=1 USE_MBOOT=1, mboot got following error:
In file included from ../../../py/mphal.h:34:0,
from fsload.c:29:
./mphalport.h:29:10: fatal error: genhdr/pins.h: No such file or directory
#include "genhdr/pins.h"
^~~~~~~~~~~~~~~
compilation terminated.
make: *** [build-PYBV10/fsload.o] Error 1
make: *** Waiting for unfinished jobs....
I am looking into /stm32/Makefile to understand how to fix this, any help? Thanks in advance!
Regards,
WG
I am trying to make mboot for default PYBV10 board.
I added MBOOT_BOOTPIN_PIN related defines in /PYBV10/mpconfigboard.h:
#define MBOOT_BOOTPIN_PIN (pin_A0)
#define MBOOT_BOOTPIN_PULL (MP_HAL_PIN_PULL_UP)
#define MBOOT_BOOTPIN_ACTIVE (0)
After $ make V=1 USE_MBOOT=1, mboot got following error:
In file included from ../../../py/mphal.h:34:0,
from fsload.c:29:
./mphalport.h:29:10: fatal error: genhdr/pins.h: No such file or directory
#include "genhdr/pins.h"
^~~~~~~~~~~~~~~
compilation terminated.
make: *** [build-PYBV10/fsload.o] Error 1
make: *** Waiting for unfinished jobs....
I am looking into /stm32/Makefile to understand how to fix this, any help? Thanks in advance!
Regards,
WG
Re: No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
I'd try doing a clean and starting again.
I did: and everything seemed to build fine for me. I always specify BOARD= because I often use a GNUmakefile which changes the default. I wouldn't expect it to make any difference for you.
I did:
Code: Select all
make BOARD=PYBV10 clean
make BOARD=PYBV10 USE_MBOOT=1
Re: No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
Hi Dave
Thanks! You are correct, 'make' process works with your suggest.
Regards,
WG
Thanks! You are correct, 'make' process works with your suggest.
Regards,
WG
Re: No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
After modifying my mpconfigboard.h as you did, I was able to do the following: After this is I connected A0 to ground and pressed reset, then I'd get the read led flashing, indicating that mboot was running. Also dfu-util -l reported: i.e. just one line, where dfu-util -l reports 4 lines when the builtin DFU bootloader is running.
I then tried to build micropython and flash it: and it seemed to flash, but I got the LEDs lit up like in DFU mode and no USB serial port, so it looks like MicroPython didn't actually run.
If I connect A0 (i.e. X1) to ground and press RESET I get back to the blinking red led.
So I need to figure out why the bootloader isn't working.
I downloaded the flash and it seems to match what it's supposed to....
Code: Select all
cd ports/stm32/mboot
make
...put board in DFU mode...
make deploy
Code: Select all
Found DFU: [0483:df11] ver=2200, devnum=13, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg", serial="3650326B3432"
I then tried to build micropython and flash it:
Code: Select all
cd ports/stm32
make USE_MBOOT=1
make deploy
If I connect A0 (i.e. X1) to ground and press RESET I get back to the blinking red led.
So I need to figure out why the bootloader isn't working.
I downloaded the flash and it seems to match what it's supposed to....
Re: No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
Hi Dave,
I tried dfu-util, but it does not work for mboot.
1. dfu-util: dfu-util-0.9-win64
2. command: dfu-util -a 0 -d 0483:df11 -D firmware.dfu
3. error output: Cannot open DFU device 0483:df11
No DFU capable USB device available
So, I changed to use en.stsw-stm32080.zip from ST, it can write firmware.dfu properly.
link: https://www.st.com/en/development-tools ... 32080.html
I also made small change with /mboot/main.c:
//if (reset_mode != 4 && (msp & APP_VALIDITY_BITS) == 0) {
if ((msp & APP_VALIDITY_BITS) == 0) {
Regards,
WG
I tried dfu-util, but it does not work for mboot.
1. dfu-util: dfu-util-0.9-win64
2. command: dfu-util -a 0 -d 0483:df11 -D firmware.dfu
3. error output: Cannot open DFU device 0483:df11
No DFU capable USB device available
So, I changed to use en.stsw-stm32080.zip from ST, it can write firmware.dfu properly.
link: https://www.st.com/en/development-tools ... 32080.html
I also made small change with /mboot/main.c:
//if (reset_mode != 4 && (msp & APP_VALIDITY_BITS) == 0) {
if ((msp & APP_VALIDITY_BITS) == 0) {
Regards,
WG
Re: No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
For me, dfu-util is working fine (I'm running under linux). It flashes the dfu file and I can read it back and compare with the firmware.bin and it matches exactly. I'm actually using pydfu to flash the application code. And it is also working, since I can read it back using dfu-util and it compares with the firmware.bin that was built for micropython.
reset_mode = 4 means to enter the bootloader. So on the pyboard, you can press and hold the USR button while resetting. Then when the blue LED is lit, release the USR button. This sets reset_mode to 4, which causes mboot to not boot the program.
reset_mode 0 thru 3 get passed into the application (micropython).
reset_mode = 4 means to enter the bootloader. So on the pyboard, you can press and hold the USR button while resetting. Then when the blue LED is lit, release the USR button. This sets reset_mode to 4, which causes mboot to not boot the program.
reset_mode 0 thru 3 get passed into the application (micropython).
Re: No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
Hi Dave,
Thanks for sharing more details!
I just ported mboot to other stm32 hardware with 1 USR switch and 1 LED, the change to remove reset_mode can jump to application automatically and run mboot if hold the USR switch after reboot.
I am using RaspberryPi 3B+ for cross-compiling MicroPython firmware, that saves a lot time.
[SOLVED] Under my Pi3, dfu-util: Cannot open Dfu device 0483:df11
$ groups $USER & sudo dfu-util -l
Have a nice weekend!
WG
Thanks for sharing more details!
I just ported mboot to other stm32 hardware with 1 USR switch and 1 LED, the change to remove reset_mode can jump to application automatically and run mboot if hold the USR switch after reboot.
I am using RaspberryPi 3B+ for cross-compiling MicroPython firmware, that saves a lot time.
[SOLVED] Under my Pi3, dfu-util: Cannot open Dfu device 0483:df11
$ groups $USER & sudo dfu-util -l
Have a nice weekend!
WG
Re: No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
Hi wghe, I am trying to use mboot and I am having the same problem when using dfu-util.
I use https://zadig.akeo.ie/ to change the driver, then it works.
Hi Dave, The mboot on my PYBV10 board works fine, but the micropython firmware flash via mboot is not working properly.
Here is the issues https://github.com/micropython/micropython/issues/4586
Code: Select all
Cannot open Dfu device 0483:df11
No DFU capable USB device available
Hi Dave, The mboot on my PYBV10 board works fine, but the micropython firmware flash via mboot is not working properly.
Here is the issues https://github.com/micropython/micropython/issues/4586
Re: No genhdr/pins.h to make mboot with MBOOT_BOOTPIN_PIN
Hi Meekdai,
Thanks, will try that zadig.
Regards,
WG
Thanks, will try that zadig.
Regards,
WG