13.2 How RTT works
13.2.1 Target implementation
Real Time Terminal uses a SEGGER RTT Control Block structure in the target’s memoryto manage data reads and writes.
实时终端使用目标内存中的SEGGER RTT控制块结构管理数据读取和写入。
The control block contains an ID to make it findable in memory by a connected J-Link and a ring buffer structure for each available channel,describing the channel buffer and its state.
控制块包含一个ID,以使其可查找在内存中,每个可用通道都有一个连接的j-link和一个环形缓冲区结构,描述通道缓冲区及其状态。
The maximum number of available channels can be configured at compile time and each buffer can be configured and added by the application at run time.
Up and down buffers can be handled separately. Each channel can
be configured to be blocking or non-blocking. In blocking mode the application will wait
when the buffer is full, until all memory could be written, resulting in a blocked application
state but preventing data from getting lost. In non-blocking mode only data which fits into
the buffer, or none at all, will be written and the rest will be discarded. This allows running
in real-time, even when no debugger is connected. The developer does not have to create
a special debug version and the code can stay in place in a release application.
控制块包含一个ID,以使其可查找
在内存中,每个可用通道都有一个连接的j-link和一个环形缓冲区结构,
描述通道缓冲区及其状态。可用信道的最大数量
可以在编译时配置,并且可以通过配置和添加每个缓冲区
应用程序在运行时。上下缓冲可以单独处理。每个通道都可以
被配置为阻塞或非阻塞。在阻塞模式下应用程序会等待
当缓冲区满时,直到所有的内存都被写入,导致一个被阻塞的应用程序
状态但防止数据丢失。在非阻塞模式下,只适用于数据
缓冲区,或者根本没有,将被写入,其余的将被丢弃。这允许运行
在实时的情况下,即使没有调试器连接。开发人员不需要创建
一个特殊的调试版本和代码可以在一个发布应用程序中保持适当的位置。
转载于:https://www.cnblogs.com/suozhang/p/8028785.html