Support time sync on nRF52833 DK
This commit is contained in:
+2
-2
@@ -10,9 +10,9 @@ set(SRCS
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (CONFIG_SOC_COMPATIBLE_NRF52X)
|
if (CONFIG_SOC_COMPATIBLE_NRF52X)
|
||||||
MESSAGE(FATAL_ERROR "nRF52 SoC series not supported yet")
|
target_sources(app PRIVATE src/controller_time_nrf52.c)
|
||||||
elseif (CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP)
|
elseif (CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP)
|
||||||
target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/audio_sync_timer_rtc.c)
|
target_sources(app PRIVATE src/audio_sync_timer_rtc.c)
|
||||||
elseif (CONFIG_SOC_SERIES_NRF54LX OR CONFIG_SOC_SERIES_NRF54HX)
|
elseif (CONFIG_SOC_SERIES_NRF54LX OR CONFIG_SOC_SERIES_NRF54HX)
|
||||||
target_sources(app PRIVATE src/controller_time_nrf54.c)
|
target_sources(app PRIVATE src/controller_time_nrf54.c)
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -15,6 +15,39 @@ It has been tested on the nRF5340 Audio DK, but it should work with any nRF5340
|
|||||||
- Response: HCI Command Complete Event with status and 4 bytes timestamp in microseconds
|
- Response: HCI Command Complete Event with status and 4 bytes timestamp in microseconds
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## nRF58233 Development Kit
|
||||||
|
|
||||||
|
The first Virtual UART (UART1, ...) is Zephyr UART 0
|
||||||
|
The second Virtual UART (UART2, ...) is Zephyr UART 1
|
||||||
|
|
||||||
|
### Pinout
|
||||||
|
|
||||||
|
Signal direction as seen from the nRF52833.
|
||||||
|
|
||||||
|
| PIN | Arduino | MCU | Direction |
|
||||||
|
|----------|---------|-------|-----------|
|
||||||
|
| TX | D0 | P0.05 | out |
|
||||||
|
| RX | D1 | P0.06 | in |
|
||||||
|
| RTS | D7 | P0.07 | out |
|
||||||
|
| CTS | D8 | P0.08 | in |
|
||||||
|
| Time Sync| D10 | P1.01 | out |
|
||||||
|
|
||||||
|
### HCI over UART 0 connected to first Virtual UART in J-Link Probe
|
||||||
|
|
||||||
|
Release build:
|
||||||
|
```sh
|
||||||
|
west build --pristine -b nrf52833dk/nrf52833
|
||||||
|
```
|
||||||
|
Debug build:
|
||||||
|
```sh
|
||||||
|
west build --pristine -b nrf52833dk/nrf52833 -- -DOVERLAY_CONFIG=debug.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
To use UART 0 via Arduino headers, the virtual UART of the J-Link probe needs to be disabled, e.g. with the JLink Configuration Tool.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## nRF5340 Development Kit
|
## nRF5340 Development Kit
|
||||||
|
|
||||||
The first Virtual UART (UART1, ...) is Zephyr UART 1
|
The first Virtual UART (UART1, ...) is Zephyr UART 1
|
||||||
@@ -32,8 +65,6 @@ Signal direction as seen from the nRF5340.
|
|||||||
| CTS | D8 | P1.10 | in |
|
| CTS | D8 | P1.10 | in |
|
||||||
| Time Sync| D10 | P1.06 | out |
|
| Time Sync| D10 | P1.06 | out |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### HCI over USB CDC
|
### HCI over USB CDC
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -104,6 +135,7 @@ west build --pristine -b nrf5340_audio_dk/nrf5340/cpuapp -- -DEXTRA_DTC_OVERLAY_
|
|||||||
To use UART 1 via Arduino headers, the virtual UART of the J-Link probe needs to be disabled, e.g. with the JLink Configuration Tool.
|
To use UART 1 via Arduino headers, the virtual UART of the J-Link probe needs to be disabled, e.g. with the JLink Configuration Tool.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## nRF54L15
|
## nRF54L15
|
||||||
|
|
||||||
### HCI over UART 0 connected to second Virtual UART in J-Link Probe
|
### HCI over UART 0 connected to second Virtual UART in J-Link Probe
|
||||||
@@ -133,7 +165,7 @@ Signal direction as seen from the nRF54L15.
|
|||||||
|
|
||||||
|
|
||||||
## Maintainer Notes
|
## Maintainer Notes
|
||||||
- nRF5340 use Controller configuration in `sybuild/ipc_radio/prj.conf`, while other, e.g. nRF54L15, use configuration in `prj.conf`. Please update both at the same time.
|
- nRF5340 use Controller configuration in `sybuild/ipc_radio/prj.conf`, while others, e.g. nRF54L15, use configuration from `prj.conf`. Please update both at the same time.
|
||||||
- We can detect nRF5340 SoC in CMake with `if(CONFIG_SOC STREQUAL "nrf5340")` after find_package zephyr.
|
- We can detect nRF5340 SoC in CMake with `if(CONFIG_SOC STREQUAL "nrf5340")` after find_package zephyr.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,17 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/ {
|
||||||
|
host_interface {
|
||||||
|
compatible = "gpio-outputs";
|
||||||
|
status = "okay";
|
||||||
|
timesync: pin_0 {
|
||||||
|
gpios = <&gpio1 01 GPIO_ACTIVE_HIGH>;
|
||||||
|
label = "Controller to host timesync pin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
&uart0 {
|
&uart0 {
|
||||||
compatible = "nordic,nrf-uarte";
|
compatible = "nordic,nrf-uarte";
|
||||||
current-speed = <1000000>;
|
current-speed = <1000000>;
|
||||||
|
|||||||
+1
-1
@@ -412,7 +412,7 @@ uint8_t hci_cmd_iso_timesync_cb(struct net_buf *buf)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SOC_NRF54L15_CPUAPP
|
#if defined(CONFIG_SOC_NRF54L15_CPUAPP) || defined(CONFIG_SOC_NRF52833)
|
||||||
timestamp_second_us = (uint32_t) controller_time_us_get();
|
timestamp_second_us = (uint32_t) controller_time_us_get();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user