diff --git a/Kconfig b/Kconfig index fd1d6acc..356b986c 100644 --- a/Kconfig +++ b/Kconfig @@ -6,13 +6,5 @@ rsource "drivers/Kconfig" -choice NVS_LOG_LEVEL_CHOICE - default NVS_LOG_LEVEL_ERR -endchoice - -choice SETTINGS_LOG_LEVEL_CHOICE - default SETTINGS_LOG_LEVEL_ERR -endchoice - config ALIRO_PRINT_READER_GROUP_ID bool "Print reader group ID that should be provisioned into the User Device" diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 095d9694..38d475f7 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -17,11 +17,21 @@ target_sources(app PRIVATE ${app_sources} ) -set(ALIRO_LIB ${ZEPHYR_NCS_DOOR_LOCK_APP_MODULE_DIR}/lib/aliro/bin) -set(PUBLIC_API ${ZEPHYR_NCS_DOOR_LOCK_APP_MODULE_DIR}/lib/aliro) +set(ALIRO_LIB_DIR ${ZEPHYR_NCS_DOOR_LOCK_APP_MODULE_DIR}/lib/aliro) -zephyr_link_libraries(${ALIRO_LIB}/libaliro.a) +if(CONFIG_SOC_SERIES_NRF52X) + set(ALIRO_LIB_BIN_PATH ${ALIRO_LIB_DIR}/bin/cortex-m4) +elseif(CONFIG_SOC_SERIES_NRF54LX OR CONFIG_SOC_SERIES_NRF53X) + set(ALIRO_LIB_BIN_PATH ${ALIRO_LIB_DIR}/bin/cortex-m33) +endif() -zephyr_include_directories(${PUBLIC_API}/include) -zephyr_include_directories(${PUBLIC_API}/interfaces) -zephyr_include_directories(${PUBLIC_API}/interfaces/crypto/backend_crypto_psa) +add_library(aliro_stack STATIC IMPORTED GLOBAL) + +set_target_properties(aliro_stack PROPERTIES IMPORTED_LOCATION ${ALIRO_LIB_BIN_PATH}/libaliro.a) + +target_link_libraries(app PRIVATE aliro_stack) +target_link_libraries(aliro_stack INTERFACE zephyr_interface) + +zephyr_include_directories(${ALIRO_LIB_DIR}/include) +zephyr_include_directories(${ALIRO_LIB_DIR}/interfaces) +zephyr_include_directories(${ALIRO_LIB_DIR}/interfaces/crypto/backend_crypto_psa) diff --git a/app/Kconfig b/app/Kconfig index 3f504edb..726bc083 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -5,7 +5,7 @@ # rsource "src/nfc_transport_impl/Kconfig" -rsource "../lib/aliro/Kconfig.aliro.defconfig" +rsource "../lib/aliro/Kconfig.defconfig" menu "Zephyr" source "Kconfig.zephyr" diff --git a/app/boards/nrf52840dk_nrf52840.overlay b/app/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 00000000..6b0a0ade --- /dev/null +++ b/app/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&pinctrl { + spi0_default_alt: spi0_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi0_sleep_alt: spi0_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +&spi0 { + compatible = "nordic,nrf-spi"; + status = "okay"; + cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + + pinctrl-0 = <&spi0_default_alt>; + pinctrl-1 = <&spi0_sleep_alt>; + pinctrl-names = "default", "sleep"; + nucleo_nfc@0 { + compatible = "x-nucleo-nfc"; + reg = <0>; + spi-max-frequency = <4000000>; + irq-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + }; +}; + +&spi1 { + status = "disabled"; +}; + +&spi2 { + status = "disabled"; +}; + +&spi3 { + status = "disabled"; +}; + +/ { + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; diff --git a/app/boards/nrf5340dk_nrf5340_cpuapp.overlay b/app/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 00000000..ee77d646 --- /dev/null +++ b/app/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&pinctrl { + spi1_default_alt: spi1_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi1_sleep_alt: spi1_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + +}; + + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + + pinctrl-0 = <&spi1_default_alt>; + pinctrl-1 = <&spi1_sleep_alt>; + pinctrl-names = "default", "sleep"; + nucleo_nfc@0 { + compatible = "x-nucleo-nfc"; + reg = <0>; + spi-max-frequency = <4000000>; + irq-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + }; +}; diff --git a/app/nrf54l15dk_nrf54l15_cpuapp.overlay b/app/boards/nrf54l15dk_nrf54l15_cpuapp.overlay similarity index 100% rename from app/nrf54l15dk_nrf54l15_cpuapp.overlay rename to app/boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/app/prj.conf b/app/prj.conf index 37736458..bdb19c50 100644 --- a/app/prj.conf +++ b/app/prj.conf @@ -11,22 +11,30 @@ CONFIG_CPP=y CONFIG_STD_CPP17=y CONFIG_REQUIRES_FULL_LIBCPP=y CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_ASSERT=y # Logging CONFIG_CONSOLE=y CONFIG_LOG=y CONFIG_NCS_ALIRO_RFAL_LOG_LEVEL_DBG=y - -# Print reader key that can be provisioned to the User Device -CONFIG_ALIRO_PRINT_READER_GROUP_ID=y - -# RFAL worker stack size (TODO: optimize) -CONFIG_RFAL_WORKER_THREAD_STACK_SIZE=8192 +CONFIG_USE_SEGGER_RTT=n +CONFIG_LOG_BACKEND_RTT=n +CONFIG_LOG_BACKEND_SHOW_COLOR=n # Disable unused shell features CONFIG_SHELL_VT100_COLORS=n CONFIG_SHELL_HISTORY=n CONFIG_SHELL_WILDCARD=n +# Increase shell buffer sizes +CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=512 +CONFIG_SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE=128 + # Adjust logs queue size CONFIG_SHELL_BACKEND_SERIAL_LOG_MESSAGE_QUEUE_SIZE=768 + +# Print reader key that can be provisioned to the User Device +CONFIG_ALIRO_PRINT_READER_GROUP_ID=y + +# RFAL worker stack size (TODO: optimize) +CONFIG_RFAL_WORKER_THREAD_STACK_SIZE=8192 diff --git a/app/sample.yaml b/app/sample.yaml new file mode 100644 index 00000000..bf78be34 --- /dev/null +++ b/app/sample.yaml @@ -0,0 +1,13 @@ +sample: + description: Door lock sample application + name: ncs-door-lock-sample +common: + sysbuild: true + build_only: true + platform_allow: &platforms + - nrf54l15dk/nrf54l15/cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + integration_platforms: *platforms +tests: + app.nfc_door_lock: {} diff --git a/app/src/hw_init.cpp b/app/src/hw_init.cpp deleted file mode 100644 index 4ee918ad..00000000 --- a/app/src/hw_init.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "aliro/utils.h" - -#include -#include -#include -#include -#include - -#include - -LOG_MODULE_REGISTER(hw_init, CONFIG_NCS_DOOR_LOCK_APP_LOG_LEVEL); - -static const struct gpio_dt_spec sNfcPowerSwitch = GPIO_DT_SPEC_GET(DT_NODELABEL(nfc_power_switch), gpios); - -static int NfcResetPinConfigure() -{ - VerifyOrReturnStatus(gpio_is_ready_dt(&sNfcPowerSwitch), EXIT_FAILURE, - LOG_ERR("The NFC Power switch pin GPIO port is not ready")); - - // Configure PIN as output with high level = NFC tag is enabled by default. - int erc = gpio_pin_configure_dt(&sNfcPowerSwitch, GPIO_OUTPUT_HIGH); - VerifyOrReturnStatus(erc == 0, EXIT_FAILURE, LOG_ERR("Configuring GPIO pin failed: %d", erc)); - - return EXIT_SUCCESS; -} - -static int HardwareInit(void) -{ - return NfcResetPinConfigure(); -} - -SYS_INIT(HardwareInit, POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY); diff --git a/app/src/main.cpp b/app/src/main.cpp index 1d1173e0..6a199b14 100644 --- a/app/src/main.cpp +++ b/app/src/main.cpp @@ -17,18 +17,7 @@ LOG_MODULE_REGISTER(door_lock_app, CONFIG_NCS_DOOR_LOCK_APP_LOG_LEVEL); int main() { - LOG_INF(" \r\n" - " @@@ @@@@ \r\n" - " @@@@@@@@@@@@ @@@ \r\n" - " @@@@@ @@@@@ @@@@ @@ @@@ @@ @@ @@@@ \r\n" - " @@@@ @@@@ @@@@ @@@@@@ @@@ @@ @@@@@ @@@ @@@@ \r\n" - "@@@@ @@ @@@ @@@ @@@ @@@ @@ @@@ @@@ @@@\r\n" - "@@@ @@@@@ @@@ @@@ @@@ @@@ @@ @@ @@@ @@\r\n" - "@@@ @@@@@@@@ @@@ @@@ @@@ @@@ @@ @@ @@@ @@\r\n" - " @@@ @@@@ @@@@ @@@ @@@@ @@@ @@ @@ @@ @@@\r\n" - " @@@ @@@@ @@@@ @@@@@@@@@@@ @@@@@ @@ @@ @@@@@@@@@ \r\n" - " @@@@ @@@@ @@@@ \r\n" - " @@ @@@@ @@ \r\n"); + LOG_INF("Starting nRF Door Lock Reference Application for the nRF Connect SDK"); AliroError ec = Aliro::AliroStack::Instance().Init( { .mOnAccessAttempt = diff --git a/app/src/nfc_transport_impl/nfc_transport_rfal.cpp b/app/src/nfc_transport_impl/nfc_transport_rfal.cpp index 5dbe60c8..6a06ab39 100644 --- a/app/src/nfc_transport_impl/nfc_transport_rfal.cpp +++ b/app/src/nfc_transport_impl/nfc_transport_rfal.cpp @@ -23,14 +23,8 @@ K_THREAD_STACK_DEFINE(mStack, CONFIG_RFAL_WORKER_THREAD_STACK_SIZE); void NfcTransportRfal::Run() { while (true) { - if (mRxTimeout || mIdleTimeout) { - if (mRxTimeout) { - VerifyAndCall(Instance().NfcDriver::mCallbacks.mOnError, ALIRO_TIMEOUT); - mRxTimeout = false; - } - if (mIdleTimeout) { - mIdleTimeout = false; - } + if (mIdleTimeout) { + mIdleTimeout = false; RecoverPolling(); } rfalNfcWorker(); @@ -73,7 +67,6 @@ void NfcTransportRfal::RfalNotifyCallback(rfalNfcState state) LOG_DBG("RFAL: Data exchange state"); break; case RFAL_NFC_STATE_DATAEXCHANGE_DONE: - k_timer_stop(&mRxTimer); CaptureRxData(); k_timer_start(&mIdleTimer, K_MSEC(sIdleTimerTimeoutMs), K_NO_WAIT); break; @@ -106,7 +99,7 @@ ReturnCode NfcTransportRfal::RfalNfcInit() return err; } -void NfcTransportRfal::SelectTag() +void NfcTransportRfal::SelectTag() const { rfalNfcDevice *nfcDevice; rfalNfcGetActiveDevice(&nfcDevice); @@ -150,7 +143,7 @@ void NfcTransportRfal::CaptureRxData() 0); } -void NfcTransportRfal::RecoverPolling() +void NfcTransportRfal::RecoverPolling() const { if (rfalNfcIsDevActivated(rfalNfcGetState())) { ReturnCode err = rfalNfcDeactivate(RFAL_NFC_DEACTIVATE_SLEEP); @@ -169,26 +162,26 @@ AliroError NfcTransportRfal::_Init(IsoDep::Callbacks callbacks) return ALIRO_NO_ERROR; } -AliroError NfcTransportRfal::_PrepareData(NfcTransport::Data data) +AliroError NfcTransportRfal::_PrepareData([[maybe_unused]] Data data) const { // ISO-DEP layer is implemented internally in the RFAL, no need for special data handling return ALIRO_ERROR_NOT_IMPLEMENTED; } -AliroError NfcTransportRfal::_PrepareRats() +AliroError NfcTransportRfal::_PrepareRats() const { // RATS is sent by the driver internally as an activation procedure, so we can presume the tag is fully selected // a this point return ALIRO_ERROR_NOT_IMPLEMENTED; } -AliroError NfcTransportRfal::_HandleReceivedData(NfcTransport::Data data, int transferError) +AliroError NfcTransportRfal::_HandleReceivedData([[maybe_unused]] Data data, [[maybe_unused]] int transferError) const { // No specific processing needed, all ISO-DEP specific data handling happens in driver's internals return ALIRO_ERROR_NOT_IMPLEMENTED; } -AliroError NfcTransportRfal::_ReportTimeout() +AliroError NfcTransportRfal::_ReportTimeout() const { // No special handling needed with RFAL return ALIRO_ERROR_NOT_IMPLEMENTED; @@ -219,7 +212,7 @@ AliroError NfcTransportRfal::_Init(NfcDriver::Callbacks callbacks) return ALIRO_ERROR_INTERNAL; } - k_tid_t thread = ncs_pal_nfc_worker_start([](void *, void *, void *) -> void { return Instance().Run(); }); + const k_tid_t thread = ncs_pal_nfc_worker_start([](void *, void *, void *) { Instance().Run(); }); VerifyOrReturnStatus(thread, ALIRO_INVALID_STATE, LOG_ERR("RFAL: Cannot spawn the NFC driver thread")); @@ -228,14 +221,6 @@ AliroError NfcTransportRfal::_Init(NfcDriver::Callbacks callbacks) return ALIRO_ERROR_INTERNAL; } - k_timer_init( - &mRxTimer, - [](k_timer *) { - LOG_DBG("RFAL: RX timer expired"); - Instance().mRxTimeout = true; - }, - nullptr); - k_timer_init( &mIdleTimer, [](k_timer *) { @@ -247,7 +232,7 @@ AliroError NfcTransportRfal::_Init(NfcDriver::Callbacks callbacks) return ALIRO_NO_ERROR; } -AliroError NfcTransportRfal::_Send(NfcTransport::Data data, uint32_t maximumFrameDelayTime) +AliroError NfcTransportRfal::_Send(Data data, [[maybe_unused]] uint32_t maximumFrameDelayTime) { k_timer_stop(&mIdleTimer); @@ -256,14 +241,13 @@ AliroError NfcTransportRfal::_Send(NfcTransport::Data data, uint32_t maximumFram // use RFAL_FWT_NONE as FWT because the driver with ISO-DEP enabled will ignore it anyway ReturnCode err = rfalNfcDataExchangeStart(data.mData, data.mLength, &mRxData, &mRcvLen, RFAL_FWT_NONE); if (!err) { - k_timer_start(&mRxTimer, K_MSEC(sRxTimerTimeoutMs), K_NO_WAIT); return ALIRO_NO_ERROR; } return ALIRO_ERROR_INTERNAL; } -AliroError NfcTransportRfal::_NfcOn() +AliroError NfcTransportRfal::_NfcOn() const { // The RF field is turned right after the STR25 boots // The only thing that must be done is to activate the reader @@ -277,7 +261,7 @@ AliroError NfcTransportRfal::_NfcOn() return ALIRO_NO_ERROR; } -AliroError NfcTransportRfal::_NfcOff() +AliroError NfcTransportRfal::_NfcOff() const { // RFAL handles this internally and knows when the field can be off return ALIRO_ERROR_NOT_IMPLEMENTED; diff --git a/app/src/nfc_transport_impl/nfc_transport_rfal.h b/app/src/nfc_transport_impl/nfc_transport_rfal.h index 906bdb0f..de5b60a2 100644 --- a/app/src/nfc_transport_impl/nfc_transport_rfal.h +++ b/app/src/nfc_transport_impl/nfc_transport_rfal.h @@ -6,8 +6,8 @@ #pragma once -#include "transport_nfc/driver/interface/aliro_nfc_driver.h" -#include "transport_nfc/isodep/interface/aliro_isodep.h" +#include "transport/nfc/driver/interface/aliro_nfc_driver.h" +#include "transport/nfc/isodep/interface/aliro_isodep.h" extern "C" { #include @@ -30,16 +30,16 @@ class NfcTransportRfal : public IsoDep, public NfcDriver { // IsoDep interface AliroError _Init(IsoDep::Callbacks callbacks); - AliroError _PrepareData(NfcTransport::Data data); - AliroError _PrepareRats(); - AliroError _HandleReceivedData(NfcTransport::Data data, int transferError); - AliroError _ReportTimeout(); + AliroError _PrepareData(Data data) const; + AliroError _PrepareRats() const; + AliroError _HandleReceivedData(Data data, int transferError) const; + AliroError _ReportTimeout() const; // NfcDriver interface AliroError _Init(NfcDriver::Callbacks callbacks); - AliroError _Send(NfcTransport::Data data, uint32_t maximumFrameDelayTime); - AliroError _NfcOn(); - AliroError _NfcOff(); + AliroError _Send(Data data, uint32_t maximumFrameDelayTime); + AliroError _NfcOn() const; + AliroError _NfcOff() const; static NfcTransportRfal &Instance() { @@ -51,23 +51,20 @@ class NfcTransportRfal : public IsoDep, public NfcDriver { void Run(); void RfalNotifyCallback(rfalNfcState state); void CaptureRxData(); - void SelectTag(); - void RecoverPolling(); + void SelectTag() const; + void RecoverPolling() const; rfalNfcDiscoverParam mNfcConfig{}; k_thread mThread{}; bool mMultiSel{ false }; - std::array mRxBuffer{}; + std::array mRxBuffer{}; uint8_t *mRxData{}; uint16_t *mRcvLen{}; - k_timer mRxTimer{}; k_timer mIdleTimer{}; - bool mRxTimeout{ false }; bool mIdleTimeout{ false }; - static constexpr uint32_t sRxTimerTimeoutMs{ CONFIG_RFAL_RX_TIMEOUT_MS }; static constexpr uint32_t sIdleTimerTimeoutMs{ CONFIG_RFAL_IDLE_TIMEOUT_MS }; }; diff --git a/app/src/platform_log.cpp b/app/src/platform_log.cpp index 8a108a5c..e146fa15 100644 --- a/app/src/platform_log.cpp +++ b/app/src/platform_log.cpp @@ -10,6 +10,29 @@ #include +LOG_MODULE_REGISTER(platform, CONFIG_NCS_DOOR_LOCK_APP_LOG_LEVEL); + +void AliroPlatformLogHexdump(AliroLogLevel logLevel, const void *data, size_t size, const char *str) +{ + switch (logLevel) { + case ALIRO_LOG_LEVEL_ERROR: + LOG_HEXDUMP_ERR(data, size, str); + break; + case ALIRO_LOG_LEVEL_WARN: + LOG_HEXDUMP_WRN(data, size, str); + break; + case ALIRO_LOG_LEVEL_INFO: + LOG_HEXDUMP_INF(data, size, str); + break; + case ALIRO_LOG_LEVEL_DEBUG: + LOG_HEXDUMP_DBG(data, size, str); + break; + case ALIRO_LOG_LEVEL_NONE: + default: + break; + } +} + void AliroPlatformLog(AliroLogLevel logLevel, const char *logFormat, ...) { #if defined(CONFIG_LOG) && !defined(CONFIG_LOG_MODE_MINIMAL) diff --git a/app/sysbuild/ipc_radio/boards/nrf5340dk_nrf5340_cpunet.conf b/app/sysbuild/ipc_radio/boards/nrf5340dk_nrf5340_cpunet.conf new file mode 100644 index 00000000..89f20aff --- /dev/null +++ b/app/sysbuild/ipc_radio/boards/nrf5340dk_nrf5340_cpunet.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Enable dynamic power control for the BT controller (on net core) +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y diff --git a/app/sysbuild/ipc_radio/prj.conf b/app/sysbuild/ipc_radio/prj.conf new file mode 100644 index 00000000..d5e93569 --- /dev/null +++ b/app/sysbuild/ipc_radio/prj.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_LOG=n + +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/docs/building_and_running.rst b/docs/building_and_running.rst index 71412c47..2eed0645 100644 --- a/docs/building_and_running.rst +++ b/docs/building_and_running.rst @@ -4,9 +4,9 @@ Building and running #################### In the :file:`door-lock-workspace`, the |APP_NAME| is placed in the :file:`ncs-door-lock-app` directory. -To build and run the application on the `nRF54L15 DK`_, complete the following steps: +To build and run the application on one of the :ref:`supported development kits (DKs) `, complete the following steps: -1. Connect the nRF54L15 DK to your computer using the **DEBUGGER** port on the DK. +1. Connect the DK to your computer using the **DEBUGGER** port on the DK. Set the **POWER** switch to **ON**. #. In the :file:`door-lock-workspace` directory, navigate to the :file:`ncs-door-lock-app` folder. @@ -14,15 +14,35 @@ To build and run the application on the `nRF54L15 DK`_, complete the following s #. Depending on the :ref:`NFC reader expansion board ` connected to the development kit, build the application by running the corresponding command: - +-----------------------+-----------------------+--------------------------------------------------------------------------------------------------------------+ - | Build type | X-NUCLEO-NFC board | Command | - +=======================+=======================+==============================================================================================================+ - | **Debug** (default) | `X-NUCLEO-NFC09A1`_ | ``west build -p -b nrf54l15dk/nrf54l15/cpuapp app`` | - | +-----------------------+--------------------------------------------------------------------------------------------------------------+ - | | `X-NUCLEO-NFC08A1`_ | ``west build -p -b nrf54l15dk/nrf54l15/cpuapp app -- -DCONFIG_ST25R3916B_DRV=y`` | - | +-----------------------+--------------------------------------------------------------------------------------------------------------+ - | | `X-NUCLEO-NFC05A1`_ | ``west build -p -b nrf54l15dk/nrf54l15/cpuapp app -- -DCONFIG_ST25R3911_DRV=y`` | - +-----------------------+-----------------------+--------------------------------------------------------------------------------------------------------------+ + +-----------------------+-----------------------+------------------------------------------------------------------------------------------------+ + | Build type | X-NUCLEO-NFC board | Command | + +=======================+=======================+================================================================================================+ + | Debug (default) | `X-NUCLEO-NFC09A1`_ | ``west build -p -b build_target app`` | + | +-----------------------+------------------------------------------------------------------------------------------------+ + | | `X-NUCLEO-NFC08A1`_ | ``west build -p -b build_target app -- -DCONFIG_ST25R3916B_DRV=y`` | + | +-----------------------+------------------------------------------------------------------------------------------------+ + | | `X-NUCLEO-NFC05A1`_ | ``west build -p -b build_target app -- -DCONFIG_ST25R3911_DRV=y`` | + +-----------------------+-----------------------+------------------------------------------------------------------------------------------------+ + + You can find the ``build_target`` of your device in the :ref:`hw_requirements_development_kit` section. + + For example, if you are using the nRF5340 DK and `X-NUCLEO-NFC09A1`_, the command is: + + .. code-block:: bash + + west build -p -b nrf5340dk/nrf5340/cpuapp app + + If you are using the nRF54L15 DK and `X-NUCLEO-NFC08A1`_, the command is: + + .. code-block:: bash + + west build -p -b nrf54l15dk/nrf54l15/cpuapp app -- -DCONFIG_ST25R3916B_DRV=y + + If you are using the nRF52840 DK and `X-NUCLEO-NFC05A1`_, the command is: + + .. code-block:: bash + + west build -p -b nrf52840dk/nrf52840 app -- -DCONFIG_ST25R3911_DRV=y #. Once you have built the application, run the following command to flash it: @@ -42,19 +62,7 @@ To build and run the application on the `nRF54L15 DK`_, complete the following s .. code-block:: console - *** Booting My Application v0.1.0-619a3021dd37 *** - *** Using nRF Connect SDK v2.9.99-2116d9135090 *** - *** Using Zephyr OS v3.7.99-a2eaddb4bcbb *** - I: - @@@ @@@@ - @@@@@@@@@@@@ @@@ - @@@@@ @@@@@ @@@@ @@ @@@ @@ @@ @@@@ - @@@@ @@@@ @@@@ @@@@@@ @@@ @@ @@@@@ @@@ @@@@ - @@@@ @@ @@@ @@@ @@@ @@@ @@ @@@ @@@ @@@ - @@@ @@@@@ @@@ @@@ @@@ @@@ @@ @@ @@@ @@ - @@@ @@@@@@@@ @@@ @@@ @@@ @@@ @@ @@ @@@ @@ - @@@ @@@@ @@@@ @@@ @@@@ @@@ @@ @@ @@ @@@ - @@@ @@@@ @@@@ @@@@@@@@@@@ @@@@@ @@ @@ @@@@@@@@@ - @@@@ @@@@ @@@@ - @@ @@@@ @@ - ... + *** Booting My Application v0.1.0-f0e5cf444fb0 *** + *** Using nRF Connect SDK v2.9.0-7787b2649840 *** + *** Using Zephyr OS v3.7.99-1f8f3dc29142 *** + [00:00:00.009,613] door_lock_app: Starting nRF Door Lock Reference Application for the nRF Connect SDK diff --git a/docs/door_lock_app_arch.rst b/docs/door_lock_app_arch.rst index 0d85828c..60c67f2d 100644 --- a/docs/door_lock_app_arch.rst +++ b/docs/door_lock_app_arch.rst @@ -3,7 +3,7 @@ |APP_NAME| architecture ####################### -The |APP_NAME| runs on the nRF54L15 SoC and utilizes the Aliro stack for access protocol and communication with user device over Near Field Communication (NFC) or Bluetooth® LE. +The |APP_NAME| runs on the Nordic Semiconductor's :ref:`supported SoCs ` and utilizes the Aliro stack for access protocol and communication with user device over Near Field Communication (NFC) or Bluetooth® LE. See the following diagram for an architecture overview: .. _arch_overview: diff --git a/docs/hardware_requirements.rst b/docs/hardware_requirements.rst index 16f7c0a9..db37c83f 100644 --- a/docs/hardware_requirements.rst +++ b/docs/hardware_requirements.rst @@ -23,11 +23,19 @@ The application supports the following development kit (DK): - PCA10156 - `nrf54l15dk`_ - ``nrf54l15dk/nrf54l15/cpuapp`` + * - `nRF5340 DK`_ + - PCA10095 + - `nrf5340dk`_ + - ``nrf5340dk/nrf5340/cpuapp`` + * - `nRF52840 DK`_ + - PCA10056 + - `nrf52840dk`_ + - ``nrf52840dk/nrf52840`` .. _hw_requirements_vddio_configuration: -Configuring VDDIO voltage -========================= +Configuring VDDIO voltage on the nRF54L15 DK +============================================ The nRF54L15 DK operates at default voltage level of 1.8V. Some expansion boards, especially Arduino-style boards, require higher voltage to operate properly. @@ -65,7 +73,7 @@ The application supports the following NFC readers and their corresponding devel The `X-NUCLEO-NFC09A1`_ board requires a minimum of 2.7V to operate. Because of that, you must adjust the GPIO voltage for the `nRF54L15 DK`_ as outlined in the :ref:`hw_requirements_vddio_configuration` section. -The DK does not have Arduino-compatible header, therefore, you must connect your board using wires. +The `nRF54L15 DK`_ does not have Arduino-compatible header, therefore, you must connect your board using wires. To connect the NFC reader expansion board to the `nRF54L15 DK`_, refer to the following pin mapping. The pinout is applicable for each of the supported NFC reader expansion boards: @@ -95,6 +103,8 @@ The pinout is applicable for each of the supported NFC reader expansion boards: X-NUCLEO expansion board connection to the nRF54L15 DK. +When using the `nRF5340 DK`_ or `nRF52840 DK`_, you can connect the NFC reader expansion board directly using the Arduino-compatible header available on the DK. + .. _hw_requirements_test_harness: Test harness hardware diff --git a/docs/images/door_lock_app_arch.svg b/docs/images/door_lock_app_arch.svg index 1692cd80..915f1a19 100644 --- a/docs/images/door_lock_app_arch.svg +++ b/docs/images/door_lock_app_arch.svg @@ -1,6 +1,6 @@ - + @@ -12,22 +12,22 @@