Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
|
Download the example files using:
Enable debug-link task in user/task/task.mk
Rebuild the source code:
Install rtplot tool to the system:
First, execute the following command to launch the Tenok with QEMU:
The output should be similar to the following:
According to the output, serial2 (debug-link) is redirceted to /dev/pts/Y
.
Now open another terminal and execute the following command:
After the rtplot window shows up, select /dev/pts/Y
port, test
message then click the connect button. The user should expect to see some real-time data plotting on the screen.
Tenok uses a metalanguage to define messages for debug visualization, this message prorocol is called the Debug-Link. All message files should named as *.msg
and by default they should be placed in the msg/
directory.
To define a variable, the user can use the following syntax:
For array, the syntax is:
For example, in test.msg
(provided by the ./scripts/download-examples.sh
), the messages are defined as:
The supported types are:
The third description field of the message definition is optional, but it is recommended to not neglect it as it will show up in the real-time plotting graph.
When user execute make all
to build the code, the Makefile target calls the msggen
tool to generate C code and YAML files. The user should pack their on-board data with the generated C functions and send out the message to their computer via I/Os like USART, USB, etc. To visualize the messages, the user can then use another built-in tool called rtplot
, which reads the message definitions from the generated YAML files.
The following code illustrates a basic C code implementation for sending message:
The full example code can be found in user/task/debug/debug_task.c
.