How to port Micropython to new Microcontroller

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: How to port Micropython to new Microcontroller

Post by jimmo » Mon Jan 27, 2020 4:09 am

FYI if you're updating the tinyusb module, you're going to run into the same issue I described here:
https://github.com/micropython/micropython/pull/5558

(I can't tell if this is a git bug or limitation, but yeah looks like moving submodules inside submodules is a problem)

blipton
Posts: 8
Joined: Mon Dec 15, 2014 3:11 am

Re: How to port Micropython to new Microcontroller

Post by blipton » Mon Feb 10, 2020 12:14 am

I too would love to port to a nucleo board that's currently not listed in the official supported hardware (STM32H743).

I assume the NUCLEO-F401RE is the best starting point, but having trouble importing/creating an Stm32CubeIde project with it. Is it generally recommended to build strictly via the command-line, or is are most Stm32 ports using the IDE?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: How to port Micropython to new Microcontroller

Post by jimmo » Mon Feb 10, 2020 9:59 pm

All the ports (including stm32) build from the command line.

The H7 is quite different to the F401. ports/stm32/boards/NUCLEO_H743ZI would be a much better starting point (and possibly even exactly what you need??)

sdherbert
Posts: 3
Joined: Wed Jun 10, 2020 6:53 pm

Re: How to port Micropython to new Microcontroller

Post by sdherbert » Wed Jun 10, 2020 7:09 pm

I'm working on a port for the MIMXRT1064_EVK. I've created these files under ports/mimrxt:

MIMXRT1064_EVK/evkmimxrt1064_flexspi_nor_config.h
MIMXRT1064_EVK/flash_config.c
MIMXRT1064_EVK/mpconfigboard.h
MIMXRT1064_EVK/mpconfigboard.mk
MIMXRT1064.ld

When I try and compile the port I run into the following errors:

Code: Select all

../../lib/nxp_driver/sdk/devices/MIMXRT1064/xip/fsl_flexspi_nor_boot.h:106:2: error: #error "Please define macro BOARD_FLASH_SIZE"
  106 | #error "Please define macro BOARD_FLASH_SIZE"
      |  ^~~~~
../../lib/nxp_driver/sdk/devices/MIMXRT1064/xip/fsl_flexspi_nor_boot.c:45:3: error: 'FLASH_SIZE' undeclared here (not in a function); did you mean 'FLASH_BASE'?
   45 |   FLASH_SIZE,                 /* size */
      |   ^~~~~~~~~~
      |   FLASH_BASE
make: *** [../../py/mkrules.mk:63: build-MIMXRT1064_EVK/lib/nxp_driver/sdk/devices/MIMXRT1064/xip/fsl_flexspi_nor_boot.o] Error 1
BOARD_FLASH_SIZE is defined in mpconfigboard.h.

I was hoping someone has seen this error and knows what I overlooked when I added the files for the 1064.

The 1060 is still building without errors.

Post Reply