diff --git a/CMakeLists.txt b/CMakeLists.txt index c1fc429..cbcd54e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,9 @@ set(SRCS ) 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) - 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) target_sources(app PRIVATE src/controller_time_nrf54.c) else() diff --git a/README.md b/README.md index c4ef514..144b762 100644 --- a/README.md +++ b/README.md @@ -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 + +## 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 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 | | Time Sync| D10 | P1.06 | out | - - ### HCI over USB CDC ```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. + ## nRF54L15 ### 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 -- 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. diff --git a/boards/nrf52833dk_nrf52833.overlay b/boards/nrf52833dk_nrf52833.overlay index 1dd3aea..bb0fc52 100644 --- a/boards/nrf52833dk_nrf52833.overlay +++ b/boards/nrf52833dk_nrf52833.overlay @@ -4,6 +4,17 @@ * 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 { compatible = "nordic,nrf-uarte"; current-speed = <1000000>; diff --git a/src/main.c b/src/main.c index 3916b97..c4885c2 100644 --- a/src/main.c +++ b/src/main.c @@ -412,7 +412,7 @@ uint8_t hci_cmd_iso_timesync_cb(struct net_buf *buf) } #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(); #endif