Skip to content

This repository aims to provide the necessary hardware tests to verify newly delivered/produced elastic nodes.

Notifications You must be signed in to change notification settings

es-ude/enV5.2-hardware-test

 
 

Repository files navigation

enV5.2 Hardware Tests

Setup

For compiling the project, the required tools are:

Prerequisites
  • gcc (local C compiler)

  • arm-non-eabi-gcc (C compiler for RP2040)

  • CMake (Build Script Generator)

  • Ninja (Build Tool)

Local Setup
  1. Install all required tools (see Prerequisites)

  2. Clone the repo to your local machine

  3. 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.

CMake

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.

Profiles
# 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).

Target Pico

Build all Targets

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.

Hardware Tests

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.

Flashing the Elastic Node version 5 (enV5)

  1. Press and hold MCU BOOT on the Elastic Node

  2. Press MCU RST on the Elastic Node

  3. Release MCU BOOT

  4. Copy the *.uf2 File to the RPI-RP2 device

CMD line output

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)
  1. -b 115200 → baud rate for connection

  2. -o → disable modem initialisation

  3. -D /dev/ttyACM0 → serial port

The serial port differs depending on the host machine! It can be found via ls /dev/tty* (Linux) or ls /dev/tty.* (macOS) from the terminal.

Debug Output

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 specific settings

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

Project structure

This project contains various folders:

Folder Description

build

contains all CMake generated build scripts and resources

out

contains all executables (*.uf2 binary files) for the enV5

src

contains helpers and hardware test implementations

Flashing the ESP32 Module

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)
  1. Install the esptool from PyPi

  2. Define the local port for the Debugging Probe

  3. Define the baudrate for the Communication with the ESP32 module

  4. Issue a command to write to address 0 \

  5. Define the binary to be written to the ESP32 module

Further Reading

About

This repository aims to provide the necessary hardware tests to verify newly delivered/produced elastic nodes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 56.5%
  • CMake 35.0%
  • Python 8.5%