Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bsp/nrf5x/libraries/drivers/drv_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -299,6 +302,9 @@ int rt_hw_uart_init(void)

#ifdef BSP_USING_UART1
m_serial_1.config = config;
#if defined(SOC_NRF5340)
m_serial_1.config.baud_rate = 1000000;
#endif /* SOC_NRF5340*/
m_serial_1.ops = &_uart_ops;
m_uarte1_cb.serial = &m_serial_1;
rt_hw_serial_register(&m_serial_1, "uart1", \
Expand Down
26 changes: 26 additions & 0 deletions bsp/nrf5x/nrf5340/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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路径跟我的不一样一样,可以参考
}
]
}

```


## 支持其他开发板

Expand Down
4 changes: 2 additions & 2 deletions bsp/nrf5x/nrf5340/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@

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'
Expand Down