robotology / icub-firmware

iCub Firmware
Other
11 stars 30 forks source link

HW test projects using `embot` environment: `ems`, `mc4plus` and `amc` #434

Closed marcoaccame closed 10 months ago

marcoaccame commented 10 months ago

This PR adds minimal HW test projects using the embot environment for the ems , the mc4plus and the amc boards. The projects can be used as template / demonstrators for developing / testing new HW device drivers.

Description

The most recent boards use the embot environment and new code will be strongly preferred to be in C++ and to run in this environment.

So, it is normal that the HW test project for instance of the amc uses the embot environment. But is useful that also the ems and the mc4plus can use the embot features.

So, this PR adds some simple test programs for the ems and mc4plus that run the embot environment. The embot::hw layer runs on top of the legacy hal2.ems4rd.ethdbg.lib and hal2.mc4plus.ethdbg.lib hardware abstraction layer libraries. And then, the embot::os layer runs as usual.

As a result, the test projects on the three boards all share a common environment to explore some topics that may be of interest.

They all launch a periodic thread called tTEST that can init some HW module and then tick it regularly. The details of what each board does are in the following.

Tests

All the projects have been tested using an ULINK Pro and an STlink. They work fine. I just attach a simple printscreen.

image Figure. The tTEST thread flushes 8 CAN frames to the channel and we can see the 8 execution of the CAN IRQHandler FDCAN1_IT0.

Mergeability

This PR does not change any feature, it just adapts the mandatory embot::hw drivers so that they can work on top of hal2. So, it can be safely merged.