diff --git a/.ci/ci b/.ci/ci index abfd7d2e2..47678769f 100755 --- a/.ci/ci +++ b/.ci/ci @@ -60,10 +60,6 @@ make -j8 firmware make -j8 firmware-btc make -j8 factory-setup -# Semihosting -make -j8 bootloader-semihosting -make -j8 firmware-semihosting - # Disallow some symbols in the final binary that we don't want. if arm-none-eabi-nm build/bin/firmware.elf | grep -q "float_to_decimal_common_shortest"; then echo "Rust fmt float formatting like {.1} adds significant binary bloat." diff --git a/Makefile b/Makefile index f7ada1f80..071a902fb 100644 --- a/Makefile +++ b/Makefile @@ -38,11 +38,6 @@ build-build-rust-unit-tests/Makefile: cd build-build-rust-unit-tests && cmake .. -DCOVERAGE=OFF -DSANITIZE_ADDRESS=OFF -DSANITIZE_UNDEFINED=OFF $(MAKE) -C py/bitbox02 -build-semihosting/Makefile: - mkdir -p build-semihosting - cd build-semihosting && cmake .. -DCMAKE_TOOLCHAIN_FILE=arm.cmake -DSEMIHOSTING=ON - ${MAKE} -C py/bitbox02 - # Directory for building for "host" machine according to gcc convention build: build/Makefile @@ -54,20 +49,13 @@ build-build: build-build/Makefile # address santizers when they link code compiled with gcc. build-build-rust-unit-tests: build-build-rust-unit-tests/Makefile -# Directory for building for "host" machine but with semihosting enbled -build-semihosting: build-semihosting/Makefile - firmware: | build # Generate python bindings for protobuf for test scripts $(MAKE) -C build firmware.elf -firmware-semihosting: | build-semihosting - $(MAKE) -C build-semihosting firmware.elf firmware-btc: | build $(MAKE) -C build firmware-btc.elf bootloader: | build $(MAKE) -C build bootloader.elf -bootloader-semihosting: | build-semihosting - $(MAKE) -C build-semihosting bootloader-development.elf bootloader-development: | build $(MAKE) -C build bootloader-development.elf bootloader-development-locked: | build @@ -110,8 +98,6 @@ flash-dev-firmware: ./py/load_firmware.py build/bin/firmware.bin --debug jlink-flash-bootloader-development: | build JLinkExe -if SWD -device ATSAMD51J20 -speed 4000 -autoconnect 1 -CommanderScript ./build/scripts/bootloader-development.jlink -jlink-flash-bootloader-semihosting: | build-semihosting - JLinkExe -if SWD -device ATSAMD51J20 -speed 4000 -autoconnect 1 -CommanderScript ./build-semihosting/scripts/bootloader-development.jlink jlink-flash-bootloader-development-locked: | build JLinkExe -if SWD -device ATSAMD51J20 -speed 4000 -autoconnect 1 -CommanderScript ./build/scripts/bootloader-development-locked.jlink jlink-flash-bootloader: | build @@ -126,8 +112,6 @@ jlink-flash-firmware-btc: | build JLinkExe -if SWD -device ATSAMD51J20 -speed 4000 -autoconnect 1 -CommanderScript ./build/scripts/firmware-btc.jlink jlink-flash-factory-setup: | build JLinkExe -if SWD -device ATSAMD51J20 -speed 4000 -autoconnect 1 -CommanderScript ./build/scripts/factory-setup.jlink -jlink-flash-firmware-semihosting: | build-semihosting - JLinkExe -if SWD -device ATSAMD51J20 -speed 4000 -autoconnect 1 -CommanderScript ./build-semihosting/scripts/firmware.jlink dockerinit: ./scripts/container.sh build --pull --force-rm --no-cache -t shiftcrypto/firmware_v2:$(shell cat .containerversion) . dockerpull: @@ -144,4 +128,4 @@ prepare-tidy: | build build-build make -C build rust-cbindgen make -C build-build rust-cbindgen clean: - rm -rf build build-build build-semihosting build-build-rust-unit-tests + rm -rf build build-build build-build-rust-unit-tests diff --git a/scripts/jlink-gdb-debug/.gdbinit b/scripts/jlink-gdb-debug/.gdbinit deleted file mode 100644 index 5460f9bba..000000000 --- a/scripts/jlink-gdb-debug/.gdbinit +++ /dev/null @@ -1,8 +0,0 @@ -# Start a JLink gdb server with the following command: -# $ JLinkGDBServer -if SWD -device ATSAMD51J20 -speed 4000 -ir -# See I/O using telnet: -# $ telnet localhost 2333 -file ../../build-semihosting/bin/firmware.elf -target remote :2331 -monitor semihosting enable -monitor reset diff --git a/scripts/jlink-gdb-debug/README.md b/scripts/jlink-gdb-debug/README.md deleted file mode 100644 index 3e012560d..000000000 --- a/scripts/jlink-gdb-debug/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# Debugging with JLinkGDBServer - -If the firmware is compiled with semihosting support, the input and output is redirected to the -developers computer. See instructions below. - -## Compile and flash firmware with semihosting support - -In the root directory of the project run: - -``` -make firmware-semihosting -make jlink-flash-firmware-semihosting -``` - - -## Configure GDB - -If you want to use the `.gdbinit` helper script you need to allow it by creating `~/.gdbinit` with -the following content: - -``` -set auto-load safe-path / -``` - -## Run JLinkGDBServer - -Start the JLink GDB server with the following command: - -``` -JLinkGDBServer -if SWD -device ATSAMD51J20 -speed 4000 -ir -``` - -## Run GDB (with arm support) - -The GDB init file, `.gdbinit`, contains the following commands: - -``` -file ../../build/bin/firmware-semihosting.elf -target remote :2331 -monitor semihosting enable -monitor reset -``` - -First it will load the symbols from `firmware-semihosting.elf` then it will connect to the JLink GDB Server. -After that it will enable "semihosting" to redirect IO to the JLink GDB Server. Finally it will reset the -device. - -Change your current working directory to the directory with the `.gdbinit` file and run `gdb`. - -``` -cd /scripts/jlink-gdb-debug -gdb-multiarch -``` - -## See input and output - -In a new terminal, run `telnet localhost 2333` to connect to the IO of the device through the GDB -Server. - -``` -$ telnet localhost 2333 -Trying 127.0.0.1... -Connected to localhost. -Escape character is '^]'. -SEGGER J-Link GDB Server V6.44h - Terminal output channel -``` - - -## Start debugging - -To start debugging run the command `continue` in GDB.