diff --git a/bin/build-nrf52.sh b/bin/build-nrf52.sh index 077e2af35a..cf4ca60cb2 100755 --- a/bin/build-nrf52.sh +++ b/bin/build-nrf52.sh @@ -25,13 +25,9 @@ pio run --environment $1 # -v SRCELF=.pio/build/$1/firmware.elf cp $SRCELF $OUTDIR/$basename.elf -if (echo $1 | grep -q "wio-sdk-wm1110"); then - echo "Skipping dfu file" -else - echo "Generating NRF52 dfu file" - DFUPKG=.pio/build/$1/firmware.zip - cp $DFUPKG $OUTDIR/$basename-ota.zip -fi +echo "Generating NRF52 dfu file" +DFUPKG=.pio/build/$1/firmware.zip +cp $DFUPKG $OUTDIR/$basename-ota.zip echo "Generating NRF52 uf2 file" SRCHEX=.pio/build/$1/firmware.hex diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index c5b217f0e3..7334f3a041 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -286,5 +286,10 @@ void clearBonds() void enterDfuMode() { +// SDK kit does not have native USB like almost all other NRF52 boards +#ifdef NRF_USE_SERIAL_DFU + enterSerialDfu(); +#else enterUf2Dfu(); +#endif } \ No newline at end of file diff --git a/variants/wio-sdk-wm1110/platformio.ini b/variants/wio-sdk-wm1110/platformio.ini index dc7d47310c..7667174289 100644 --- a/variants/wio-sdk-wm1110/platformio.ini +++ b/variants/wio-sdk-wm1110/platformio.ini @@ -20,7 +20,7 @@ debug_tool = jlink ; No need to reflash if the binary hasn't changed debug_load_mode = modified ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) -upload_protocol = jlink +upload_protocol = nrfutil ;upload_protocol = stlink ; we prefer to stop in setup() because we are an 'ardiuno' app debug_init_break = tbreak setup diff --git a/variants/wio-sdk-wm1110/variant.h b/variants/wio-sdk-wm1110/variant.h index 8ad8c769af..8f66b1f8c8 100644 --- a/variants/wio-sdk-wm1110/variant.h +++ b/variants/wio-sdk-wm1110/variant.h @@ -107,6 +107,8 @@ extern "C" { #define LR1110_GNSS_ANT_PIN (32 + 5) // P1.05 37 +#define NRF_USE_SERIAL_DFU + #ifdef __cplusplus } #endif