From d561e98f785405ff6c08f21709c45b1700cc44f4 Mon Sep 17 00:00:00 2001 From: Yassine El Aissaoui Date: Tue, 24 Sep 2024 15:03:25 +0200 Subject: [PATCH] boards: frdm_mcxw71: Add BLE info to doc + Enable second UART instance - Add second UART needed for bt_tester app. - Update doc with BLE info Signed-off-by: Yassine El Aissaoui --- boards/nxp/frdm_mcxw71/doc/index.rst | 49 +++++++++++++++++++ .../nxp/frdm_mcxw71/frdm_mcxw71-pinctrl.dtsi | 8 +++ boards/nxp/frdm_mcxw71/frdm_mcxw71.dts | 8 +++ 3 files changed, 65 insertions(+) diff --git a/boards/nxp/frdm_mcxw71/doc/index.rst b/boards/nxp/frdm_mcxw71/doc/index.rst index d9f3fb5647132d0..7c842d972ffaf75 100644 --- a/boards/nxp/frdm_mcxw71/doc/index.rst +++ b/boards/nxp/frdm_mcxw71/doc/index.rst @@ -63,7 +63,18 @@ The ``frdm_mcxw71`` board target in Zephyr currently supports the following feat +-----------+------------+-------------------------------------+ | LPTMR | on-chip | counter | +-----------+------------+-------------------------------------+ +| BLE | on-chip | Bluetooth | ++-----------+------------+-------------------------------------+ + +Fetch Binary Blobs +****************** + +To support Bluetooth, frdm_mcxw71 requires fetching binary blobs, which can be +achieved by running the following command: + +.. code-block:: console + west blobs fetch hal_nxp Programming and Debugging ************************* @@ -140,6 +151,44 @@ should see the following message in the terminal: *** Booting Zephyr OS build v3.7.0-xxx-xxxx *** Hello World! frdm_mcxw71/mcxw716c +Bluetooth +========= + +BLE functionality requires to fetch binary blobs, so make sure to follow +the ``Fetch Binary Blobs`` section first. + +Two images must be written to the board: one for the host (CM33) and one for the NBU (CM3). +- To flash the application (CM33) refer to the ``Flashing`` section above. +- To flash the NBU, follow the instructions below: + + * Install ``blhost`` from NXP's website. This is the tool that will allow you to flash the NBU. + * Enter ISP mode. To boot the MCU in ISP mode, follow these steps: + - Disconnect the ``FRDM-MCXW71`` board from all power sources. + - Keep the ``SW3`` (ISP) button on the board pressed, while connecting the board to the host computer USB port. + - Release the ``SW3`` (ISP) button. The MCXW71 MCU boots in ISP mode. + - Reconnect any external power supply, if needed. + * Use the following command to flash NBU file: + +.. code-block:: console + + # On Windows + blhost.exe -p COMxx -- receive-sb-file mcxw71_nbu_ble.sb3 + + # On Linux + ./blhost -p /dev/ttyxx -- receive-sb-file mcxw71_nbu_ble.sb3 + +Please consider changing ``COMxx`` on Windows or ``ttyxx`` on Linux to the serial port used by your board. + +The NBU file can be found in : ``/modules/hal/nxp/zephyr/blobs/mcxw71/mcxw71_nbu_ble.sb3`` + +For more details: + +.. _MCXW71 In-System Programming Utility: + https://docs.nxp.com/bundle/AN14427/page/topics/introduction.html + +.. _blhost Website: + https://www.nxp.com/search?keyword=blhost&start=0 + References ********** diff --git a/boards/nxp/frdm_mcxw71/frdm_mcxw71-pinctrl.dtsi b/boards/nxp/frdm_mcxw71/frdm_mcxw71-pinctrl.dtsi index e40a6e6c9141ff0..59b56312aff84ea 100644 --- a/boards/nxp/frdm_mcxw71/frdm_mcxw71-pinctrl.dtsi +++ b/boards/nxp/frdm_mcxw71/frdm_mcxw71-pinctrl.dtsi @@ -6,6 +6,14 @@ #include &pinctrl { + pinmux_lpuart0: pinmux_lpuart0 { + group0 { + pinmux = , ; + drive-strength = "low"; + slew-rate = "fast"; + }; + }; + pinmux_lpuart1: pinmux_lpuart1 { group0 { pinmux = , ; diff --git a/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts b/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts index 9b1fb021f0eef7d..025c549643fe788 100644 --- a/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts +++ b/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts @@ -25,6 +25,7 @@ zephyr,sram = &stcm0; zephyr,console = &lpuart1; zephyr,shell-uart = &lpuart1; + zephyr,uart-pipe = &lpuart0; }; user_led { @@ -52,6 +53,13 @@ status = "okay"; }; +&lpuart0 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&pinmux_lpuart0>; + pinctrl-names = "default"; +}; + &lpuart1 { current-speed = <115200>; status = "okay";