基于macOS 亲测支持M1芯片
硬件
环境
以下安装都选择默认路径
项目
保证仿真器和开发板连通电脑
- 打开Code Composer Studio => Getting Started => Import Project
/Applications/ti/simplelink_cc2640r2_sdk_5_10_00_02/examples/rtos/CC2640R2_LAUNCHXL/ble5stack/project_zero
- 调试Run => Debug
日志
保证开发板Micro USB连通至电脑USB
- 修改main.c如下
int main()
{
// 省略了未修改代码
UART_init();
UartLog_init(UART_open(Board_UART0, NULL));
Log_info0("hello world");
// 省略了未修改代码
}
- 使用screen查看串口日志
screen /dev/tty.usbserial-* 115200
- 调试Run => Debug => 查看screen日志如下
#000001 [ 0.000 ] INFO: (main.c:141) hello world
#000002 [ 0.014 ] INFO: (led_service.c:221) Registered service, 5 attributes, status 0x00
#000003 [ 0.015 ] INFO: (button_service.c:260) Registered service, 7 attributes
#000004 [ 0.015 ] INFO: (data_service.c:239) Registered service, 6 attributes
#000005 [ 0.015 ] INFO: (led_service.c:237) Registered callbacks to application. Struct @20000e04
......