Skip to content
Snippets Groups Projects
Commit 79b7bfc3 authored by Marek Mioduszewski's avatar Marek Mioduszewski
Browse files

tasks update linux

parent de67b010
Branches
No related merge requests found
......@@ -4,7 +4,7 @@
"version": "2.0.0",
"options": {
"env": {
"nrf52SDKPath": "${workspaceFolder}/../../../../..",
"nrf52SDKPath": "${workspaceFolder}/../../../",
"userName": "root",
"group": "01"
}
......@@ -35,7 +35,7 @@
{
"label": "flashNordic",
"type": "shell",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 curl http://192.168.49.54:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://153.19.49.102:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb-serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"presentation":
{
"reveal": "always",
......@@ -46,7 +46,7 @@
{
"label": "flashNordicSD",
"type": "shell",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${nrf52SDKPath}/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://192.168.49.54:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${nrf52SDKPath}/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://153.19.49.102:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb-serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"presentation":
{
"reveal": "always",
......
......@@ -4,7 +4,7 @@
"version": "2.0.0",
"options": {
"env": {
"nrf52SDKPath": "${workspaceFolder}/../../../../..",
"nrf52SDKPath": "${workspaceFolder}/../../../",
"userName": "root",
"group": "01"
}
......@@ -35,7 +35,7 @@
{
"label": "flashNordic",
"type": "shell",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 curl http://192.168.49.54:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://153.19.49.102:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb-serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"presentation":
{
"reveal": "always",
......@@ -46,7 +46,7 @@
{
"label": "flashNordicSD",
"type": "shell",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${nrf52SDKPath}/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://192.168.49.54:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${nrf52SDKPath}/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://153.19.49.102:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb-serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"presentation":
{
"reveal": "always",
......
......@@ -4,7 +4,7 @@
"version": "2.0.0",
"options": {
"env": {
"nrf52SDKPath": "${workspaceFolder}/../../../../..",
"nrf52SDKPath": "${workspaceFolder}/../../../",
"userName": "root",
"group": "01"
}
......@@ -35,7 +35,7 @@
{
"label": "flashNordic",
"type": "shell",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 curl http://192.168.49.54:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://153.19.49.102:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb-serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"presentation":
{
"reveal": "always",
......@@ -46,7 +46,7 @@
{
"label": "flashNordicSD",
"type": "shell",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${nrf52SDKPath}/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://192.168.49.54:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${nrf52SDKPath}/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://153.19.49.102:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb-serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"presentation":
{
"reveal": "always",
......
# Installation
Needed packages:
- armgcc
- code
- nRF5 SDK
After downloading nRF5 SDK, extract it to chosen directory.
## Ubuntu
Installation in Ubuntu:
* ARM-GCC
```shell
sudo apt update
sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi gdb-arm-none-eabi openocd
```
* NRF SDK
```shell
cd ~/Downloads/
wget https://www.nordicsemi.com/-/media/Software-and-other-downloads/SDKs/nRF5/Binaries/nRF5SDK160098a08e2.zip
unzip nRF5SDK160098a08e2.zip -d ~/nrf5_sdk/
```
# VS Code configuration files
VSCode configuration is devided into files:
- settings.json - vscode configuration, (e.g. code formatting)
- tasks.json - tasks configuration (e.g. make, make flash, make clean)
- c_cpp_properties.json - IntelliSense configuration (paths to find Include files, macros etc.)
Additional:
- launch.json - running and debugging configurations
# Example project
## Running project based on nRF5 SDK example
Create a directory inside the sdk directory, for example "projects" and copy the blinky example provided by SDK.
```shell
cd ~/nrf5_sdk/
mkdir projects
cd ./examples
cp -r --parents ./peripheral/blinky ../projects/
cd ../projects/peripheral/blinky
```
## Downloading basic VS Code configuration
Example configuration files are in this repository. You can either clone it with GIT or download it as an archive.
After downloading extract it to your project directory:
```shell
unzip nrf52.vscode.zip -d ~/nrf5_sdk/projects/peripheral/blinky/.vscode/
```
## Running VS Code
```shell
cd ~/nrf5_sdk/projects/peripheral/blinky
code .
```
# Confiuration adjustment
Configuration files need to be adjusted to your project. The process is rather easy, but it may depend on the complexity of your solution.
## tasks.json
In tasks file you have to set up your build configuration. For example, you may have a production or debug or multiple boards configurations.
## c_cpp_properites.json
This file configures C/C++ extension and IntelliSense engine. c_cpp_properties.json should be filled with information from the Makefile of your project/example (Makefile is usually found in your_project/pca10056/armgcc/Makefile)
It is also necessary to include path for sdk_config.h, usually:
```
"${workspaceFolder}/pca10056/blank/config/sdk_config.h"
```
### SoftDevice
If you are using SoftDevice in your project, this path usually changes to something like:
```
"${workspaceFolder}/pca10056/*s140*/config/sdk_config.h"
```
It is also very important to add SoftDevice macros for IntelliSense engine:
```
"NRF_SD_BLE_API_VERSION=7",
"S140",
"SOFTDEVICE_PRESENT"
```
# Other
This tutorial is based on:
* [Windows example](https://github.com/gera-k/VSC-Nordic-example)
* [Linux example](https://github.com/justinmklam/nrf52-blinky-demo)
\ No newline at end of file
......@@ -4,7 +4,7 @@
"version": "2.0.0",
"options": {
"env": {
"nrf52SDKPath": "${workspaceFolder}/../../../../..",
"nrf52SDKPath": "${workspaceFolder}/../../../",
"userName": "root",
"group": "01"
}
......@@ -35,7 +35,7 @@
{
"label": "flashNordic",
"type": "shell",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 curl http://192.168.50.238:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://153.19.49.102:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb-serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"presentation":
{
"reveal": "always",
......@@ -46,7 +46,7 @@
{
"label": "flashNordicSD",
"type": "shell",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${nrf52SDKPath}/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex ${userName}@153.19.50.238:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://192.168.49.102:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"command": "scp -P 120${group} pca10059/s140/armgcc/_build/nrf52840_xxaa.hex ${nrf52SDKPath}/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex ${userName}@153.19.49.102:/var/tmp && ssh -p 120${group} ${userName}@153.19.49.102 'curl http://153.19.49.102:3001/resetNRF52v2/${group} && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb-serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"presentation":
{
"reveal": "always",
......@@ -60,7 +60,7 @@
"options": {
"cwd": "${workspaceFolder}/pca10056/s140/armgcc"
},
"command": "make all ",
"command": "make all -j$(nproc)",
"group": "build"
},
{
......@@ -87,7 +87,7 @@
"options": {
"cwd": "${workspaceFolder}/pca10059/s140/armgcc"
},
"command": "make all ",
"command": "make all -j$(nproc)",
"group": {
"kind": "build",
"isDefault": true
......@@ -147,7 +147,7 @@
{
"label": "windows: flashNordic",
"type": "shell",
"command": "scp -P 120%group% pca10059/s140/armgcc/_build/nrf52840_xxaa.hex %userName%@153.19.49.102:/var/tmp && ssh -p 120%group% %userName%@153.19.49.102 curl http://192.168.50.238:3001/resetNRF52v2/%group% && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex",
"command": "scp -P 120%group% pca10059/s140/armgcc/_build/nrf52840_xxaa.hex %userName%@153.19.49.102:/var/tmp && ssh -p 120%group% %userName%@153.19.49.102 curl http://192.168.49.54:3001/resetNRF52v2/%group% && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --debug-mode --application /var/tmp/*.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex",
"presentation":
{
"reveal": "always",
......@@ -158,7 +158,7 @@
{
"label": "windows: flashNordicSD",
"type": "shell",
"command": "scp -P 120%group% pca10059/s140/armgcc/_build/nrf52840_xxaa.hex %nrf52SDKPath%/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex %userName%@153.19.49.102:/var/tmp && ssh -p 120%group% %userName%@153.19.49.102 'curl http://192.168.50.238:3001/resetNRF52v2/%group% && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"command": "scp -P 120%group% pca10059/s140/armgcc/_build/nrf52840_xxaa.hex %nrf52SDKPath%/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex %userName%@153.19.49.102:/var/tmp && ssh -p 120%group% %userName%@153.19.49.102 'curl http://192.168.49.54:3001/resetNRF52v2/%group% && nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id 0xCA --softdevice /var/tmp/s140_nrf52_7.0.1_softdevice.hex --debug-mode --application /var/tmp/nrf52840_xxaa.hex /var/tmp/dfu.zip && nrfutil dfu usb_serial -pkg /var/tmp/dfu.zip -p /dev/ttyACM0 -b 115200 && rm /var/tmp/*.hex'",
"presentation":
{
"reveal": "always",
......@@ -172,7 +172,7 @@
"options": {
"cwd": "${workspaceFolder}/pca10056/s140/armgcc"
},
"command": "make all ",
"command": "make all -j$(nproc)",
"group": "build"
},
{
......@@ -199,7 +199,7 @@
"options": {
"cwd": "${workspaceFolder}/pca10059/s140/armgcc"
},
"command": "make all ",
"command": "make all -j$(nproc)",
"group": {
"kind": "build",
"isDefault": true
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment