@@ -254,6 +254,9 @@ static int _uart_putc(struct rt_serial_device *serial, char c)
{
}
+#if defined(SOC_NRF5340)
+ return 1;
+#endif /* SOC_NRF5340*/
return rtn;
@@ -299,6 +302,9 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART1
m_serial_1.config = config;
+ m_serial_1.config.baud_rate = 1000000;
m_serial_1.ops = &_uart_ops;
m_uarte1_cb.serial = &m_serial_1;
rt_hw_serial_register(&m_serial_1, "uart1", \
@@ -93,6 +93,32 @@ PCA10143-nrf7002 开发板常用 **板载资源** 如下:
4. 输入`scons --target=mdk5` 命令重新生成工程。
+### 启用Openocd调试
+
+```
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "nRF5340_Debug-RT-Thread",
+ "executable": "${workspaceRoot}/rt-thread.elf",
+ "request": "launch",
+ "type": "cortex-debug",
+ "runToEntryPoint": "main",
+ "targetId": "nRF5340_xxAA_APP",//填device名
+ "servertype": "jlink",
+ "device": "nRF5340_xxAA_APP",//填device名
+ "interface": "swd",
+ "svdFile": "${workspaceRoot}/packages/nrfx-latest/mdk/nrf5340_application.svd",
+ "armToolchainPath": "D:/bin/env-windows/tools/gnu_gcc/arm_gcc/mingw/bin", // 这里填入GCC 工具链路径,我用的是env的gcc
+ "serverpath": "D:/RT-ThreadStudio/repo/Extract/Debugger_Support_Packages/SEGGER/J-Link/v7.92/JLinkGDBServerCL.exe" // 这里填入GDB 路径,我用的是RT-ThreadStudio,注意你的jlink路径跟我的不一样一样,可以参考
+ }
+ ]
+}
## 支持其他开发板
@@ -42,14 +42,14 @@ if PLATFORM == 'gcc':
DEVICE = ' -mcpu='+CPU + ' -mthumb -ffunction-sections -fdata-sections'
CFLAGS = DEVICE
- AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
+ AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__START=entry -D__STARTUP_CLEAR_BSS'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
CPATH = ''
LPATH = ''
if BUILD == 'debug':
- CFLAGS += ' -O0 -gdwarf-2'
+ CFLAGS += ' -Og -gdwarf-2'
AFLAGS += ' -gdwarf-2'
else:
CFLAGS += ' -O2'