mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 00:50:24 +08:00
ports: Add new make target "submodules" which inits required modules.
This commit is contained in:
parent
3ee71ff314
commit
d7a9388fe0
19
README.md
19
README.md
@ -86,8 +86,8 @@ Alternatively, fallback implementation based on setjmp/longjmp can be used.
|
|||||||
|
|
||||||
To build (see section below for required dependencies):
|
To build (see section below for required dependencies):
|
||||||
|
|
||||||
$ git submodule update --init
|
|
||||||
$ cd ports/unix
|
$ cd ports/unix
|
||||||
|
$ make submodules
|
||||||
$ make
|
$ make
|
||||||
|
|
||||||
Then to give it a try:
|
Then to give it a try:
|
||||||
@ -127,13 +127,14 @@ Debian/Ubuntu/Mint derivative Linux distros, install `build-essential`
|
|||||||
Other dependencies can be built together with MicroPython. This may
|
Other dependencies can be built together with MicroPython. This may
|
||||||
be required to enable extra features or capabilities, and in recent
|
be required to enable extra features or capabilities, and in recent
|
||||||
versions of MicroPython, these may be enabled by default. To build
|
versions of MicroPython, these may be enabled by default. To build
|
||||||
these additional dependencies, first fetch git submodules for them:
|
these additional dependencies, in the port directory you're
|
||||||
|
interested in (e.g. `ports/unix/`) first execute:
|
||||||
|
|
||||||
$ git submodule update --init
|
$ make submodules
|
||||||
|
|
||||||
Use the same command to get the latest versions of dependencies, as
|
This will fetch all the relevant git submodules (sub repositories) that
|
||||||
they are updated from time to time. After that, in the port directory
|
the port needs. Use the same command to get the latest versions of
|
||||||
(e.g. `ports/unix/`), execute:
|
submodules as they are updated from time to time. After that execute:
|
||||||
|
|
||||||
$ make deplibs
|
$ make deplibs
|
||||||
|
|
||||||
@ -146,8 +147,8 @@ For example, to build SSL module (required for `upip` tool described above,
|
|||||||
and so enabled by dfeault), `MICROPY_PY_USSL` should be set to 1.
|
and so enabled by dfeault), `MICROPY_PY_USSL` should be set to 1.
|
||||||
|
|
||||||
For some ports, building required dependences is transparent, and happens
|
For some ports, building required dependences is transparent, and happens
|
||||||
automatically. They still need to be fetched with the git submodule command
|
automatically. But they still need to be fetched with the `make submodules`
|
||||||
above.
|
command.
|
||||||
|
|
||||||
The STM32 version
|
The STM32 version
|
||||||
-----------------
|
-----------------
|
||||||
@ -159,8 +160,8 @@ https://launchpad.net/gcc-arm-embedded
|
|||||||
|
|
||||||
To build:
|
To build:
|
||||||
|
|
||||||
$ git submodule update --init
|
|
||||||
$ cd ports/stm32
|
$ cd ports/stm32
|
||||||
|
$ make submodules
|
||||||
$ make
|
$ make
|
||||||
|
|
||||||
You then need to get your board into DFU mode. On the pyboard, connect the
|
You then need to get your board into DFU mode. On the pyboard, connect the
|
||||||
|
@ -38,6 +38,8 @@ FROZEN_MPY_DIR = modules
|
|||||||
# include py core make definitions
|
# include py core make definitions
|
||||||
include $(TOP)/py/py.mk
|
include $(TOP)/py/py.mk
|
||||||
|
|
||||||
|
GIT_SUBMODULES = lib/berkeley-db-1.xx
|
||||||
|
|
||||||
PORT ?= /dev/ttyUSB0
|
PORT ?= /dev/ttyUSB0
|
||||||
BAUD ?= 460800
|
BAUD ?= 460800
|
||||||
FLASH_MODE ?= dio
|
FLASH_MODE ?= dio
|
||||||
|
@ -122,17 +122,10 @@ this repository):
|
|||||||
$ make -C mpy-cross
|
$ make -C mpy-cross
|
||||||
```
|
```
|
||||||
|
|
||||||
The ESP32 port has a dependency on Berkeley DB, which is an external
|
|
||||||
dependency (git submodule). You'll need to have git initialize that
|
|
||||||
module using the commands:
|
|
||||||
```bash
|
|
||||||
$ git submodule init lib/berkeley-db-1.xx
|
|
||||||
$ git submodule update
|
|
||||||
```
|
|
||||||
|
|
||||||
Then to build MicroPython for the ESP32 run:
|
Then to build MicroPython for the ESP32 run:
|
||||||
```bash
|
```bash
|
||||||
$ cd ports/esp32
|
$ cd ports/esp32
|
||||||
|
$ make submodules
|
||||||
$ make
|
$ make
|
||||||
```
|
```
|
||||||
This will produce binary firmware images in the `build/` subdirectory
|
This will produce binary firmware images in the `build/` subdirectory
|
||||||
|
@ -32,6 +32,8 @@ FROZEN_MPY_DIR ?= modules
|
|||||||
# include py core make definitions
|
# include py core make definitions
|
||||||
include $(TOP)/py/py.mk
|
include $(TOP)/py/py.mk
|
||||||
|
|
||||||
|
GIT_SUBMODULES = lib/axtls lib/berkeley-db-1.xx
|
||||||
|
|
||||||
FWBIN = $(BUILD)/firmware-combined.bin
|
FWBIN = $(BUILD)/firmware-combined.bin
|
||||||
PORT ?= /dev/ttyACM0
|
PORT ?= /dev/ttyACM0
|
||||||
BAUD ?= 115200
|
BAUD ?= 115200
|
||||||
|
@ -41,6 +41,8 @@ QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h
|
|||||||
# include py core make definitions
|
# include py core make definitions
|
||||||
include ../../py/py.mk
|
include ../../py/py.mk
|
||||||
|
|
||||||
|
GIT_SUBMODULES = lib/nrfx lib/tinyusb
|
||||||
|
|
||||||
MICROPY_FATFS ?= 0
|
MICROPY_FATFS ?= 0
|
||||||
FATFS_DIR = lib/oofatfs
|
FATFS_DIR = lib/oofatfs
|
||||||
MPY_CROSS = ../../mpy-cross/mpy-cross
|
MPY_CROSS = ../../mpy-cross/mpy-cross
|
||||||
|
@ -50,11 +50,11 @@ Prerequisite steps for building the nrf port:
|
|||||||
|
|
||||||
git clone <URL>.git micropython
|
git clone <URL>.git micropython
|
||||||
cd micropython
|
cd micropython
|
||||||
git submodule update --init
|
|
||||||
make -C mpy-cross
|
make -C mpy-cross
|
||||||
|
|
||||||
By default, the PCA10040 (nrf52832) is used as compile target. To build and flash issue the following command inside the ports/nrf/ folder:
|
By default, the PCA10040 (nrf52832) is used as compile target. To build and flash issue the following command inside the ports/nrf/ folder:
|
||||||
|
|
||||||
|
make submodules
|
||||||
make
|
make
|
||||||
make flash
|
make flash
|
||||||
|
|
||||||
|
@ -19,6 +19,8 @@ QSTR_GLOBAL_DEPENDENCIES = $(BOARD_DIR)/mpconfigboard.h
|
|||||||
# Include py core make definitions
|
# Include py core make definitions
|
||||||
include $(TOP)/py/py.mk
|
include $(TOP)/py/py.mk
|
||||||
|
|
||||||
|
GIT_SUBMODULES = lib/asf4 lib/tinyusb
|
||||||
|
|
||||||
INC += -I.
|
INC += -I.
|
||||||
INC += -I$(TOP)
|
INC += -I$(TOP)
|
||||||
INC += -I$(BUILD)
|
INC += -I$(BUILD)
|
||||||
|
@ -24,6 +24,8 @@ FROZEN_MPY_DIR ?= modules
|
|||||||
# include py core make definitions
|
# include py core make definitions
|
||||||
include $(TOP)/py/py.mk
|
include $(TOP)/py/py.mk
|
||||||
|
|
||||||
|
GIT_SUBMODULES = lib/lwip lib/mbedtls lib/mynewt-nimble lib/stm32lib
|
||||||
|
|
||||||
MCU_SERIES_UPPER = $(shell echo $(MCU_SERIES) | tr '[:lower:]' '[:upper:]')
|
MCU_SERIES_UPPER = $(shell echo $(MCU_SERIES) | tr '[:lower:]' '[:upper:]')
|
||||||
CMSIS_MCU_LOWER = $(shell echo $(CMSIS_MCU) | tr '[:upper:]' '[:lower:]')
|
CMSIS_MCU_LOWER = $(shell echo $(CMSIS_MCU) | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
@ -40,7 +40,11 @@ see [here](https://launchpad.net/gcc-arm-embedded) for the main GCC ARM
|
|||||||
Embedded page. The compiler can be changed using the `CROSS_COMPILE` variable
|
Embedded page. The compiler can be changed using the `CROSS_COMPILE` variable
|
||||||
when invoking `make`.
|
when invoking `make`.
|
||||||
|
|
||||||
To build for a given board, run:
|
First the submodules must be obtained using:
|
||||||
|
|
||||||
|
$ make submodules
|
||||||
|
|
||||||
|
Then to build for a given board, run:
|
||||||
|
|
||||||
$ make BOARD=PYBV11
|
$ make BOARD=PYBV11
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@ UNAME_S := $(shell uname -s)
|
|||||||
# include py core make definitions
|
# include py core make definitions
|
||||||
include $(TOP)/py/py.mk
|
include $(TOP)/py/py.mk
|
||||||
|
|
||||||
|
GIT_SUBMODULES = lib/axtls lib/berkeley-db-1.xx lib/libffi
|
||||||
|
|
||||||
INC += -I.
|
INC += -I.
|
||||||
INC += -I$(TOP)
|
INC += -I$(TOP)
|
||||||
INC += -I$(BUILD)
|
INC += -I$(BUILD)
|
||||||
|
@ -143,6 +143,13 @@ clean-prog:
|
|||||||
.PHONY: clean-prog
|
.PHONY: clean-prog
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
submodules:
|
||||||
|
$(ECHO) "Updating submodules: $(GIT_SUBMODULES)"
|
||||||
|
ifneq ($(GIT_SUBMODULES),)
|
||||||
|
$(Q)git submodule update --init $(addprefix $(TOP)/,$(GIT_SUBMODULES))
|
||||||
|
endif
|
||||||
|
.PHONY: submodules
|
||||||
|
|
||||||
LIBMICROPYTHON = libmicropython.a
|
LIBMICROPYTHON = libmicropython.a
|
||||||
|
|
||||||
# We can execute extra commands after library creation using
|
# We can execute extra commands after library creation using
|
||||||
|
Loading…
Reference in New Issue
Block a user