Skip to main content
Version: 2.8.0

Test your Robus configuration

To adapt Luos engine to your board specificities, you need to configure it. This subject is covered in the Luos engine configuration. To validate your Robus network's hardware configuration, you can use a Robus tool called selftest available in the Luos engine's 'library.

Hardware test conditions

In order to allow selftest to check everything, you need to have specific conditions for your board. To make this test, only one board must be isolated (unconnected) from the network. Robus needs to be able to receive what it sends to check messages integrity and to catch collisions. To do that, you must have the TX and RX pins connected together, directly or through a driver. This is already the case in One Wire and RS485 configurations. You must also connect the PTP pins together.

luos_imgluos_img

Software conditions

To check the Robus access to the physical network, you need to create a specific binary file containing only the selftest program. This program will perform some checkups allowing you to validate your hardware configuration. To use the selftest tool, you have to define SELFTEST using "-D SELFTEST" GCC build flag.

info

If you use platformio IDE, you must add a "-D SELFTEST" directive in the buildflags setting (this can be found in the file _platformio.ini).

To finish, you need to add this in your main file:

#include "luos_engine.h"
#include "selftest.h"

void selftest_ok(void)
{
//selftest pass! your configuration is OK
}

void selftest_nok(void)
{
//selftest doesn't pass! your configuration is NOK
}


int main(void)
{
selftest_run(selftest_ok, selftest_nok);
}

Execution and validation

To know if your configuration is OK or not, you need to be able to know in which function (selftest_ok or selftest_nok) you will finish. If you have debug capabilities, you can add breakpoints on these functions allowing you to analyse the call stack and precisely diagnose your test. If not, you need to find a way to retrieve feedback such as a characteristic LED blink, for example.

The Selftest.c file shows you which part of the hardware communication is tested.

info

If NOK:

It can be a communication problem:

  1. Check your MCU frequency definition in LuosHAL_config and your setup (those must be equals)
  2. Check USART configuration (Pinout Rx/Tx, USART number, IRQ, Handler)
  3. Check the TIMER configuration (Channel, IRQ, Handler)
  4. Check the DMA configuration (Channel, IRQ, Handler)

It can be a PTP problem:

  1. Check your Pinout definition and IRQ for you PTP pin
  2. Check in dedicated files the handler for IRQ :::