This folder contains several project examples for use with the Onethinx LoRa(WAN) module.
These projects combine the Visual Code setup for code editing with the magnificent PSoC Creator Schematic Editor & Design Wide Resources Editor for chip setup.
- Download and install PSoC Creator (optionally)
- Unfortunately PSoC Creator is Windows only. PSoC Creator is used for chip configuration only and isn't needed for writing and debugging code.
- The projects in this folder are pre-configured and don't need PSoC Creator to run.
- Download and install the Visual Studio Code IDE
- Follow the instructions in the link to install the Onethinx Dependencies Pack:
- For Windows: VSCode_OnethinxPack_Windows
- For Linux: VSCode_OnethinxPack_Linux
- For MacOS: VSCode_OnethinxPack_MacOS
- Clone
https://github.com/onethinx/Onethinx_Project_Examples.git
or download and unpack the Example Projects to your local machine.
This step is only needed when you need to change the chip configuration.
- Start PSoC Creator
- Open the Onethinx_Creator.cywrk workspace (File >> Open >> Project/Workspace)
- The PSoC Schematic Editor and the Design Wide Resources can be accessed at the left 'Workspace Explorer' pane:
..Onethinx_Project_Examples\Example_X\Onethinx_Creator.cydsn\Onethinx_Creator.cywrk
- After the changes to the chip configuration are done, build the Onethinx Creator project (Build >> Build Onethinx_Creator or Shift + F5)
- Make sure the project builds well from the output tab and the Onethinx CoreStripper has run:
- The chip configuration is done and PSoC Creator may be closed.
- Start VS Code
- Load the project by selecting the project folder (File >> Open Folder):
..\Onethinx_Project_Examples\Example_HelloWorld
- If your project has LoRaWAN keys:
- Navigate to source/OnethinxCore/LoRaWAN_keys.h and fill in your LoRaWAN keys.
- The following buttons in the statusbar can be used to configure, build and debug the project.
- On first-time load of a project, the CMake kit may be uninitialized. Select the correct kit GCC arm-none-eabi from the list.
- If the GCC compiler in the VSCode_OnethinxPack folder isn't listed, it is adviced to clear the user-local CMake kits file and do a fresh scan: View >> Command Pallette >> type 'kits' >> Edit User-Local CMake Kits Delete file contents and save View >> Command Pallette >> type 'kits' >> Scan for Kits
- Click
Clean-Reconfigure
in the status bar to configure the project's makefiles (only needs to be done once, when the Chip Configuration is changed and when source files are removed/added to the project). - Select the debug adapter to use for the project:
- From the left extensions pane, click the
Run and Debug
icon (Cortex-Debug extension) and select the debugger for the project from the top 'Run and Debug' dropdown list)
- From the left extensions pane, click the
- Click
Build
in the status bar to build the project. - Click
Build-and-Launch
in the status bar to build and debug the project.