From 0d9787189370e252565a683b618e00312f11cf4c Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Mon, 14 Mar 2022 21:46:15 -0700 Subject: [PATCH 1/6] The pull request github action now also builds hosted. This will help catch some more build errors. --- .github/workflows/build-pr.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index a64ec3f2..f264ccb2 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -25,5 +25,11 @@ jobs: - uses: numworks/setup-arm-toolchain@2020-q4 # Runs a single command using the runners shell - - name: Build + - name: Build native fw run: make + + - name: Clean + run: make clean + + - name: Build PC hosted binary + run: make PROBE_HOST=hosted From 501fd0922877de077adc071220df22a131be3a37 Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Mon, 14 Mar 2022 21:55:05 -0700 Subject: [PATCH 2/6] ghactions: Added libftdi1 dependency installation. --- .github/workflows/build-pr.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index f264ccb2..05eeaa3f 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -24,12 +24,15 @@ jobs: # Use embedded toolchain - uses: numworks/setup-arm-toolchain@2020-q4 - # Runs a single command using the runners shell + # Run some of the most common build types - name: Build native fw run: make - name: Clean run: make clean + - name: Install BMP PC hosted dependencies + run: sudo apt-get -y install libftdi1-dev + - name: Build PC hosted binary run: make PROBE_HOST=hosted From 4b924154425fc7bebec9c8ac04a19c652a9b62bf Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Mon, 14 Mar 2022 23:01:32 -0700 Subject: [PATCH 3/6] ghactions: Added libhidapi dependency installation. --- .github/workflows/build-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 05eeaa3f..baabea97 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -32,7 +32,7 @@ jobs: run: make clean - name: Install BMP PC hosted dependencies - run: sudo apt-get -y install libftdi1-dev + run: sudo apt-get -y install libftdi1-dev libhidapi-dev - name: Build PC hosted binary run: make PROBE_HOST=hosted From e0619ca7d5c71c6f3bc1a95b34a38b2131e6af67 Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Tue, 15 Mar 2022 11:41:31 -0700 Subject: [PATCH 4/6] Added a linker flag to output memory usage. --- src/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Makefile b/src/Makefile index de053656..15e9a7e4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -61,6 +61,9 @@ SRC = \ stm32g0.c \ target.c \ +# Output memory usage information +LDFLAGS += -Wl,--print-memory-usage + include $(PLATFORM_DIR)/Makefile.inc OPT_FLAGS ?= -Os From 488df7e6f73c8cf53483a4e856c4aad51fda6330 Mon Sep 17 00:00:00 2001 From: Fabrice Prost-Boucle Date: Wed, 19 Jan 2022 22:25:11 +0100 Subject: [PATCH 5/6] sscanf cleanup in GDB Z packet handling function. Tested working with arm-none-eabi-gcc 10.2.1 --- src/gdb_main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gdb_main.c b/src/gdb_main.c index bdff229a..bfbe8cd6 100644 --- a/src/gdb_main.c +++ b/src/gdb_main.c @@ -539,11 +539,7 @@ handle_z_packet(char *packet, int plen) uint32_t addr; int ret; - /* I have no idea why this doesn't work. Seems to work - * with real sscanf() though... */ - //sscanf(packet, "%*[zZ]%hhd,%08lX,%hhd", &type, &addr, &len); - type = packet[1] - '0'; - sscanf(packet + 2, ",%" PRIx32 ",%d", &addr, &len); + sscanf(packet, "%*[zZ]%d,%08" PRIX32 ",%d", &type, &addr, &len); if(set) ret = target_breakwatch_set(cur_target, type, addr, len); else From d259d5c5110d5867031a9d9ceaaf3725ce242857 Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Tue, 15 Mar 2022 13:33:51 -0700 Subject: [PATCH 6/6] build: Only build the locm3 libraries needed. We don't need to build all the locm3 libraries. We just need those that are required by the supported platforms. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b0d56566..471727bb 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ ifndef NO_LIBOPENCM3 git submodule init ;\ git submodule update ;\ fi - $(Q)$(MAKE) $(MFLAGS) -C libopencm3 lib + $(Q)$(MAKE) $(MFLAGS) -C libopencm3 lib/stm32/f1 lib/stm32/f4 lib/lm4f endif $(Q)$(MAKE) $(MFLAGS) -C src