Currently, booting up the camera is as follows:
- A systemd service is activated which runs a shell script
- This script then loads a bitstream into the FPGA and uses a ton of other scripts and C programs to train the LVDS channels and set up the HDMI output
When the service is disabled, the user can run this script manually, which:
- Of course, does not keep the user from running it even if it has already been activated by systemd
- And on the other hand, simple scripts which query the registers (e.g. to get the temperature of the sensor) can be actived even if the FPGA bitstream was not loaded
All of those lead to a solid lockup of the Beta, because if you write to one of those memory addresses which are used for communicating with the PL, and there is no handler in the FPGA, the ARM cores lock up solid, no recovery possible they basically wait for an ACK/NACK forever.
Research is taking place in the Labs here.
1 Unit tests
Unit tests have been added to the project to verify correct functionality. Catch2 framework is used, because it's single-header only and utilizes C++11 way of doing things.
1.1 Important note
When adding new or extending available tests: RAM access of the camera is different from x86/x64 CPUs, modified classes have to be used to bypass this, otherwise SEGFAULT would be the result.
In the CMake scripts a switch called ENABLE_MOCK was added, to allow to disable parts of code which cannot work on a regular PC (see CMV12000AdapterTests.cpp for an example). While running the build on camera cmake .. is sufficient, but for development one should use:
cmake -DENABLE_MOCK=ON ..