![]() ![]() RTT allows very high transfer speeds without affecting the real-time behaviour of a target. It can be used with any J-Link, even with the tiny on-board models like J-Link OB, OpenSDA, or converted ST-LINKs. RTT is a software only solution and does not require additional hardware on the target device, other than the standard debug connection. ![]() It combines the advantages of SWO with the features of other methods. RTT is SEGGER’s solution for a debug terminal. It can also be used to record interrupt entry/exit and function entry/exit, to periodically sample the PC value or variables in memory, or for event notification.Įrich gives a complete introduction to using SWO for debug messages, how to set it up on the target, and how to get the output on the host computer. ![]() To use SWO from multiple tasks in an RTOS or from interrupt routines, interrupts should be disabled during SWO output, which might influence the real time behaviour of the system.Īlthough SWO is most commonly used to print debug messages. This means that outputting 80 characters takes about 120 us. This allows sending up to 32 packet types (stimuli) but also causes a bit of protocol overhead, which slows things down to ~1.5 us/char at 10 MHz SWO speed. the debug output packets, are encoded in a special format. The output speed via SWO is dependent on the configured SWO speed. SWO does not stop the CPU such as semihosting to send output. This is especially critical if parts of the application shall make output at startup before PLL init or of the clock speed changes while the application is running. The CPU clock speed needs to be known to set up SWO on the debugger. The target MCU can stream data packets on this pin, similar to a UART TX pin, with a clock rate, derived from the CPU clock. The pin can be connected to the debug probe with the standard debug connector and used with the SWD interface (not JTAG). SWO is a single pin interface designed by ARM for Cortex-M3,M4, and M7 devices. Additionally the semihosting implementation is debugger dependent, and applications which use semihosting might not run without a debugger connected.Īnd then there are ARM’s SWO trace port and SEGGER’s Real Time Transfer (RTT). Therefore semihosting can simply not be used for applications which require real time behaviour, such as communication stacks. The debugger needs to realize that the target has stopped execution, reads registers and memory, writes memory, and can then restart the CPU. This means the target CPU does not run for this period of time. Printing one message can take anywhere from several milliseconds to more than one hundred milliseconds, as it is an expensive operation. With semihosting, the CPU halts to print output and is restarted “behind the scenes” by the debugger. The first software solution is semihosting. But a UART may already be used by the application and CDC requires a USB stack and a USB connector on the target hardware. ![]() Since the early days of embedded systems, there have been hardware dependent solutions like using a UART or USB CDC. There are different methods to get debug output from the target application. This inspired me to write a more general post on debug output (“printf”) implementations on embedded target, including SWO and RTT. Erich Styger recently posted a great tutorial on how to add console functionality using Single Wire Output (SWO) on ARM Cortex-M targets. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |