pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
199 stars 167 forks source link

No rule to make target 'build/WIPY/release/frozen_mpy/frozen/Base/_boot.mpy', needed by 'build/WIPY/release/frozen_mpy.c'. Stop. #220

Closed cmisztur closed 6 years ago

cmisztur commented 6 years ago

Hello. I am trying to build firmware from source and make TARGET=app does not compile with following error. Hopefully it's something silly due to my unfamiliarity with the environment. There is no additional Python code in frozen.

...
CC ../py/../extmod/uos_dupterm.c
CC ../py/../lib/embed/abort_.c
CC ../py/../lib/utils/printf.c
make: *** No rule to make target 'build/WIPY/release/frozen_mpy/frozen/Base/_boot.mpy', needed by 'build/WIPY/release/frozen_mpy.c'.  Stop.

I have followed these instructions to setup the build environment on Windows 10:

  1. https://docs.espressif.com/projects/esp-idf/en/latest/get-started/ I am able to build vanilla esp-idf hello_world example.

  2. https://github.com/pycom/pycom-micropython-sigfox I did not download the listed xtensa gcc compiler since one already exists from step 1.

    xtensa-esp32-elf-gcc.exe (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 5.2.0
    $ printenv PATH
    /mingw32/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/opt/xtensa-esp32-elf/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
    https://github.com/pycom/pycom-esp-idf
    $ printenv IDF_PATH
    D:/msys32/home/chris/esp/pycom-esp-idf
    cd mpy-cross && make clean && make && cd ..
    cd esp32
    make clean
    make TARGET=boot
    make TARGET=app
    make flash

output of mpy-cross:

LINK mpy-cross
   text    data     bss     dec     hex filename
 128257    2596     708  131561   201e9 mpy-cross

output of boot target:

LINK xtensa-esp32-elf-gcc *** -nostdlib -Wl,-Map=build/WIPY/release/bootloader/bootloader.map -Wl,--no-check-sections -u call_user_start_cpu0 -Wl,-static -Wl,--undefined=uxTopUsedPriority -Wl,--gc-sections -T esp32.bootloader.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.bootloader.rom.ld -T esp32.rom.spiram_incompatible_fns.ld *** -Wl,--start-group -Lbootloader/lib -Lbootloader -Lbuild/WIPY/release/bootloader -LD:/msys32/home/chris/esp/pycom-esp-idf/components/esp32/ld -LD:/msys32/home/chris/esp/pycom-esp-idf/components/esp32/lib -llog -lcore -lbootloader_support -lspi_flash -lsoc -lmicro-ecc -lgcc -lstdc++ -lgcov build/WIPY/release/bootloader/bootloader.a -Wl,--end-group -Wl,-EL -o build/WIPY/release/bootloader/bootloader.elf
   text    data     bss     dec     hex filename
  16310       8      40   16358    3fe6 build/WIPY/release/bootloader/bootloader.elf
IMAGE build/WIPY/release/bootloader/bootloader.bin

Thanks Chris

cmisztur commented 6 years ago

So removing esp32/frozen folder gets further:

Creating build/WIPY/release/frozen_mpy.c
CC main.c
CC mptask.c
usage: mpy-tool.py [-h] [-d] [-f] [-q QSTR_HEADER]
                   [-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N]
                   files [files ...]
mpy-tool.py: error: too few arguments
make: *** [../py/mkrules.mk:152: build/WIPY/release/frozen_mpy.c] Error 2
make: *** Deleting file 'build/WIPY/release/frozen_mpy.c'
make: *** Waiting for unfinished jobs....

I guess I will look through py/mkrules.mk now.

cmisztur commented 6 years ago

Ok, this works. That was simple.

diff --git a/py/mkrules.mk b/py/mkrules.mk
index 633b0df..b9b235c 100644
--- a/py/mkrules.mk
+++ b/py/mkrules.mk
@@ -115,6 +115,13 @@ FROZEN_MPY_PY_FILES += $(shell find -L $(FROZEN_MPY_DIR)/Common/ -type f -name '
 ifeq ($(BOARD), $(filter $(BOARD), GPY FIPY))
 FROZEN_MPY_PY_FILES += $(shell find -L $(FROZEN_MPY_DIR)/LTE/ -type f -name '*.py' | $(SED) -e 's/$(FROZEN_MPY_DIR)\/LTE\///')
 endif
+else ifeq ($(findstring MINGW32,$(OS_NAME)),MINGW32)
+# make a list of all the .py files that need compiling and freezing
+FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR)/Base/ -type f -name '*.py' | $(SED) -e 's/$(FROZEN_MPY_DIR)\/Base\///')
+FROZEN_MPY_PY_FILES += $(shell find -L $(FROZEN_MPY_DIR)/Common/ -type f -name '*.py' | $(SED) -e 's/$(FROZEN_MPY_DIR)\/Common\///')
+ifeq ($(BOARD), $(filter $(BOARD), GPY FIPY))
+FROZEN_MPY_PY_FILES += $(shell find -L $(FROZEN_MPY_DIR)/LTE/ -type f -name '*.py' | $(SED) -e 's/$(FROZEN_MPY_DIR)\/LTE\///')
+endif
 else
 # make a list of all the .py files that need compiling and freezing
 FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR)/Base/ -type f -name '*.py' | $(SED) -e 's=^$(FROZEN_MPY_DIR)\/Base\//==')
DMESGTA commented 3 years ago

Hi, I am facing the same issue now. But not quite understand how you solve this, could you please elaborate more on this? Thanks