cmdwtf / Odiin

Attempts at nRF52840 ISO 14443-A magic!
https://cmd.wtf/projects#odiin
BSD Zero Clause License
125 stars 22 forks source link

New Error #97

Closed NBAPJ closed 4 years ago

NBAPJ commented 4 years ago

Hi I think I finally got my build environment set up correctly. I ran the make command and got the following files in the Odiin build folder: nrf52840_xxaa.bin, nrf52840_xxaa.hex, nrf52840_xxaa.in, nrf52840_xxaa.map, nrf52840_xxaa.out.

But when I run the make bootloader command I get the following error:

$ make bootloader Building UF2 bootloader... C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -C bootloader BOARD=odiin all make[1]: Entering directory 'C:/Users/melenese/Desktop/OdiinNFC2/Odiin/bootloader' CC dfu_ble_svc.c CC dfu_init.c CC flash_nrf5x.c CC main.c CC boards.c CC pinconfig.c CC nrfx_power.c CC nrfx_nvmc.c CC system_nrf52840.c CC bootloader.c CC bootloader_settings.c CC bootloader_util.c CC dfu_transport_serial.c CC dfu_transport_ble.c CC dfu_single_bank.c CC ble_dfu.c CC ble_dis.c CC pstorage_raw.c CC app_timer.c CC app_scheduler.c CC app_error.c CC app_util_platform.c CC crc16.c CC hci_mem_pool.c CC hci_slip.c CC hci_transport.c CC nrf_assert.c CC msc_uf2.c CC usb.c CC usb_desc.c CC ghostfat.c CC dcd_nrf5x.c CC tusb_fifo.c CC usbd.c CC usbd_control.c CC cdc_device.c CC msc_device.c CC tusb.c AS gcc_startup_nrf52840.S LD odiin_bootloader-0.3.2-158-g23e6539.out text data bss dec hex filename 31300 1572 22594 55466 d8aa _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539.out Create odiin_bootloader-0.3.2-158-g23e6539.hex Create odiin_bootloader-0.3.2-158-g23e6539-nosd.hex process_begin: CreateProcess(NULL, python3 tools/hexmerge.py --overlap=replace -o _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-nosd.hex _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539.hex lib/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex, ...) failed. make (e=2): The system cannot find the file specified. make[1]: [Makefile:387: _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-nosd.hex] Error 2 make[1]: Leaving directory 'C:/Users/melenese/Desktop/OdiinNFC2/Odiin/bootloader' make: [Makefile:483: bootloader] Error 2

nitz commented 4 years ago

Is python on your path? From a command prompt, run where python3 or from powershell, Get-Command python3.

NBAPJ commented 4 years ago

no its not in my path it says

$ where python3 INFO: Could not find files for the given pattern(s).

NBAPJ commented 4 years ago

When I check my Python Version it returns the version

$ python --version Python 3.9.0

nitz commented 4 years ago

Ah, interesting that your python only has python.exe and not python3.exe. You could make a symlink named python3.exe that points at python.exe, or edit the makefile in the bootloader folder to change calls to python3 to python.

On Fri, Nov 6, 2020 at 7:40 PM NBAPJ notifications@github.com wrote:

When I check my Python Version it returns the version

$ python --version Python 3.9.0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmdwtf/Odiin/issues/97#issuecomment-723360749, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAETEQ45UYTBQYPKEC7AHZ3SOSJQHANCNFSM4TNIETEA .

NBAPJ commented 4 years ago

I added it to my path

where python C:\Program Files\Python39\python.exe

NBAPJ commented 4 years ago

oh nevermind its not working for python3

NBAPJ commented 4 years ago

Different Error

make[1]: *** [Makefile:401: _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539_s140_6.1.1.zip] Error 2

nitz commented 4 years ago

What are the lines around the error?

NBAPJ commented 4 years ago

yea i really messed up after i edited makefile to look for python instead of python3 i get this error

$ make bootloader Building UF2 bootloader... C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -C bootloader BOARD=odiin all make[1]: Entering directory 'C:/Users/melenese/Desktop/OdiinNFC2/Odiin/bootloader' LD odiin_bootloader-0.3.2-158-g23e6539-dirty.out /usr/bin/sh: arm-none-eabi-gcc: command not found make[1]: [Makefile:374: _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty.out] Error 127 make[1]: Leaving directory 'C:/Users/melenese/Desktop/OdiinNFC2/Odiin/bootloader' make: [Makefile:483: bootloader] Error 2

I changed it back but i still get the same error

NBAPJ commented 4 years ago

Here is the MakeFile:

SDK_PATH = lib/sdk/components SDK11_PATH = lib/sdk11/components TUSB_PATH = lib/tinyusb/src NRFX_PATH = lib/nrfx SD_PATH = lib/softdevice/$(SD_FILENAME)

SD_VERSION = 6.1.1 SD_FILENAME = $(SD_NAME)nrf52$(SD_VERSION) SD_HEX = $(SD_PATH)/$(SD_FILENAME)_softdevice.hex

MBR_HEX = lib/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex

linker by MCU eg. nrf52840.ld

LD_FILE = linker/$(MCU_SUB_VARIANT).ld

GIT_VERSION != git describe --dirty --always --tags GIT_SUBMODULE_VERSIONS != git submodule status | cut -d" " -f3,4 | paste -s -d" " -

compiled file name

OUT_FILE = $(BOARD)_bootloader-$(GIT_VERSION)

merged file = compiled + sd

MERGED_FILE = $(OUTFILE)$(SDNAME)$(SD_VERSION)

------------------------------------------------------------------------------

Tool configure

------------------------------------------------------------------------------

Toolchain commands

Should be added to your PATH

CROSS_COMPILE ?= arm-none-eabi- CC = $(CROSS_COMPILE)gcc AS = $(CROSS_COMPILE)as OBJCOPY = $(CROSS_COMPILE)objcopy SIZE = $(CROSS_COMPILE)size GDB = $(CROSS_COMPILE)gdb

Flasher utility options

NRFUTIL = adafruit-nrfutil NRFJPROG = nrfjprog FLASHER ?= nrfjprog PYOCD ?= pyocd

Flasher will default to nrfjprog,

Check for pyocd, error on unexpected value.

ifeq ($(FLASHER),nrfjprog) FLASH_CMD = $(NRFJPROG) --program $1 --sectoranduicrerase -f nrf52 --reset FLASH_NOUICR_CMD = $(NRFJPROG) --program $1 -f nrf52 --sectorerase --reset FLASH_ERASE_CMD = $(NRFJPROG) -f nrf52 --eraseall else ifeq ($(FLASHER),pyocd) FLASH_CMD = $(PYOCD) flash -t $(MCU_SUB_VARIANT) $1 FLASH_NOUICR_CMD = $(PYOCD) flash -t $(MCU_SUB_VARIANT) $1 FLASH_ERASE_CMD = $(PYOCD) erase -t $(MCU_SUB_VARIANT) --chip else $(error Unsupported flash utility: "$(FLASHER)") endif

Set make directory command, Windows tries to create a directory named "-p" if that flag is there.

ifneq ($(OS), Windows_NT) MK = mkdir -p else MK = mkdir endif

RM = rm -rf

auto-detect BMP on macOS, otherwise have to specify

BMP_PORT ?= $(shell ls -1 /dev/cu.usbmodem????????1 | head -1) GDB_BMP = $(GDB) -ex 'target extended-remote $(BMP_PORT)' -ex 'monitor swdp_scan' -ex 'attach 1'

---------------------------------

Select the board to build

---------------------------------

Note: whitespace is not allowed in the filenames... it WILL break this part of the script

BOARD_LIST = $(sort $(filter-out boards.h boards.c,$(notdir $(wildcard src/boards/*))))

ifeq ($(filter $(BOARD),$(BOARD_LIST)),) $(info You must provide a BOARD parameter with 'BOARD='. Supported boards are:) $(foreach b,$(BOARD_LIST),$(info - $(b))) $(error Invalid BOARD specified) endif

Build directory

BUILD = _build/build-$(BOARD)

Board specific

-include src/boards/$(BOARD)/board.mk

MCU_SUB_VARIANT can be nrf52 (nrf52832), nrf52833, nrf52840

ifeq ($(MCU_SUB_VARIANT),nrf52) SD_NAME = s132 DFU_DEV_REV = 0xADAF CFLAGS += -DNRF52 -DNRF52832_XXAA -DS132 else ifeq ($(MCU_SUB_VARIANT),nrf52833) SD_NAME = s140 DFU_DEV_REV = 52840 CFLAGS += -DNRF52833_XXAA -DS140 else ifeq ($(MCU_SUB_VARIANT),nrf52840) SD_NAME = s140 DFU_DEV_REV = 52840 CFLAGS += -DNRF52840_XXAA -DS140 else $(error Sub Variant $(MCU_SUB_VARIANT) is unknown) endif

------------------------------------------------------------------------------

SOURCE FILES

------------------------------------------------------------------------------

all files in src

C_SRC += $(wildcard src/*.c)

all files in boards

C_SRC += $(wildcard src/boards/*.c)

all sources files in specific board

C_SRC += $(wildcard src/boards/$(BOARD)/*.c)

nrfx

C_SRC += $(NRFX_PATH)/drivers/src/nrfx_power.c C_SRC += $(NRFX_PATH)/drivers/src/nrfx_nvmc.c C_SRC += $(NRFXPATH)/mdk/system$(MCU_SUB_VARIANT).c

SDK 11 files: serial + OTA DFU

C_SRC += $(SDK11_PATH)/libraries/bootloader_dfu/bootloader.c C_SRC += $(SDK11_PATH)/libraries/bootloader_dfu/bootloader_settings.c C_SRC += $(SDK11_PATH)/libraries/bootloader_dfu/bootloader_util.c C_SRC += $(SDK11_PATH)/libraries/bootloader_dfu/dfu_transport_serial.c C_SRC += $(SDK11_PATH)/libraries/bootloader_dfu/dfu_transport_ble.c C_SRC += $(SDK11_PATH)/libraries/bootloader_dfu/dfu_single_bank.c C_SRC += $(SDK11_PATH)/ble/ble_services/ble_dfu/ble_dfu.c C_SRC += $(SDK11_PATH)/ble/ble_services/ble_dis/ble_dis.c C_SRC += $(SDK11_PATH)/drivers_nrf/pstorage/pstorage_raw.c

Latest SDK files: peripheral drivers

C_SRC += $(SDK_PATH)/libraries/timer/app_timer.c C_SRC += $(SDK_PATH)/libraries/scheduler/app_scheduler.c C_SRC += $(SDK_PATH)/libraries/util/app_error.c C_SRC += $(SDK_PATH)/libraries/util/app_util_platform.c C_SRC += $(SDK_PATH)/libraries/crc16/crc16.c C_SRC += $(SDK_PATH)/libraries/hci/hci_mem_pool.c C_SRC += $(SDK_PATH)/libraries/hci/hci_slip.c C_SRC += $(SDK_PATH)/libraries/hci/hci_transport.c C_SRC += $(SDK_PATH)/libraries/util/nrf_assert.c

UART or USB Serial

ifeq ($(MCU_SUB_VARIANT),nrf52)

C_SRC += $(SDK_PATH)/libraries/uart/app_uart.c C_SRC += $(SDK_PATH)/drivers_nrf/uart/nrf_drv_uart.c C_SRC += $(SDK_PATH)/drivers_nrf/common/nrf_drv_common.c

IPATH += $(SDK11_PATH)/libraries/util IPATH += $(SDK_PATH)/drivers_nrf/common IPATH += $(SDK_PATH)/drivers_nrf/uart

else

USB Application ( MSC + UF2 )

C_SRC += $(wildcard src/usb/.c) C_SRC += $(wildcard src/usb/uf2/.c)

TinyUSB stack

C_SRC += $(TUSB_PATH)/portable/nordic/nrf5x/dcd_nrf5x.c C_SRC += $(TUSB_PATH)/common/tusb_fifo.c C_SRC += $(TUSB_PATH)/device/usbd.c C_SRC += $(TUSB_PATH)/device/usbd_control.c C_SRC += $(TUSB_PATH)/class/cdc/cdc_device.c C_SRC += $(TUSB_PATH)/class/msc/msc_device.c C_SRC += $(TUSB_PATH)/tusb.c

endif

------------------------------------------------------------------------------

Assembly Files

------------------------------------------------------------------------------

ASM_SRC = $(NRFX_PATH)/mdk/gccstartup$(MCU_SUB_VARIANT).S

------------------------------------------------------------------------------

INCLUDE PATH

------------------------------------------------------------------------------

src

IPATH += src IPATH += src/boards IPATH += src/boards/$(BOARD) IPATH += src/cmsis/include IPATH += src/usb IPATH += $(TUSB_PATH)

nrfx

IPATH += $(NRFX_PATH) IPATH += $(NRFX_PATH)/mdk IPATH += $(NRFX_PATH)/hal IPATH += $(NRFX_PATH)/drivers/include IPATH += $(NRFX_PATH)/drivers/src

IPATH += $(SDK11_PATH)/libraries/bootloader_dfu/hci_transport IPATH += $(SDK11_PATH)/libraries/bootloader_dfu IPATH += $(SDK11_PATH)/drivers_nrf/pstorage IPATH += $(SDK11_PATH)/ble/common IPATH += $(SDK11_PATH)/ble/ble_services/ble_dfu IPATH += $(SDK11_PATH)/ble/ble_services/ble_dis

IPATH += $(SDK_PATH)/libraries/timer IPATH += $(SDK_PATH)/libraries/scheduler IPATH += $(SDK_PATH)/libraries/crc16 IPATH += $(SDK_PATH)/libraries/util IPATH += $(SDK_PATH)/libraries/hci/config IPATH += $(SDK_PATH)/libraries/uart IPATH += $(SDK_PATH)/libraries/hci IPATH += $(SDK_PATH)/drivers_nrf/delay

Softdevice

IPATH += $(SD_PATH)/$(SD_FILENAME)_API/include IPATH += $(SD_PATH)/$(SD_FILENAME)_API/include/nrf52

------------------------------------------------------------------------------

Compiler Flags

------------------------------------------------------------------------------

Debug option use RTT for printf

ifeq ($(DEBUG), 1) RTT_SRC = lib/SEGGER_RTT

CFLAGS += -ggdb -DCFG_DEBUG -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
IPATH += $(RTT_SRC)/RTT

C_SRC += $(RTT_SRC)/RTT/SEGGER_RTT.c endif

flags common to all targets

CFLAGS += \ -mthumb \ -mabi=aapcs \ -mcpu=cortex-m4 \ -mfloat-abi=hard \ -mfpu=fpv4-sp-d16 \ -Os \ -ffunction-sections \ -fdata-sections \ -fno-builtin \ -fshort-enums \ -fstack-usage \ -fno-strict-aliasing \ -Wall \ -Wextra \ -Werror \ -Wfatal-errors \ -Werror-implicit-function-declaration \ -Wfloat-equal \ -Wundef \ -Wshadow \ -Wwrite-strings \ -Wsign-compare \ -Wmissing-format-attribute \ -Wno-endif-labels \ -Wunreachable-code

Suppress warning caused by SDK

CFLAGS += -Wno-unused-parameter -Wno-expansion-to-defined

TinyUSB tusb_hal_nrf_power_event

CFLAGS += -Wno-cast-function-type

Defined Symbol (MACROS)

CFLAGS += -D__HEAP_SIZE=0 CFLAGS += -DCONFIG_GPIO_AS_PINRESET

Skip defining CONFIG_NFCT_PINS_AS_GPIOS if the device uses the NFCT.

ifneq ($(USE_NFCT),yes) CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS endif

CFLAGS += -DSOFTDEVICE_PRESENT CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096

CFLAGS += -DUF2_VERSION='"$(GIT_VERSION) $(GIT_SUBMODULE_VERSIONS)"' CFLAGS += -DBLEDIS_FW_VERSION='"$(GIT_VERSION) $(SD_NAME) $(SD_VERSION)"'

_VER = $(subst ., ,$(word 1, $(subst -, ,$(GIT_VERSION)))) CFLAGS += -DMK_BOOTLOADER_VERSION='($(word 1,$(_VER)) << 16) + ($(word 2,$(_VER)) << 8) + $(word 3,$(_VER))'

------------------------------------------------------------------------------

Linker Flags

------------------------------------------------------------------------------

LDFLAGS += \ $(CFLAGS) \ -Wl,-L,linker -Wl,-T,$(LD_FILE) \ -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections \ -specs=nosys.specs -specs=nano.specs

LIBS += -lm -lc

------------------------------------------------------------------------------

Assembler flags

------------------------------------------------------------------------------

ASFLAGS += $(CFLAGS)

function for removing duplicates in a list

remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-out $(firstword $1),$1))))

C_SOURCE_FILE_NAMES = $(notdir $(C_SRC)) C_PATHS = $(call remduplicates, $(dir $(C_SRC) ) ) C_OBJECTS = $(addprefix $(BUILD)/, $(C_SOURCE_FILE_NAMES:.c=.o) )

ASM_SOURCE_FILE_NAMES = $(notdir $(ASM_SRC)) ASM_PATHS = $(call remduplicates, $(dir $(ASM_SRC) )) ASM_OBJECTS = $(addprefix $(BUILD)/, $(ASM_SOURCE_FILE_NAMES:.S=.o) )

vpath %.c $(C_PATHS) vpath %.S $(ASM_PATHS)

OBJECTS = $(C_OBJECTS) $(ASM_OBJECTS)

INC_PATHS = $(addprefix -I,$(IPATH))

------------------------------------------------------------------------------

BUILD TARGETS

------------------------------------------------------------------------------

Verbose mode (V=). 0: default, 1: print out CFLAG, LDFLAG 2: print all compile command

ifeq ("$(V)","1") $(info CFLAGS $(CFLAGS)) $(info ) $(info LDFLAGS $(LDFLAGS)) $(info ) $(info ASFLAGS $(ASFLAGS)) $(info ) endif

.PHONY: all clean flash dfu-flash sd gdbflash gdb

default target to build

all: $(BUILD)/$(OUT_FILE).out $(BUILD)/$(OUT_FILE)-nosd.hex $(BUILD)/$(OUT_FILE)-nosd.uf2 $(BUILD)/$(MERGED_FILE).hex $(BUILD)/$(MERGED_FILE).zip

Print out the value of a make variable.

https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile

print-%: @echo $ = $($)

------------------- Compile rules -------------------

Create build directories

$(BUILD): @$(MK) "$@"

clean: @$(RM) $(BUILD)

Create objects from C SRC files

$(BUILD)/%.o: %.c @echo CC $(notdir $<) @$(CC) $(CFLAGS) $(INC_PATHS) -c -o $@ $<

Assemble files

$(BUILD)/%.o: %.S @echo AS $(notdir $<) @$(CC) -x assembler-with-cpp $(ASFLAGS) $(INC_PATHS) -c -o $@ $<

Link

$(BUILD)/$(OUT_FILE).out: $(BUILD) $(OBJECTS) @echo LD $(notdir $@) @$(CC) -o $@ $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group @$(SIZE) $@

------------------- Binary generator -------------------

Create hex file (no sd, no mbr)

$(BUILD)/$(OUT_FILE).hex: $(BUILD)/$(OUT_FILE).out @echo Create $(notdir $@) @$(OBJCOPY) -O ihex $< $@

Hex file with mbr (still no SD)

$(BUILD)/$(OUT_FILE)-nosd.hex: $(BUILD)/$(OUT_FILE).hex @echo Create $(notdir $@) @python tools/hexmerge.py --overlap=replace -o $@ $< $(MBR_HEX)

Bootolader only uf2

$(BUILD)/$(OUT_FILE)-nosd.uf2: $(BUILD)/$(OUT_FILE)-nosd.hex @echo Create $(notdir $@) @python lib/uf2/utils/uf2conv.py -f 0xd663823c -c -o $@ $^

merge bootloader and sd hex together

$(BUILD)/$(MERGED_FILE).hex: $(BUILD)/$(OUT_FILE).hex @echo Create $(notdir $@) @python tools/hexmerge.py -o $@ $< $(SD_HEX)

Create pkg zip file for bootloader+SD combo to use with DFU CDC

$(BUILD)/$(MERGED_FILE).zip: $(BUILD)/$(OUT_FILE).hex @$(NRFUTIL) dfu genpkg --dev-type 0x0052 --dev-revision $(DFU_DEV_REV) --bootloader $< --softdevice $(SD_HEX) $@

------------------- Flash target -------------------

check_defined = \ $(strip $(foreach 1,$1, \ $(call __check_defined,$1,$(strip $(value 2))))) __check_defined = \ $(if $(value $1),, \ $(error Undefined make flag: $1$(if $2, ($2))))

Flash the compiled

flash: $(BUILD)/$(OUT_FILE)-nosd.hex @echo Flashing: $(notdir $<) $(call FLASH_CMD,$<)

erase: @echo Erasing flash $(call FLASH_ERASE_CMD)

flash SD only

sd: @echo Flashing: $(SD_HEX) $(call FLASH_NOUICR_CMD,$(SD_HEX))

flash MBR only

mbr: @echo Flashing: $(MBR_HEX) $(call FLASH_NOUICR_CMD,$(MBR_HEX))

------------------- Flash with NRFUTIL via DFU -------------------

dfu using CDC interface

dfu-flash: $(BUILD)/$(MERGED_FILE).zip @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0) $(NRFUTIL) --verbose dfu serial --package $< -p $(SERIAL) -b 115200 --singlebank --touch 1200

------------------- Debugging -------------------

gdbflash: $(BUILD)/$(MERGED_FILE).hex @echo Flashing: $< @$(GDB_BMP) -nx --batch -ex 'load $<' -ex 'compare-sections' -ex 'kill'

gdb: $(BUILD)/$(OUT_FILE).out $(GDB_BMP) $<

NBAPJ commented 4 years ago

Here is the Error

$ make bootloader Building UF2 bootloader... C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -C bootloader BOARD=odiin all make[1]: Entering directory 'C:/Users/melenese/Desktop/OdiinNFC2/Odiin/bootloader' Create odiin_bootloader-0.3.2-158-g23e6539-dirty-nosd.hex Create odiin_bootloader-0.3.2-158-g23e6539-dirty-nosd.uf2 Converting to uf2, output size: 72704, start address: 0x0 Wrote 72704 bytes to _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty-nosd.uf2 Create odiin_bootloader-0.3.2-158-g23e6539-dirty_s140_6.1.1.hex process_begin: CreateProcess(NULL, adafruit-nrfutil dfu genpkg --dev-type 0x0052 --dev-revision 52840 --bootloader _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty.hex --softdevice lib/softdevice/s140_nrf52_6.1.1/s140_nrf52_6.1.1_softdevice.hex _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty_s140_6.1.1.zip, ...) failed. make (e=2): The system cannot find the file specified. make[1]: [Makefile:401: _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty_s140_6.1.1.zip] Error 2 make[1]: Leaving directory 'C:/Users/melenese/Desktop/OdiinNFC2/Odiin/bootloader' make: [Makefile:483: bootloader] Error 2

nitz commented 4 years ago

It's not finding adafruit-nrfutil, you need to pip install adafruit-nrfutil

NBAPJ commented 4 years ago

Yea I already have it installed:

pip install adafruit-nrfutil Requirement already satisfied: adafruit-nrfutil in c:\users\melenese\appdata\roaming\python\python39\site-packages (0.5.3.post12) Requirement already satisfied: pyserial>=2.7 in c:\users\melenese\appdata\roaming\python\python39\site-packages (from adafruit-nrfutil) (3.4) Requirement already satisfied: click>=5.1 in c:\users\melenese\appdata\roaming\python\python39\site-packages (from adafruit-nrfutil) (7.1.2) Requirement already satisfied: ecdsa>=0.13 in c:\users\melenese\appdata\roaming\python\python39\site-packages (from adafruit-nrfutil) (0.16.0) Requirement already satisfied: six>=1.9.0 in c:\users\melenese\appdata\roaming\python\python39\site-packages (from ecdsa>=0.13->adafruit-nrfutil) (1.15.0)

Do you think that it installed in the wrong directory?

nitz commented 4 years ago

Is c:\users\melenese\appdata\roaming\python\python39\site-packages in your path? (Try where adafruit-nrfutil or Get-Command adafruit-nrfutil) I definitely had to add my site-packages to my path manually, based on how I had installed python.

NBAPJ commented 4 years ago

I finally got adafruit-nrfutil installed

$ where adafruit-nrfutil C:\Program Files\Python39\Scripts\adafruit-nrfutil.exe

I don't know why but when I piped installed adafruit-nrfutil it wasnt installing everything so I had to install it git clone command

I have put it in my PATH but its still giving me the same error I don't understand what file it cannot find

make bootloader Building UF2 bootloader... C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -C bootloader BOARD=odiin all make[1]: Entering directory 'C:/Users/melenese/Desktop/OdiinNFC2/Odiin/bootloader' LD odiin_bootloader-0.3.2-158-g23e6539-dirty.out text data bss dec hex filename 31304 1572 22594 55470 d8ae _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty.out Create odiin_bootloader-0.3.2-158-g23e6539-dirty.hex Create odiin_bootloader-0.3.2-158-g23e6539-dirty-nosd.hex process_begin: CreateProcess(NULL, python3 tools/hexmerge.py --overlap=replace -o _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty-nosd.hex _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty.hex lib/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex, ...) failed. make (e=2): The system cannot find the file specified. make[1]: [Makefile:387: _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty-nosd.hex] Error 2 make[1]: Leaving directory 'C:/Users/melenese/Desktop/OdiinNFC2/Odiin/bootloader' make: [Makefile:483: bootloader] Error 2

nitz commented 4 years ago

Ah yeah, the Scripts folder is definitely what I meant to have on your path, not site-packages. Anyways, it seems to me like you're back to the earlier issue, where you didn't have a python3.exe on your path. Did you undo however you fixed that previously?

NBAPJ commented 4 years ago

Yea i think I did, but the scripts folder is in my path, I gonna play around with it to see if I can fix it. But can you tell me what file it’s looking for?

nitz commented 4 years ago

It's looking for python3, (which again, is probably just python, like I was saying here)

You can see where it failed with:

process_begin: CreateProcess(NULL, python3 tools/hexmerge.py --overlap=replace -o _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty-nosd.hex _build/build-odiin/odiin_bootloader-0.3.2-158-g23e6539-dirty.hex lib/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex, ...) failed.
make (e=2): The system cannot find the file specified.

The second argument to create process is the command it's trying to run.

nitz commented 4 years ago

Discussion continued in #98