主题中讨论的其他器件: CC2640
您好、TI 支持团队、
我想打印 CC2640R2L 的 UART0上的所有异常。
我 使用以下配置、但不起作用。
app_ble.cfg
var SysMin = xdc.useModule('xdc.runtime.SysMin'); //SysMin.bufSize = 128; //System.SupportProxy = SysMin; var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); System.SupportProxy = SysCallback; //SysCallback.abortFxn = "&myUserAbort"; //SysCallback.exitFxn = "&myUserExit"; //SysCallback.flushFxn = "&myUserFlush"; //SysCallback.putchFxn = "&myUserPutch"; SysCallback.exitFxn = "&xdc_runtime_SysMin_exit__E"; /* This is the generated symbol for SysMin_exit */ SysCallback.putchFxn = "&glue_putchar"; SysCallback.abortFxn = "&my_UARTAbort"; //SysCallback.readyFxn = "&myUserReady"; m3Hwi.enableException = false; //m3Hwi.excHandlerFunc = null; m3Hwi.excHookFunc = "&excHookFunc"
处理程序:
#include <ti/sysbios/family/arm/m3/Hwi.h> volatile uintptr_t *excPC = 0; volatile uintptr_t *excCaller = 0; void excHookFunc(Hwi_ExcContext *ctx) { excPC = ctx->pc; excCaller = ctx->lr; char* buf = "Hello\n"; //Print anything just to make sure the handler is working for (int i=0; i<5; ++i) { glue_putchar(buf[i]); } while(2); } void glue_putchar(char ch) { UART_write(uart_handle, &ch, 1); } void my_UARTAbort(CString str) { int len = strlen(str); for (int i=0; i<len;++i) { glue_putchar(str[i]); } }
发生异常时、我在 UART 上看不到任何内容、调试器开始在控制台中打印以下内容。
Cortex_M3_0: Can't Run Target CPU: (Error -2134 @ 0x0) Unable to control device execution state. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.12.0.00150) Cortex_M3_0: Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.12.0.00150) Cortex_M3_0: Unable to determine target status after 20 attempts Cortex_M3_0: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging
我在 excHookFunc 的内部放置了一个断点、我可以命中该断点、但不知道为什么 UART 不能打印。
这是 CCS 的屏幕截图、其中显示 UART_Handle 和 UartParams 的值
CCS v12.4
TI BLEStack (SDK v5_30_00_03)
您能告诉我缺少什么吗?