← index #16537Issue #18312
Off-topic · high · value 0.866
QUERY · ISSUE

mboot fails to build

openby zeroby0opened 2025-01-07updated 2026-03-18
bugport-stm32needs-info

Port, board and/or hardware

ARDUINO_PORTENTA_H7

MicroPython version

git describe --dirty: v1.24.0-181-g495ce91ca; Building for ARDUINO_PORTENTA_H7.

But the board says MicroPython v1.25.0-preview.180.g495ce91ca on 2025-01-07; Arduino Portenta H7 with STM32H747 when I flash mpython (it already has mboot I guess).

I've also tried this for tag v1.24.0 and the same error occurs.

Reproduction

Following build instructions from here: https://github.com/micropython/micropython/tree/master/ports/stm32#build-instructions

git clone https://github.com/micropython/micropython.git
cd micropython/
make -C mpy-cross
cd ports/stm32/
make BOARD=ARDUINO_PORTENTA_H7 submodules
make BOARD=ARDUINO_PORTENTA_H7
make -C mboot BOARD=ARDUINO_PORTENTA_H7

Expected behaviour

mboot builds

Observed behaviour

....
....
CC ../../../lib/uzlib/header.c
CC ../../../lib/uzlib/tinflate.c
CC adc.c
CC main.c
main.c: In function 'build_flash_layout_str':
main.c:449:40: error: 'FLASH_LAYOUT_TEMPLATE' undeclared (first use in this function); did you mean 'FLASH_LAYOUT_STR_ALLOC'?
  449 | #define FLASH_LAYOUT_STR_ALLOC (sizeof(FLASH_LAYOUT_TEMPLATE))
      |                                        ^~~~~~~~~~~~~~~~~~~~~
main.c:453:18: note: in expansion of macro 'FLASH_LAYOUT_STR_ALLOC'
  453 |     size_t len = FLASH_LAYOUT_STR_ALLOC - 1;
      |                  ^~~~~~~~~~~~~~~~~~~~~~
main.c:449:40: note: each undeclared identifier is reported only once for each function it appears in
  449 | #define FLASH_LAYOUT_STR_ALLOC (sizeof(FLASH_LAYOUT_TEMPLATE))
      |                                        ^~~~~~~~~~~~~~~~~~~~~
main.c:453:18: note: in expansion of macro 'FLASH_LAYOUT_STR_ALLOC'
  453 |     size_t len = FLASH_LAYOUT_STR_ALLOC - 1;
      |                  ^~~~~~~~~~~~~~~~~~~~~~
main.c: In function 'pyb_usbdd_StrDescriptor':
main.c:449:40: error: 'FLASH_LAYOUT_TEMPLATE' undeclared (first use in this function); did you mean 'FLASH_LAYOUT_STR_ALLOC'?
  449 | #define FLASH_LAYOUT_STR_ALLOC (sizeof(FLASH_LAYOUT_TEMPLATE))
      |                                        ^~~~~~~~~~~~~~~~~~~~~
main.c:1191:26: note: in expansion of macro 'FLASH_LAYOUT_STR_ALLOC'
 1191 |                 char buf[FLASH_LAYOUT_STR_ALLOC];
      |                          ^~~~~~~~~~~~~~~~~~~~~~
main.c:1191:22: error: unused variable 'buf' [-Werror=unused-variable]
 1191 |                 char buf[FLASH_LAYOUT_STR_ALLOC];
      |                      ^~~
cc1: all warnings being treated as errors
make: *** [Makefile:295: build-ARDUINO_PORTENTA_H7/main.o] Error 1
make: Leaving directory '........./micropython/ports/stm32/mboot'

Additional Information

Link to offending line in main.c for your convenience: https://github.com/micropython/micropython/blob/master/ports/stm32/mboot/main.c#L449

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

NUCLEO_G0B1RE fails to build if CAN is enabled

openby lukieropened 2025-10-21updated 2026-03-15
bugport-stm32

Port, board and/or hardware

NUCLEO_G0B1RE

MicroPython version

v1.26.1

Reproduction

make BOARD=NUCLEO_G0B1RE -j20
with

#define MICROPY_HW_CAN1_TX          (pin_D1)
#define MICROPY_HW_CAN1_RX          (pin_D0)

in mpconfigboard.h

Expected behaviour

Successful build

Observed behaviour

In file included from ../../py/mpstate.h:35,
                 from ../../py/runtime.h:29,
                 from pin.c:27:
build-NUCLEO_G0B1RE/genhdr/pins_af_const.h:60:49: error: 'GPIO_AF3_CAN1' undeclared here (not in a function); did you mean 'GPIO_AF3_FDCAN1'?
   60 |     { MP_ROM_QSTR(MP_QSTR_AF3_CAN1), MP_ROM_INT(GPIO_AF3_CAN1) },
      |                                                 ^~~~~~~~~~~~~
../../py/obj.h:90:67: note: in definition of macro 'MP_OBJ_NEW_SMALL_INT'
   90 | #define MP_OBJ_NEW_SMALL_INT(small_int) ((mp_obj_t)((((mp_uint_t)(small_int)) << 1) | 1))
      |                                                                   ^~~~~~~~~
build-NUCLEO_G0B1RE/genhdr/pins_af_const.h:60:38: note: in expansion of macro 'MP_ROM_INT'
   60 |     { MP_ROM_QSTR(MP_QSTR_AF3_CAN1), MP_ROM_INT(GPIO_AF3_CAN1) },
      |                                      ^~~~~~~~~~
-e See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
CC eth_phy.c
make: *** [../../py/mkrules.mk:101: build-NUCLEO_G0B1RE/pin.o] Error 1
make: *** Waiting for unfinished jobs....
fdcan.c: In function 'can_init':
fdcan.c:204:30: error: 'FDCAN1_IT0_IRQn' undeclared (first use in this function); did you mean 'TIM16_FDCAN_IT0_IRQn'?
  204 |             NVIC_SetPriority(FDCAN1_IT0_IRQn, IRQ_PRI_CAN);
      |                              ^~~~~~~~~~~~~~~
      |                              TIM16_FDCAN_IT0_IRQn
fdcan.c:204:30: note: each undeclared identifier is reported only once for each function it appears in
pyb_can.c: In function 'pyb_can_rxcallback':
pyb_can.c:78:37: error: 'FDCAN1_IT0_IRQn' undeclared (first use in this function); did you mean 'CAN1_RX0_IRQn'?
   78 | #define CAN1_RX0_IRQn               FDCAN1_IT0_IRQn
      |                                     ^~~~~~~~~~~~~~~
pyb_can.c:926:44: note: in expansion of macro 'CAN1_RX0_IRQn'
  926 |             irq = (fifo == CAN_RX_FIFO0) ? CAN1_RX0_IRQn : CAN1_RX1_IRQn;
      |                                            ^~~~~~~~~~~~~
pyb_can.c:78:37: note: each undeclared identifier is reported only once for each function it appears in
   78 | #define CAN1_RX0_IRQn               FDCAN1_IT0_IRQn
      |                                     ^~~~~~~~~~~~~~~
pyb_can.c:926:44: note: in expansion of macro 'CAN1_RX0_IRQn'
  926 |             irq = (fifo == CAN_RX_FIFO0) ? CAN1_RX0_IRQn : CAN1_RX1_IRQn;
      |                                            ^~~~~~~~~~~~~
fdcan.c:206:30: error: 'FDCAN1_IT1_IRQn' undeclared (first use in this function)
  206 |             NVIC_SetPriority(FDCAN1_IT1_IRQn, IRQ_PRI_CAN);
      |                              ^~~~~~~~~~~~~~~
pyb_can.c:79:37: error: 'FDCAN1_IT1_IRQn' undeclared (first use in this function); did you mean 'CAN1_RX1_IRQn'?
   79 | #define CAN1_RX1_IRQn               FDCAN1_IT1_IRQn
      |                                     ^~~~~~~~~~~~~~~
pyb_can.c:926:60: note: in expansion of macro 'CAN1_RX1_IRQn'
  926 |             irq = (fifo == CAN_RX_FIFO0) ? CAN1_RX0_IRQn : CAN1_RX1_IRQn;
      |                                                            ^~~~~~~~~~~~~
fdcan.c: In function 'can_deinit':
fdcan.c:233:29: error: 'FDCAN1_IT0_IRQn' undeclared (first use in this function); did you mean 'TIM16_FDCAN_IT0_IRQn'?
  233 |         HAL_NVIC_DisableIRQ(FDCAN1_IT0_IRQn);
      |                             ^~~~~~~~~~~~~~~
      |                             TIM16_FDCAN_IT0_IRQn
-e See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
make: *** [../../py/mkrules.mk:101: build-NUCLEO_G0B1RE/pyb_can.o] Error 1
fdcan.c:234:29: error: 'FDCAN1_IT1_IRQn' undeclared (first use in this function)
  234 |         HAL_NVIC_DisableIRQ(FDCAN1_IT1_IRQn);
      |                             ^~~~~~~~~~~~~~~
fdcan.c: In function 'can_receive':
fdcan.c:324:74: error: 'FDCAN_InitTypeDef' has no member named 'RxFifo0ElmtSize'
  324 |         address = (uint32_t *)(can->msgRam.RxFIFO0SA + (index * can->Init.RxFifo0ElmtSize * 4));
      |                                                                          ^
fdcan.c:331:74: error: 'FDCAN_InitTypeDef' has no member named 'RxFifo1ElmtSize'
  331 |         address = (uint32_t *)(can->msgRam.RxFIFO1SA + (index * can->Init.RxFifo1ElmtSize * 4));
      |                                                                          ^
-e See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
make: *** [../../py/mkrules.mk:101: build-NUCLEO_G0B1RE/fdcan.o] Error 1

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

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