请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC1352P 我尝试使用 ITM 驱动程序将字符输出到辅助 UART 端口、 ITM_sendBufferAtomic API 可以在 SWO 引脚上输出一个字符串、但该字符串中每4个字节就会出现一个意外字符0x03。
我尝试更改波特率、但发现无论波特率是多少、0x03仍然是每4个字节出现一次。
这一特征是什么?它来自哪里?

我正在使用 simplelink_cc13xx_cc26xx_sdk_6_20_00_29中的 itmwrite_CC1352P1_LAUNCHXL_tirtos7_clicang 示例、并对 itmwrite.c 进行了一些更改、以便在上电后仅输出一个字符串:
/*
* ======== itmwrite.c ========
*/
#include <stdint.h>
#include <stddef.h>
#include <stdio.h>
/* POSIX Header files */
#include <pthread.h>
#include <semaphore.h>
/* Driver Header files */
#include <ti/drivers/ITM.h>
#include <ti/drivers/GPIO.h>
#include <ti/drivers/Power.h>
/*Posix header files*/
#include <time.h>
#include <signal.h>
/* Driver configuration */
#include "ti_drivers_config.h"
#define RESET_FRAME_PORT (12)
#define RESET_FRAME (0xBBBBBBBB)
/*
* ======== mainThread ========
*/
void *mainThread(void *arg0)
{
const char msg[] = "Hello World from ITM";
GPIO_init();
/* Configure the LED pin */
GPIO_setConfig(CONFIG_GPIO_LED_0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
/* Turn on user LED */
GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON);
/* Open the ITM driver, spin here on fail */
if (false == ITM_open())
{
/* Failed to open ITM driver, check for SWO pin conflicts */
while (1) {}
}
/* ITM host tooling expects a reset frame to reset the parser to a known
* state. This frame must be the first traffic from ITM. It also means that
* you need to reset the device after starting the parser to be sure
* that the reset frame is caught
*/
ITM_send32Atomic(RESET_FRAME_PORT, RESET_FRAME);
/* Greet the user */
ITM_sendBufferAtomic(0, msg, sizeof(msg));
while (1) {}
}
此致、
水阳