Test your hardware configuration
To adapt Luos to your board specificities, you need to configure it. This subject is covered in the Luos configuration. To validate your network hardware configuration, you can use a Luos tool called selftest available in the Luos 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, you need to have only one board isolated (unconnected) from the network. Tx and Rx pins must be connected together, or you have to be able to receive what you send. This is already the case in One Wire and RS485 configurations. You must also connect the PTP pins together.
To check the Luos access to the physical network, you need to create a specific binary file only containing 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.
If you use platformio IDE, you must add a "-D SELFTEST" directive in the build_flags setting (this can be found in the file platformio.ini).
To finish, you need to add this in your main file:
//selftest pass! your configuration is OK
//selftest doesn't pass! your configuration is NOK
Execution and validation
To know if your configuration is OK or not, you need to be able to know in which function (
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.
It can be a communication problem:
- Check your MCU frequency definition in LuosHAL_config and your setup (those must be equals)
- Check USART configuration (Pinout Rx/Tx, USART number, IRQ, Handler)
- Check the TIMER configuration (Channel, IRQ, Handler)
- Check the DMA configuration (Channel, IRQ, Handler)
It can be a PTP problem:
- Check your Pinout definition and IRQ for you PTP pin
- Check in dedicated files the handler for IRQ :::