Hello Ti folks,
I am implementing an application which uses a dedicated UART port to chatter with an external module. Previously, I was relying on a custom UART based debug printf function to accumulate to a circular buffer and dump on task idle to a hard-coded debug only UART.
However, now that I need that UART dedicated to the other module, I was exploring using the SWV features of the ARM CPU. I also noticed that the SWV unlock is documented in the RTOS guide. Could someone point me at *any* resource which might explain the steps needed to get this cc26xx system doing both a UART to an external device as well as some other mechanism for doing debug prints?
I considered toggling the UART between the two different sets of pins - but this won't really work since I need the UART to the external device to be "always on".
Any suggestions? I attempted to setup the sequence in my app start to enable SWV, but I still do not see any stuff produced on the UART.
Here is my start sequence:
// 1. SET CPU_SCS:DEMCR:TRCEN = 1 (*((volatile unsigned int *)(0xE000EDFC))) |= (1 << 24); // 2. Unlock ITM configuration by writing to the Lock Access Register CPU_ITM:LAR (see Section 2.7.3.36, // LAR Register (Offset = FB0h) [reset = X]). (*((volatile unsigned int *)(0xE0000FB0))) = 0xC5ACCE55; // 3. Enable ITM by setting CPU_ITM:TCR.ITMENA (see Section 2.7.3.35, TCR Register (Offset = E80h) // [reset = X]). (*((volatile unsigned int *)(0xE0000E80))) |= 0x00000001; // 4. Enable the desired stimulus port (0 to 31) in CPU_ITM:TER (see Section 2.7.3.33, TER Register // (Offset = E00h) [reset = X] ). (*((volatile unsigned int *)(0xE0000E00))) |= 0x00000001; // 5. Change formatter configuration if needed CPU_TPIU:FFCR (see Section 2.7.5.6, FFCR Register // (Offset = 304h) [reset = X]). // Ignore for now // 6. Change the pin protocol if needed CPU_TPIU:SPPR (see Section 2.7.5.4, SPPR Register (Offset = // F0h) [reset = X]). (*((volatile unsigned int *)(0xE00400F0))) |= 0x00000002; // 7. Set the baudrate in CPU_TPIU:ACPR (see Section 2.7.5.3, ACPR Register (Offset = 10h) [reset = X]). (*((volatile unsigned int *)(0xE0040010))) = 625; // 8. The SWV can be mapped to DIO n by writing the correspond IOCPortConfigureSet(P_DEBUG_TX, IOC_PORT_MCU_SWV, IOC_STD_OUTPUT); while(true) { while(ITM_Port32(0) == 0x00); ITM_Port32(0) = 42; };