From 374a9302d9c1a93270942974e02ffd3ae70d69a9 Mon Sep 17 00:00:00 2001 From: Shishir Patil Date: Wed, 15 Apr 2020 00:26:04 -0700 Subject: [PATCH 1/5] Adding support for WSL --- README.md | 8 ++++++++ make/README.md | 10 +++++----- .../config/nrf52811/armgcc/Makefile | 15 +++++++++++---- .../config/nrf52811/armgcc/Makefile | 15 +++++++++++---- .../config/nrf52811/armgcc/Makefile | 16 ++++++++++++---- 5 files changed, 47 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ea63502be..3c62a9a64 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,17 @@ you must do. brew tap ArmMbed/homebrew-formulae brew install arm-none-eabi-gcc + On Windows Subsystem for Linux (WSL): + + sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa + sudo apt-get update + sudo apt-get install gcc-arm-embedded + + 2. Install Nordic's [command line tools](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf5x_cltools%2FUG%2Fcltools%2Fnrf5x_installation.html) `mergehex` and `nrfjprog`. Ensure these tools are extracted and added to your path. + For WSL: install the `nrfjprog` for Windows, and not for Linux. 3. Install the JLink [software](https://www.segger.com/jlink-software.html) for your platform. You want the "Software and documentation pack". diff --git a/make/README.md b/make/README.md index b0e4853b4..2c1ab3672 100644 --- a/make/README.md +++ b/make/README.md @@ -5,9 +5,9 @@ This folder contains the GCC build system for the nRF5x platforms. It originally comes from [hlnd/nrf51-pure-gcc-setup](https://github.com/hlnd/nrf51-pure-gcc-setup). -We develop on Linux. Original files still exist for Windows, but have not been -tested in some time. Feel free to submit a pull request if you find something -that doesn't work. +We develop on Linux. This also works on Windows in either of the following ways: +1. Build on WSL (Windows Subsystem for Linux), and `flash` with WSL. +2. Build with SES (Segger Embedded Studio) and `flash` with WSL. Note: For this you will have to manually move the `.hex` file generated from SES to `build/` directory. For e.g. `mv blinky/pca10040/s132/ses/Output/Release/Exe/blinky_pca10040_s132.hex blinky/_build/blink_sdk16_blank.hex`. The currently supported SDK versions are: 9, 10, 11 @@ -17,8 +17,8 @@ Things to Install ----------------- 1. `gcc-arm-none-eabi`: https://launchpad.net/gcc-arm-embedded 2. gdb-arm-none-eabi -3. The [jlink tools](https://www.segger.com/jlink-software.html) for linux -4. The jlink debuger for linux +3. The [jlink tools](https://www.segger.com/jlink-software.html) for linux / windows for WSL +4. The jlink debuger for linux [OR] jlink debuger for Windows for WSL/SES Usage ----- diff --git a/sdk/nrf5_sdk_15.3.0/config/nrf52811/armgcc/Makefile b/sdk/nrf5_sdk_15.3.0/config/nrf52811/armgcc/Makefile index a1d698b10..6f75a4984 100644 --- a/sdk/nrf5_sdk_15.3.0/config/nrf52811/armgcc/Makefile +++ b/sdk/nrf5_sdk_15.3.0/config/nrf52811/armgcc/Makefile @@ -216,14 +216,21 @@ $(foreach target, $(TARGETS), $(call define_target, $(target))) .PHONY: flash erase +# Set environment (Linux / Windows - WSL) variables +ifeq ($(strip $(grep -q Microsoft /proc/version)),) + NRFPROG := nrfjprog.exe +else + NRFPROG := nrfjprog +endif + # Flash the program flash: default - @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex - nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase - nrfjprog -f nrf52 --reset + @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex + $(NRFPROG) -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase + $(NRFPROG) -f nrf52 --reset erase: - nrfjprog -f nrf52 --eraseall + $(NRFPROG) -f nrf52 --eraseall SDK_CONFIG_FILE := ../config/sdk_config.h CMSIS_CONFIG_TOOL := $(SDK_ROOT)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar diff --git a/sdk/nrf5_sdk_15.3.0_thread/config/nrf52811/armgcc/Makefile b/sdk/nrf5_sdk_15.3.0_thread/config/nrf52811/armgcc/Makefile index a1d698b10..d54ecfb1e 100644 --- a/sdk/nrf5_sdk_15.3.0_thread/config/nrf52811/armgcc/Makefile +++ b/sdk/nrf5_sdk_15.3.0_thread/config/nrf52811/armgcc/Makefile @@ -216,14 +216,21 @@ $(foreach target, $(TARGETS), $(call define_target, $(target))) .PHONY: flash erase +# Set environment (Linux / Windows - WSL) variables +ifeq ($(strip $(grep -q Microsoft /proc/version)),) + NRFPROG := nrfjprog.exe +else + NRFPROG := nrfjprog +endif + # Flash the program flash: default - @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex - nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase - nrfjprog -f nrf52 --reset + @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex + $(NRFPROG) -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase + $(NRFPROG) -f nrf52 --reset erase: - nrfjprog -f nrf52 --eraseall + $(NRFPROG) -f nrf52 --eraseall SDK_CONFIG_FILE := ../config/sdk_config.h CMSIS_CONFIG_TOOL := $(SDK_ROOT)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar diff --git a/sdk/nrf5_sdk_16.0.0/config/nrf52811/armgcc/Makefile b/sdk/nrf5_sdk_16.0.0/config/nrf52811/armgcc/Makefile index 340deca3f..4418e2938 100644 --- a/sdk/nrf5_sdk_16.0.0/config/nrf52811/armgcc/Makefile +++ b/sdk/nrf5_sdk_16.0.0/config/nrf52811/armgcc/Makefile @@ -219,14 +219,22 @@ $(foreach target, $(TARGETS), $(call define_target, $(target))) .PHONY: flash erase +# Set environment (Linux / Windows - WSL) variables +ifeq ($(strip $(grep -q Microsoft /proc/version)),) + NRFPROG := nrfjprog.exe +else + NRFPROG := nrfjprog +endif + # Flash the program flash: default - @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex - nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase - nrfjprog -f nrf52 --reset + @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex + $(NRFPROG) -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase + $(NRFPROG) -f nrf52 --reset erase: - nrfjprog -f nrf52 --eraseall + $(NRFPROG) -f nrf52 --eraseall + SDK_CONFIG_FILE := ../config/sdk_config.h CMSIS_CONFIG_TOOL := $(SDK_ROOT)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar From 0573dd3be5d98a63ad0b673a0bf142e8694b3c01 Mon Sep 17 00:00:00 2001 From: Shishir Patil Date: Wed, 15 Apr 2020 13:58:23 -0700 Subject: [PATCH 2/5] Revert "Adding support for WSL" This reverts commit 374a9302d9c1a93270942974e02ffd3ae70d69a9. --- README.md | 8 -------- make/README.md | 10 +++++----- .../config/nrf52811/armgcc/Makefile | 15 ++++----------- .../config/nrf52811/armgcc/Makefile | 15 ++++----------- .../config/nrf52811/armgcc/Makefile | 16 ++++------------ 5 files changed, 17 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 3c62a9a64..ea63502be 100644 --- a/README.md +++ b/README.md @@ -87,17 +87,9 @@ you must do. brew tap ArmMbed/homebrew-formulae brew install arm-none-eabi-gcc - On Windows Subsystem for Linux (WSL): - - sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa - sudo apt-get update - sudo apt-get install gcc-arm-embedded - - 2. Install Nordic's [command line tools](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf5x_cltools%2FUG%2Fcltools%2Fnrf5x_installation.html) `mergehex` and `nrfjprog`. Ensure these tools are extracted and added to your path. - For WSL: install the `nrfjprog` for Windows, and not for Linux. 3. Install the JLink [software](https://www.segger.com/jlink-software.html) for your platform. You want the "Software and documentation pack". diff --git a/make/README.md b/make/README.md index 2c1ab3672..b0e4853b4 100644 --- a/make/README.md +++ b/make/README.md @@ -5,9 +5,9 @@ This folder contains the GCC build system for the nRF5x platforms. It originally comes from [hlnd/nrf51-pure-gcc-setup](https://github.com/hlnd/nrf51-pure-gcc-setup). -We develop on Linux. This also works on Windows in either of the following ways: -1. Build on WSL (Windows Subsystem for Linux), and `flash` with WSL. -2. Build with SES (Segger Embedded Studio) and `flash` with WSL. Note: For this you will have to manually move the `.hex` file generated from SES to `build/` directory. For e.g. `mv blinky/pca10040/s132/ses/Output/Release/Exe/blinky_pca10040_s132.hex blinky/_build/blink_sdk16_blank.hex`. +We develop on Linux. Original files still exist for Windows, but have not been +tested in some time. Feel free to submit a pull request if you find something +that doesn't work. The currently supported SDK versions are: 9, 10, 11 @@ -17,8 +17,8 @@ Things to Install ----------------- 1. `gcc-arm-none-eabi`: https://launchpad.net/gcc-arm-embedded 2. gdb-arm-none-eabi -3. The [jlink tools](https://www.segger.com/jlink-software.html) for linux / windows for WSL -4. The jlink debuger for linux [OR] jlink debuger for Windows for WSL/SES +3. The [jlink tools](https://www.segger.com/jlink-software.html) for linux +4. The jlink debuger for linux Usage ----- diff --git a/sdk/nrf5_sdk_15.3.0/config/nrf52811/armgcc/Makefile b/sdk/nrf5_sdk_15.3.0/config/nrf52811/armgcc/Makefile index 6f75a4984..a1d698b10 100644 --- a/sdk/nrf5_sdk_15.3.0/config/nrf52811/armgcc/Makefile +++ b/sdk/nrf5_sdk_15.3.0/config/nrf52811/armgcc/Makefile @@ -216,21 +216,14 @@ $(foreach target, $(TARGETS), $(call define_target, $(target))) .PHONY: flash erase -# Set environment (Linux / Windows - WSL) variables -ifeq ($(strip $(grep -q Microsoft /proc/version)),) - NRFPROG := nrfjprog.exe -else - NRFPROG := nrfjprog -endif - # Flash the program flash: default - @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex - $(NRFPROG) -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase - $(NRFPROG) -f nrf52 --reset + @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex + nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase + nrfjprog -f nrf52 --reset erase: - $(NRFPROG) -f nrf52 --eraseall + nrfjprog -f nrf52 --eraseall SDK_CONFIG_FILE := ../config/sdk_config.h CMSIS_CONFIG_TOOL := $(SDK_ROOT)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar diff --git a/sdk/nrf5_sdk_15.3.0_thread/config/nrf52811/armgcc/Makefile b/sdk/nrf5_sdk_15.3.0_thread/config/nrf52811/armgcc/Makefile index d54ecfb1e..a1d698b10 100644 --- a/sdk/nrf5_sdk_15.3.0_thread/config/nrf52811/armgcc/Makefile +++ b/sdk/nrf5_sdk_15.3.0_thread/config/nrf52811/armgcc/Makefile @@ -216,21 +216,14 @@ $(foreach target, $(TARGETS), $(call define_target, $(target))) .PHONY: flash erase -# Set environment (Linux / Windows - WSL) variables -ifeq ($(strip $(grep -q Microsoft /proc/version)),) - NRFPROG := nrfjprog.exe -else - NRFPROG := nrfjprog -endif - # Flash the program flash: default - @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex - $(NRFPROG) -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase - $(NRFPROG) -f nrf52 --reset + @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex + nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase + nrfjprog -f nrf52 --reset erase: - $(NRFPROG) -f nrf52 --eraseall + nrfjprog -f nrf52 --eraseall SDK_CONFIG_FILE := ../config/sdk_config.h CMSIS_CONFIG_TOOL := $(SDK_ROOT)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar diff --git a/sdk/nrf5_sdk_16.0.0/config/nrf52811/armgcc/Makefile b/sdk/nrf5_sdk_16.0.0/config/nrf52811/armgcc/Makefile index 4418e2938..340deca3f 100644 --- a/sdk/nrf5_sdk_16.0.0/config/nrf52811/armgcc/Makefile +++ b/sdk/nrf5_sdk_16.0.0/config/nrf52811/armgcc/Makefile @@ -219,22 +219,14 @@ $(foreach target, $(TARGETS), $(call define_target, $(target))) .PHONY: flash erase -# Set environment (Linux / Windows - WSL) variables -ifeq ($(strip $(grep -q Microsoft /proc/version)),) - NRFPROG := nrfjprog.exe -else - NRFPROG := nrfjprog -endif - # Flash the program flash: default - @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex - $(NRFPROG) -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase - $(NRFPROG) -f nrf52 --reset + @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex + nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase + nrfjprog -f nrf52 --reset erase: - $(NRFPROG) -f nrf52 --eraseall - + nrfjprog -f nrf52 --eraseall SDK_CONFIG_FILE := ../config/sdk_config.h CMSIS_CONFIG_TOOL := $(SDK_ROOT)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar From 152a57cbf3618ec696a18e641a779bfffba51633 Mon Sep 17 00:00:00 2001 From: Shishir Patil Date: Wed, 15 Apr 2020 14:03:02 -0700 Subject: [PATCH 3/5] Modifying the righ makefile, and reverting SDK makefiles --- README.md | 8 ++++++++ make/Program.mk | 19 ++++++++++++++++--- make/README.md | 10 +++++----- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ea63502be..3c62a9a64 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,17 @@ you must do. brew tap ArmMbed/homebrew-formulae brew install arm-none-eabi-gcc + On Windows Subsystem for Linux (WSL): + + sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa + sudo apt-get update + sudo apt-get install gcc-arm-embedded + + 2. Install Nordic's [command line tools](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf5x_cltools%2FUG%2Fcltools%2Fnrf5x_installation.html) `mergehex` and `nrfjprog`. Ensure these tools are extracted and added to your path. + For WSL: install the `nrfjprog` for Windows, and not for Linux. 3. Install the JLink [software](https://www.segger.com/jlink-software.html) for your platform. You want the "Software and documentation pack". diff --git a/make/Program.mk b/make/Program.mk index d34786b23..76ac69a62 100644 --- a/make/Program.mk +++ b/make/Program.mk @@ -73,12 +73,25 @@ flash: all test_softdevice flash_mbr ifdef ID $(Q)printf "w4 $(ID_FLASH_LOCATION), 0x$(ID_SECON) 0x$(ID_FIRST)\n" >> $(BUILDDIR)flash.jlink endif -ifeq ($(USE_BOOTLOADER),1) +ifeq ($(strip $(grep -q Microsoft /proc/version)),) + @echo Flashing: $(HEX) + nrfjprog.exe -f nrf52 --program $(HEX) --sectorerase + nrfjprog.exe -f nrf52 --reset +else ifeq ($(USE_BOOTLOADER),1) $(Q)printf "loadfile $(MERGED_HEX) \nr\ng\nexit\n" >> $(BUILDDIR)flash.jlink -else + $(Q)$(JLINK) $(JLINK_FLAGS) $(BUILDDIR)flash.jlink +else ifeq ($(USE_BOOTLOADER),0) $(Q)printf "loadfile $(HEX) \nr\ng\nexit\n" >> $(BUILDDIR)flash.jlink -endif $(Q)$(JLINK) $(JLINK_FLAGS) $(BUILDDIR)flash.jlink +endif + + +flashWSL: all test_softdevice flash_mbr + @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex + $(nrfjprog.exe) -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase + $(NRFPROG) -f nrf52 --reset + + .PHONY: test_softdevice test_softdevice: $(BUILDDIR) diff --git a/make/README.md b/make/README.md index b0e4853b4..2c1ab3672 100644 --- a/make/README.md +++ b/make/README.md @@ -5,9 +5,9 @@ This folder contains the GCC build system for the nRF5x platforms. It originally comes from [hlnd/nrf51-pure-gcc-setup](https://github.com/hlnd/nrf51-pure-gcc-setup). -We develop on Linux. Original files still exist for Windows, but have not been -tested in some time. Feel free to submit a pull request if you find something -that doesn't work. +We develop on Linux. This also works on Windows in either of the following ways: +1. Build on WSL (Windows Subsystem for Linux), and `flash` with WSL. +2. Build with SES (Segger Embedded Studio) and `flash` with WSL. Note: For this you will have to manually move the `.hex` file generated from SES to `build/` directory. For e.g. `mv blinky/pca10040/s132/ses/Output/Release/Exe/blinky_pca10040_s132.hex blinky/_build/blink_sdk16_blank.hex`. The currently supported SDK versions are: 9, 10, 11 @@ -17,8 +17,8 @@ Things to Install ----------------- 1. `gcc-arm-none-eabi`: https://launchpad.net/gcc-arm-embedded 2. gdb-arm-none-eabi -3. The [jlink tools](https://www.segger.com/jlink-software.html) for linux -4. The jlink debuger for linux +3. The [jlink tools](https://www.segger.com/jlink-software.html) for linux / windows for WSL +4. The jlink debuger for linux [OR] jlink debuger for Windows for WSL/SES Usage ----- From 378478cd36869e0e80aafb73807a17da48f706e3 Mon Sep 17 00:00:00 2001 From: Shishir Patil Date: Wed, 15 Apr 2020 16:10:45 -0700 Subject: [PATCH 4/5] cosmetics --- README.md | 10 +++++----- make/Program.mk | 19 ++++++++----------- make/README.md | 5 +++-- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 3c62a9a64..b73c995f2 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,8 @@ you must do. On Ubuntu: sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa - sudo apt-get update - sudo apt-get install gcc-arm-embedded + sudo apt update + sudo apt install gcc-arm-embedded On MacOS: @@ -90,14 +90,14 @@ you must do. On Windows Subsystem for Linux (WSL): sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa - sudo apt-get update - sudo apt-get install gcc-arm-embedded + sudo apt update + sudo apt install gcc-arm-embedded 2. Install Nordic's [command line tools](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf5x_cltools%2FUG%2Fcltools%2Fnrf5x_installation.html) `mergehex` and `nrfjprog`. Ensure these tools are extracted and added to your path. - For WSL: install the `nrfjprog` for Windows, and not for Linux. + For WSL: install the `nrfjprog` for Windows [installed with nRF-Command-Line-Tools for Windows]([nRF-Command-Line-Tools for Windows](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF5-Command-Line-Tools/Download#infotabs)), and not for Linux. You don't need the JLink software and JLink JTAG programmer for WSL. 3. Install the JLink [software](https://www.segger.com/jlink-software.html) for your platform. You want the "Software and documentation pack". diff --git a/make/Program.mk b/make/Program.mk index 76ac69a62..eeb685fdd 100644 --- a/make/Program.mk +++ b/make/Program.mk @@ -69,30 +69,27 @@ endif .PHONY: flash flash: all test_softdevice flash_mbr - $(Q)printf "r\n" > $(BUILDDIR)flash.jlink -ifdef ID - $(Q)printf "w4 $(ID_FLASH_LOCATION), 0x$(ID_SECON) 0x$(ID_FIRST)\n" >> $(BUILDDIR)flash.jlink -endif ifeq ($(strip $(grep -q Microsoft /proc/version)),) @echo Flashing: $(HEX) nrfjprog.exe -f nrf52 --program $(HEX) --sectorerase nrfjprog.exe -f nrf52 --reset else ifeq ($(USE_BOOTLOADER),1) +ifdef ID + $(Q)printf "w4 $(ID_FLASH_LOCATION), 0x$(ID_SECON) 0x$(ID_FIRST)\n" >> $(BUILDDIR)flash.jlink +endif + $(Q)printf "r\n" > $(BUILDDIR)flash.jlink $(Q)printf "loadfile $(MERGED_HEX) \nr\ng\nexit\n" >> $(BUILDDIR)flash.jlink $(Q)$(JLINK) $(JLINK_FLAGS) $(BUILDDIR)flash.jlink else ifeq ($(USE_BOOTLOADER),0) +ifdef ID + $(Q)printf "w4 $(ID_FLASH_LOCATION), 0x$(ID_SECON) 0x$(ID_FIRST)\n" >> $(BUILDDIR)flash.jlink +endif + $(Q)printf "r\n" > $(BUILDDIR)flash.jlink $(Q)printf "loadfile $(HEX) \nr\ng\nexit\n" >> $(BUILDDIR)flash.jlink $(Q)$(JLINK) $(JLINK_FLAGS) $(BUILDDIR)flash.jlink endif -flashWSL: all test_softdevice flash_mbr - @echo Flashing: $(OUTPUT_DIRECTORY)/toxophilite.hex - $(nrfjprog.exe) -f nrf52 --program $(OUTPUT_DIRECTORY)/toxophilite.hex --sectorerase - $(NRFPROG) -f nrf52 --reset - - - .PHONY: test_softdevice test_softdevice: $(BUILDDIR) ifneq ($(SOFTDEVICE_MODEL),blank) diff --git a/make/README.md b/make/README.md index 2c1ab3672..06de64aec 100644 --- a/make/README.md +++ b/make/README.md @@ -7,7 +7,7 @@ originally comes from We develop on Linux. This also works on Windows in either of the following ways: 1. Build on WSL (Windows Subsystem for Linux), and `flash` with WSL. -2. Build with SES (Segger Embedded Studio) and `flash` with WSL. Note: For this you will have to manually move the `.hex` file generated from SES to `build/` directory. For e.g. `mv blinky/pca10040/s132/ses/Output/Release/Exe/blinky_pca10040_s132.hex blinky/_build/blink_sdk16_blank.hex`. +2. Build with SES (Segger Embedded Studio) and `flash` with WSL. Note: For this you will have to manually move the `.hex` file generated from SES to `_build/` directory. For e.g. `mv [your_application]/pca10040/s132/ses/Output/Release/Exe/[your_application.hex] [your_application]/_build/[your_application.hex]`. The currently supported SDK versions are: 9, 10, 11 @@ -18,7 +18,8 @@ Things to Install 1. `gcc-arm-none-eabi`: https://launchpad.net/gcc-arm-embedded 2. gdb-arm-none-eabi 3. The [jlink tools](https://www.segger.com/jlink-software.html) for linux / windows for WSL -4. The jlink debuger for linux [OR] jlink debuger for Windows for WSL/SES +4. The jlink debuger for linux +5. The [nRF-Command-Line-Tools for Windows](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF5-Command-Line-Tools/Download#infotabs) Usage ----- From 14887c9982ddb8d9c4812a011b41126117a9cb0f Mon Sep 17 00:00:00 2001 From: Shishir Patil Date: Wed, 15 Apr 2020 16:25:05 -0700 Subject: [PATCH 5/5] JLink fix --- make/Program.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/Program.mk b/make/Program.mk index eeb685fdd..5aa9a6b52 100644 --- a/make/Program.mk +++ b/make/Program.mk @@ -74,17 +74,17 @@ ifeq ($(strip $(grep -q Microsoft /proc/version)),) nrfjprog.exe -f nrf52 --program $(HEX) --sectorerase nrfjprog.exe -f nrf52 --reset else ifeq ($(USE_BOOTLOADER),1) + $(Q)printf "r\n" > $(BUILDDIR)flash.jlink ifdef ID $(Q)printf "w4 $(ID_FLASH_LOCATION), 0x$(ID_SECON) 0x$(ID_FIRST)\n" >> $(BUILDDIR)flash.jlink endif - $(Q)printf "r\n" > $(BUILDDIR)flash.jlink $(Q)printf "loadfile $(MERGED_HEX) \nr\ng\nexit\n" >> $(BUILDDIR)flash.jlink $(Q)$(JLINK) $(JLINK_FLAGS) $(BUILDDIR)flash.jlink else ifeq ($(USE_BOOTLOADER),0) + $(Q)printf "r\n" > $(BUILDDIR)flash.jlink ifdef ID $(Q)printf "w4 $(ID_FLASH_LOCATION), 0x$(ID_SECON) 0x$(ID_FIRST)\n" >> $(BUILDDIR)flash.jlink endif - $(Q)printf "r\n" > $(BUILDDIR)flash.jlink $(Q)printf "loadfile $(HEX) \nr\ng\nexit\n" >> $(BUILDDIR)flash.jlink $(Q)$(JLINK) $(JLINK_FLAGS) $(BUILDDIR)flash.jlink endif