Arm Products Walk-through For Setting Up ILabs Lora Rpi2040 Board w/Clion IDE

In this guide we fuddle through a ILabs Clion setup for their Lora 868 Mhz Long Range board and point out some of the hurdles and improvements that would help!

Arm Products Walk-through For Setting Up ILabs Lora Rpi2040 Board w/Clion IDE

Music of the Day: Chill Labs Chillout Music for Work

  • The Arm Cortex-M0 is one of the most popular MCU processors in existence in everything from Raspberry Pi-Picos to edge devices and even your car.
  • Once you get past the bit-banging fun of micropython or the arduino IDE and want to get into some serious development you need to look at real CMSIS-DAP debugging development. A review to get you started.
  • It should be noted we pulled it off for about $25 and a subscription to Clion. You do not always need to buy a $4000 Segger.
CLion Support for Step-Debugging w/ Raspberry Pi-Pico
In this guide we get stepper-debugging to work for the Raspberry Pi Pico with a $25 CMSIS probe!

Ilabs (out of Switzerland) is the small engineering group that developed some interesting RPi2040 Lora modded boards.

  • Lora is very appealing for low-bandwidth LONG range. Of course one cannot really see these capabilities without looking at a good youtube video from Andreas Spiess
  • Boldly and it looks sans license ILabs  recommended right off  their webpage - to develop to a Arduino IDE with literally no code examples and it looks like no permission! Ouch!  Arduino group looks to have taken strong measures to stop 'IDE Bandwagoning.' and make no mention of these boards in their Arduino ecosystem.
  • Their documentation is very sparse for the gitlab and I presume assumes you are an experienced toolchain / engineer.
  • We will stay in neutral territory and look at the actual C/CMakeLists development cycle.

0. Install your basics.

sudo apt install cmake make gcc build-essential ninja -y
  1. Installing the Repository.
GitHub - ArmDeveloperEcosystem/lorawan-library-for-pico: Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡
Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡 - ArmDeveloperEcosystem/lorawan-library-for-pico
git clone --recurse-submodules https://github.com/sandeepmistry/pico-lorawan.git 

It takes a while to download:

and so on..

A new directory will hold it:

Next (spoiler alert - Clion prefers you do not do this prior so).

cd pico-lorawan
mdkir build
cd build
cmake .. 

Will break first because PICO_SDK_PATH has not been set (which is available here)

GitHub - raspberrypi/pico-sdk
Contribute to raspberrypi/pico-sdk development by creating an account on GitHub.
export PICO_SDK_PATH=/home/wherelives/pico-sdk/

Once you have that your cmake command from inside build will now work.

And then make it:

make -j <cpu count>

2. Setting up Clion to Ingest the Project Properly.

A configuration window will pop up - ours is set as:

Even though we just did a PICO_SDK_PATH export CLion did not find it and we recieved an error on the initial ingest as in:

We can manually add the CmakeLists for pico-sdk to the root CMakeLists as in:

Note: If you do a command-line 'cmake .' it can sometimes befuddle and not work with Clion. If that happens we resolved it by simply deleting the cache file.  But sometimes you just need it anways.

cmake . && make -j <cpu count>

The highlighted green line above we typed in.  Note how the Cmake button offers up to remake the project.  Clion did it right.

Errors.

  • This successfully ingested however normally CLion will go through and build build-targets for all the subdirectories.  One mis-step and it didn't take (this is why we write these guides)
  • It is advisable to 'set-aside' a copy of the downloaded directory as soon as you pull it in case it does not ingest cleanly.

Try again.

  • This time we simply downloaded the project issued NO cmake. and make -j14 command then edited the one file for the PICO_SDK_PATH location:

This time it worked because we can see it assembled lots of build targets!

You can tell that it is integrating cleanly when all your build targets list:

Selecting any one of the build targets shows now a clean build as in:

From

GitHub - BNNorman/ilabs-challenger-rp2040-lora: Configuration information
Configuration information. Contribute to BNNorman/ilabs-challenger-rp2040-lora development by creating an account on GitHub.

It shows that we need to modify the one line for the SPI, our edit location is:

We can see that Clion is happy with it by its color highlighting of the added command:

We can see that this project is pulling from about 4 different Git projects as in:

We will stop here as it is enough to get going. Desired:

  • Step-Debugging port or a better debugging guide for these chips.
  • We had to do full manual 'bootsel' loads to update a very time consuming process.
  • There is a serious serious lack of documentation of what is going on in the library here - to the point that other boards maybe are considered?  For instance even though we can see the actual source code - where is the library about it?
  • The contributors to this library is small and specialized (maybe 6-8 people)
  • Also finally, do not forget the following:
Linux Rocks Every Day