MicroPython on STM32F7
-
- Posts: 9
- Joined: Mon Sep 10, 2018 6:05 am
MicroPython on STM32F7
I am new to micropython, I am using Windows 7 with MinGW and install all drivers from MinGW and MSys.
I am getting this error
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build-STM32F7DISC/genhdr
Create build-STM32F7DISC/genhdr/pins.h
/bin/sh: python: command not found
Is anyone had a same problem before and any suggestion or solution, please share with me.
I am getting this error
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build-STM32F7DISC/genhdr
Create build-STM32F7DISC/genhdr/pins.h
/bin/sh: python: command not found
Is anyone had a same problem before and any suggestion or solution, please share with me.
Re: MicroPython on STM32F7
Install the MinGW version of python (as the error is 'bin/sh: python: command not found'
-
- Posts: 9
- Joined: Mon Sep 10, 2018 6:05 am
Re: MicroPython on STM32F7
Thanks for the reply, I install all option of MinGW then have issue
make V=1 BOARD=STM32F769DISC
python ../../py/makeversionhdr.py build-STM32F769DISC/genhdr/mpversion.h
MPY modules/dht.py
mkdir -p build-STM32F769DISC/frozen_mpy/
../../mpy-cross/mpy-cross -o build-STM32F769DISC/frozen_mpy/dht.mpy -s dht.py modules/dht.py
Traceback (most recent call last):
File "modules/dht.py", line 1
SyntaxError: invalid syntax
make: *** [build-STM32F769DISC/frozen_mpy/dht.mpy] Error 1
Please help me
make V=1 BOARD=STM32F769DISC
python ../../py/makeversionhdr.py build-STM32F769DISC/genhdr/mpversion.h
MPY modules/dht.py
mkdir -p build-STM32F769DISC/frozen_mpy/
../../mpy-cross/mpy-cross -o build-STM32F769DISC/frozen_mpy/dht.mpy -s dht.py modules/dht.py
Traceback (most recent call last):
File "modules/dht.py", line 1
SyntaxError: invalid syntax
make: *** [build-STM32F769DISC/frozen_mpy/dht.mpy] Error 1
Please help me
Re: MicroPython on STM32F7
I'd make a guess that this has something to do with line endings.
-
- Posts: 9
- Joined: Mon Sep 10, 2018 6:05 am
Re: MicroPython on STM32F7
i tried with two separate windows machine one with windows 7 and the other windows 10 and both yield the same result
-
- Posts: 89
- Joined: Fri Sep 11, 2015 10:47 pm
- Location: Italy
Re: MicroPython on STM32F7
The problem is simbolic link under mingw e msys2.
Replace linked files with originals if you need it, else remove unused.
Regards,
D.
Replace linked files with originals if you need it, else remove unused.
Regards,
D.
-
- Posts: 9
- Joined: Mon Sep 10, 2018 6:05 am
Re: MicroPython on STM32F7
Hi Pagano, thanks. Could you elaborate little more what to do that as I am new to this environment, please?
-
- Posts: 9
- Joined: Mon Sep 10, 2018 6:05 am
Re: MicroPython on STM32F7
Hi Guys, this the last message before error
DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool -DMICROPY_MODULE_FROZEN_MPY -c -MD -o build-STM32F769DISC/lib/utils/printf.o ../../lib/utils/printf.c
/usr/bin/sed: -e expression #4, char 1: unknown command: `C'
MPY modules/dht.py
mkdir -p build-STM32F769DISC/frozen_mpy/
../../mpy-cross/mpy-cross -o build-STM32F769DISC/frozen_mpy/dht.mpy -s dht.py modules/dht.py
Traceback (most recent call last):
File "modules/dht.py", line 1
SyntaxError: invalid syntax
make: *** [build-STM32F769DISC/frozen_mpy/dht.mpy] Error 1
DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool -DMICROPY_MODULE_FROZEN_MPY -c -MD -o build-STM32F769DISC/lib/utils/printf.o ../../lib/utils/printf.c
/usr/bin/sed: -e expression #4, char 1: unknown command: `C'
MPY modules/dht.py
mkdir -p build-STM32F769DISC/frozen_mpy/
../../mpy-cross/mpy-cross -o build-STM32F769DISC/frozen_mpy/dht.mpy -s dht.py modules/dht.py
Traceback (most recent call last):
File "modules/dht.py", line 1
SyntaxError: invalid syntax
make: *** [build-STM32F769DISC/frozen_mpy/dht.mpy] Error 1
-
- Posts: 9
- Joined: Mon Sep 10, 2018 6:05 am
Re: MicroPython on STM32F7
https://github.com/MarkR42/micropython/ ... l/Makefile
I notice that the latest (2018 Sep 2018) STM32hal make file is slightly different from 2016
2018 make file
ifneq ($(FROZEN_DIR),)
# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
endif
2016 make file
ifneq ($(FROZEN_MPY_DIR),)
# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
FROZEN_MPY_PY_FILES := $(shell find $(FROZEN_MPY_DIR) -type f -name '*.py')
FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy))
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
OBJ += $(BUILD)/$(BUILD)/frozen_mpy.o
MPY_CROSS = ../mpy-cross/mpy-cross
MPY_TOOL = ../tools/mpy-tool.py
$(BUILD)/$(FROZEN_MPY_DIR)/%.mpy: $(FROZEN_MPY_DIR)/%.py
@$(ECHO) "MPY $<"
$(Q)$(MKDIR) -p $(dir $@)
$(Q)$(MPY_CROSS) -o $@ -s $(^:$(FROZEN_MPY_DIR)/%=%) $^
$(BUILD)/frozen_mpy.c: $(FROZEN_MPY_MPY_FILES) $(BUILD)/genhdr/qstrdefs.generated.h
@$(ECHO) "Creating $@"
$(Q)$(PYTHON) $(MPY_TOOL) -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h $(FROZEN_MPY_MPY_FILES) > $@
endif
I notice that the latest (2018 Sep 2018) STM32hal make file is slightly different from 2016
2018 make file
ifneq ($(FROZEN_DIR),)
# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
endif
2016 make file
ifneq ($(FROZEN_MPY_DIR),)
# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
FROZEN_MPY_PY_FILES := $(shell find $(FROZEN_MPY_DIR) -type f -name '*.py')
FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy))
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
OBJ += $(BUILD)/$(BUILD)/frozen_mpy.o
MPY_CROSS = ../mpy-cross/mpy-cross
MPY_TOOL = ../tools/mpy-tool.py
$(BUILD)/$(FROZEN_MPY_DIR)/%.mpy: $(FROZEN_MPY_DIR)/%.py
@$(ECHO) "MPY $<"
$(Q)$(MKDIR) -p $(dir $@)
$(Q)$(MPY_CROSS) -o $@ -s $(^:$(FROZEN_MPY_DIR)/%=%) $^
$(BUILD)/frozen_mpy.c: $(FROZEN_MPY_MPY_FILES) $(BUILD)/genhdr/qstrdefs.generated.h
@$(ECHO) "Creating $@"
$(Q)$(PYTHON) $(MPY_TOOL) -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h $(FROZEN_MPY_MPY_FILES) > $@
endif
-
- Posts: 89
- Joined: Fri Sep 11, 2015 10:47 pm
- Location: Italy
Re: MicroPython on STM32F7
The problem is that the content of the file "modules/dht.py" is not python code but the text "../../../drivers/dht/dht.py" which represents a symbolic link on unix systems.
You are compiling with mingw (but the same problem is with msys2) which does not understand that "modules/dht.py" file is not a regular file but a symbolic link.
The solutions can be many, but try one of the following:
1) If you do not need those modules do not use the "modules" folder as FROZEN_MPY_DIR folder but specify your own where "scripts" is a folder pre-existent and must at least contain one .py file (even empty is fine).
2) remove all the .py files in the "modules" folder and create an empty .py file (touch modules/__ empty__.py)
Regards,
D.
You are compiling with mingw (but the same problem is with msys2) which does not understand that "modules/dht.py" file is not a regular file but a symbolic link.
The solutions can be many, but try one of the following:
1) If you do not need those modules do not use the "modules" folder as FROZEN_MPY_DIR folder but specify your own
Code: Select all
make V=1 BOARD=STM32F769DISC FROZEN_MPY_DIR="scripts"
2) remove all the .py files in the "modules" folder and create an empty .py file (touch modules/__ empty__.py)
Regards,
D.