fix picotool installation
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
export INSTALL_PATH := $(PWD)
|
||||
|
||||
SDK_VERSION := 2.1.0
|
||||
PICOTOOL := $(INSTALL_PATH)/picotool/$(SDK_VERSION)/build/picotool
|
||||
|
||||
export PICOTOOL_PATH=$(INSTALL_PATH)/picotool/$(SDK_VERSION)/build
|
||||
export PICO_SDK_PATH=$(INSTALL_PATH)/sdk/$(SDK_VERSION)
|
||||
# if using a different platform or arch, set it here
|
||||
export PICO_PLATFORM=rp2350
|
||||
|
||||
picotool = ${PICOTOOL_PATH}/picotool
|
||||
# project name, need to be passed as make input (ex: make project name=test)
|
||||
name := ""
|
||||
|
||||
@@ -37,16 +38,16 @@ endif
|
||||
@./scripts/scaffold_project.bash $(name) $(SDK_VERSION)
|
||||
|
||||
format: .check-name
|
||||
@test -f "$(shell find /usr/bin/ -name astyle)" && astyle --style=java --indent=spaces=4 -K -xC120 $(name)/*.c
|
||||
@(test -f "$(shell find /usr/bin/ -name astyle)" && astyle --style=java --indent=spaces=4 -K -xC120 $(name)/*.c) || echo "astyle bin formatter not found, skip it"
|
||||
|
||||
run-debug: format
|
||||
@rm -f ${name}/${name}.debug
|
||||
@gcc -std=c99 -o2 ${name}/*.c -lm -o ${name}/${name}.debug && ./${name}/${name}.debug
|
||||
|
||||
compile: format
|
||||
rm -f ${name}/build/CMakeCache.txt
|
||||
@rm -f ${name}/build/CMakeCache.txt
|
||||
@(test -d ${name} && mkdir -p ${name}/build && cd ${name}/build && cmake .. && make -j$(nproc) && echo "project compile successfully") || echo "error: unable to compile project: $(name)"
|
||||
|
||||
push: compile
|
||||
@(test -f $(name)/build/$(name).elf && $(PICOTOOL) load -fx -v $(name)/build/$(name).elf) || echo "error: unable to push project $(name) to device"
|
||||
@(test -f $(name)/build/$(name).elf && $(picotool) load -fx -v $(name)/build/$(name).elf) || echo "error: unable to push project $(name) to device"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user