This project aims to provide simple implementations to test newly produced/delivered enV5 hardware.
For compiling the project, the required tools are:
-
gcc (local C compiler)
-
arm-non-eabi-gcc (C compiler for RP2040)
-
CMake (Build Script Generator)
-
Ninja (Build Tool)
-
Install all required tools (see Prerequisites)
-
Clone the repo to your local machine
-
Open the project in your preferred C/C++ IDE
ℹ️
|
If you use the CLion IDE as recommended, the build script generation is done by the IDE itself. If you want to do this by yourself, please refer to CMake. |
❗
|
You have to adjust the network/mqtt broker credentials as mentioned in the network README! |
❗
|
You have to adjust the base URL and the used FPGA type. This can be achieved by updating the appropriate fields in the src/CMakeLists.txt file. |
There are three CMake Profiles provided with the CLion settings: Debug, Release.
The Debug and Release targets differ only in the amount of printed information when the software is executed on an enV5-device.
# Debug profile
cmake -B build/debug -G Ninja -D CMAKE_BUILD_TYPE=DEBUG -D DEBUG_MODE:BOOL=ON
# Release profile
cmake -B build/release -G Ninja -D CMAKE_BUILD_TYPE=RELEASE -D DEBUG_MODE:BOOL=OFF
The flag -G Ninja
tells CMake to use Ninja as the build tool.
If this flag is not passed, CMake will use the default build tool on your machine (mostly Makefiles).
The debug targets can be built by executing:
cmake --build build/debug -j 4
The release targets can be built by executing:
cmake --build build/release -j 4
The *.uf2
files to flash the pico can than be found under the
out folder.
The hardware tests can be build using
cmake --build build/debug -j 4 --target <test_name>
replacing <test_name>
with the name of the test.
The resulting <test_name>.u2f
files to flash the pico can be found under the out folder.
-
Press and hold
MCU BOOT
on the Elastic Node -
Press
MCU RST
on the Elastic Node -
Release
MCU BOOT
-
Copy the
*.uf2
File to the RPI-RP2 device
If the pico is connected to the local machine the printf()
statements inside the code will be redirected to the USB and are available as serial port output.
This output can be read via a serial port reader like screen, minicom or putty.
The following example shows how to use minicom on a Unix-based system:
minicom \
-b 115200 \ #(1)
-o \ #(2)
-D /dev/ttyACM0 #(3)
-
-b 115200
→ baud rate for connection -
-o
→ disable modem initialisation -
-D /dev/ttyACM0
→ serial port
❗
|
The serial port differs depending on the host machine!
It can be found via |
To enable enhanced Debug output, add the flag -D DEBUG_OUTPUT:BOOL=ON
to the CMake Setup call (or add it in the CLion CMake options).
This enables the PRINT_DEBUG(…)
from the common_lib of the enV5 repository in all targets.
Clion automatically detects targets and adds them to the configurations in the upper right corner. These can be built via one of the profiles. There are three profiles in total:
-
Debug
: build targets for the RP2040 with debug logs -
Release
: build targets for the RP2040 without debug logs
❗
|
This may be required for newly arrived boards, since they are delivered without the ESP-Firmware! |
$ pip install esptool #(1)
$ esptool.py --port /dev/ttyUSB0 \ #(2)
--baud 1152000 \ #(3)
write_flash 0 \ #(4)
esp-firmware.bin #(5)
-
Install the esptool from PyPi
-
Define the local port for the Debugging Probe
-
Define the baudrate for the Communication with the ESP32 module
-
Issue a command to write to address 0 \
-
Define the binary to be written to the ESP32 module