Wireless Connectivity Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Wireless Connectivity Knowledge Base

Discussions

Sort by:
Sniffing is the process of capturing any information from the surrounding environment. In this process, addressing or any other information is ignored, and no interpretation is given to the received data. Freescale provides both means and hardware to create devices capable of performing this kind of operation. For example, a KW01 board can be easily turned into a Sub-GHz sniffer using Test Tool 12.2.0 which can be found at https://www.freescale.com/webapp/sps/download/license.jsp?colCode=TESTTOOL_SETUP&appType=file2&location=null&DOWNLOAD_ID=null After downloading and installing Test Tool 12.2.0 there are several easy steps to create your own sniffer for Sub-GHz bands. 1) How to download the sniffer image file onto KW01.      a) Connect KW01 to PC using the mini-usb cable      b) Connect the J-Link to the PC      c) Open Test Tool 12.2 and go to the Firmware Loaders tab      d) Select Kinetis Firmware Loader. A new tab will pop-up.      e) J-Link will appear under the J-Link devices tab.      f) Select the KW01Z128_Sniffer.srec file and press the upload button.     g) From the Development Board Option menu select KW01Z128.      h) Follow the on-screen instruction and unplug the board. Then plug it back in.      i) Close the Kinetis Firmware Loader tab and open the Protocol Analyzer Tab 2) How to use the Protocol Analyzer feature. Basics.     a) The Protocol Analyzer should automatically detect the KW01 sniffer. If not, close the tab, unplug the board, plug it back and re-open the tab. If this doesn’t work, try restarting Test Tool.     b) To start “sniffing” the desired channel, click the arrow down button from Devices: KW01 (COMx) Off and select the desired mode and channel.     c) The tab will change to ON meaning that KW01 will "sniff" on the specified channel. To select another channel, click the tab again and it will switch back to Off. Then select a new channel.      d) Regarding other configurations, please note that you can specify what decoding will be applied to the received data. Additional information: The sniffer image found in Test Tool is compiled for the 920-928MHz frequency band. Because of this, the present document will have attached to it two sniffer images, for the 863-870MHz and the 902-928MHz frequency bands. To upload a custom image perform the steps described at the beginning of this document, but instead of selecting a *.srec file from the list in Kinetis Firmware Loader click the Browse button and locate the file on disk. After selecting it, redo the steps for uploading an image file. A potential outcome: sometimes, if you load a different frequency band sniffer image, the Protocol Analyzer will display the previously used frequency band. To fix this, close Test Tool, re-open it and go to the Protocol Analyzer tab again. The new frequency band should be displayed. More information on this topic can be found in Test Tool User Guide (..\Freescale\Test Tool 12\Documentation\TTUG.pdf), under Chapter 5 (Protocol Analyzer, page 87).
View full article
The FRDM-KW36 comes with the OpenSDA circuit which allows users to program and debug the evaluation board. There are different solutions to support such OpenSDA circuits: 1. The J-Link (SEGGER) firmware.  2. The CMSIS-DAP (mbed) firmware. The FRDM-KW36 comes pre-programmed with the CMSIS-DAP firmware. However, if you want to update the firmware version, you need to perform the next steps.  Press and hold the Reset button (SW1 push button in the board).  Unplug and plug the FRDM-KW36 again to the PC.  The board will be enumerated as "DAPLINKBOOT" device. Drag and drop the binary file to update the OpenSDA firmware.  If the J-Link version is programmed, the board will be enumerated as "FRDM-KW36J". On the other hand, if the CMSIS-DAP version is programmed, the board will be enumerated as "FRDM-KW36". The binary for the J-link version can be downloaded from the next link: SEGGER - The Embedded Experts - Downloads - J-Link / J-Trace  The binary for the CMSIS-DAP version can be found in the next link: OpenSDA Serial and Debug Adapter|NXP    Hope this helps... 
View full article
This patch fix the issue in hdmi dongle JB4.2.2_1.1.0-GA release that wifi((STA+P2P)/AP) cann't be enabled properly. In the root directory of Android Source Code, use the following command to apply the patch: $ git apply hdmi_dongle_wifi_jb4.2.2_1.1.0.patch
View full article
Bluetooth Low Energy, through the Generic Attribute Profile (GATT), supports various ways to send and receive data between clients and servers. Data can be transmitted through indications, notifications, write requests and read requests. Data can also be transmitted through the Generic Access Profile (GAP) by using broadcasts. Here however, I'll focus on write and read requests. Write and read requests are made by a client to a server, to ask for data (read request) or to send data (write request). In these cases, the client first makes the request, and the server then responds, by either acknowledging the write request (and thus, writing the data) or by sending back the value requested by the client. To be able to make write and read requests, we must first understand how BLE handles the data it transmits. To transmit data back and forth between devices, BLE uses the GATT protocol. The GATT protocol handles data using a GATT database. A GATT database implements profiles, and each profile is made from a collection of services. These services each contain one or more characteristics. A BLE characteristic is made of attributes. These attributes constitute the data itself, and the handle to reference, access or modify said data. To have a characteristic that is able to be both written and read, it must be first created. This is done precisely in the GATT database file ( gatt_db.h 😞 /* gatt_db.h */ /* Custom service*/ PRIMARY_SERVICE_UUID128(service_custom, uuid_custom_service)     /* Custom characteristic with read and write properties */     CHARACTERISTIC_UUID128(char_custom, uuid_custom_char, (gGattCharPropRead_c | gGattCharPropWrite_c))         /* Custom length attribute with read and write permissions*/         VALUE_UUID128_VARLEN(value_custom, uuid_custom_char, (gPermissionFlagReadable_c | gPermissionFlagWritable_c), 50, 1, 0x00) The custom UUIDs are defined in the gatt_uuid128.h file: /* gatt_uuid128.h */ /* Custom 128 bit UUIDs*/ UUID128(uuid_custom_service, 0xE0, 0x1C, 0x4B, 0x5E, 0x1E, 0xEB, 0xA1, 0x5C, 0xEE, 0xF4, 0x5E, 0xBA, 0x00, 0x01, 0xFF, 0x01) UUID128(uuid_custom_char, 0xA1, 0xB2, 0xC3, 0xD4, 0xE5, 0xF6, 0x17, 0x28, 0x39, 0x4A, 0x5B, 0x6C, 0x7D, 0x8E, 0x9F, 0x00) With this custom characteristic, we can write and read a value of up to 50 bytes (as defined by the variable length value declared in the gatt_db.h file, see code above). Remember that you also need to implement the interface and functions for the service. For further information and guidance in how to make a custom profile, please refer to the BLE application developer's guide (BLEDAG.pdf, located in <KW40Z_connSw_install_dir>\ConnSw\doc\BLEADG.pdf. Once a connection has been made, and you've got two (or more) devices connected, read and write requests can be made. I'll first cover how to make a write and read request from the client side, then from the server side. Client To make a write request to a server, you'll need to have the handle for the characteristic you want to modify. This handle should be stored once the characteristic discovery is done. Obviously, you also need the data that is going to be written. The following function needs a pointer to the data and the size of the data. It also uses the handle to tell the server what characteristic is going to be written: static void SendWriteReq(uint8_t* data, uint8_t dataSize) {       gattCharacteristic_t characteristic;     characteristic.value.handle = charHandle;     // Previously stored characteristic handle     GattClient_WriteCharacteristicValue( mPeerInformation.deviceId, &characteristic,                                          dataSize, data, FALSE,                                          FALSE, FALSE, NULL); } uint8_t wdata[15] = {"Hello world!\r"}; uint8_t size = sizeof(wdata); SendWriteReq(wdata, size); The data is send with the GattClient_WriteCharacteristicValue() API. This function has various configurable parameters to establish how to send the data. The function's parameters are described with detail on the application developer's guide, but basically, you can determine whether you need or not a response for the server, whether the data is signed or not, etc. Whenever a client makes a read or write request to the server, there is a callback procedure triggered,  to which the program then goes. This callback function has to be registered though. You can register the client callback function using the App_RegisterGattClientProcedureCallback() API: App_RegisterGattClientProcedureCallback(gattClientProcedureCallback); void gattClientProcedureCallback ( deviceId_t deviceId,                                    gattProcedureType_t procedureType,                                    gattProcedureResult_t procedureResult,                                    bleResult_t error ) {   switch (procedureType)   {        /* ... */        case gGattProcWriteCharacteristicValue_c:             if (gGattProcSuccess_c == procedureResult)             {                  /* Continue */             }             else             {                  /* Handle error */             }             break;        /* ... */   } } Reading an attribute is somewhat similar to writing an attribute, you still need the handle for the characteristic, and a buffer in which to store the read value: #define size 17 static void SendReadReq(uint8_t* data, uint8_t dataSize) {     /* Memory has to be allocated for the characteristic because the        GattClient_ReadCharacteristicValue() API runs in a different task, so        it has a different stack. If memory were not allocated, the pointer to        the characteristic would point to junk. */     characteristic = MEM_BufferAlloc(sizeof(gattCharacteristic_t));     data = MEM_BufferAlloc(dataSize);         characteristic->value.handle = charHandle;     characteristic->value.paValue = data;     bleResult_t result = GattClient_ReadCharacteristicValue(mPeerInformation.deviceId, characteristic, dataSize); } uint8_t rdata[size];         SendReadReq(rdata, size); As mentioned before, a callback procedure is triggered whenever there is a write or read request. This is the same client callback procedure used for the write request, but the event generates a different procedure type: void gattClientProcedureCallback ( deviceId_t deviceId,                                    gattProcedureType_t procedureType,                                    gattProcedureResult_t procedureResult,                                    bleResult_t error ) {   switch (procedureType)   {        /* ... */        case gGattProcReadCharacteristicValue_c:             if (gGattProcSuccess_c == procedureResult)             {                  /* Read value length */                  PRINT(characteristic.value.valueLength);                  /* Read data */                  for (uint16_t j = 0; j < characteristic.value.valueLength; j++)                  {                       PRINT(characteristic.value.paValue[j]);                  }             }             else             {               /* Handle error */             }             break;       /* ... */   } } There are some other methods to read an attribute. For further information, refer to the application developer's guide chapter 5, section 5.1.4 Reading and Writing Characteristics. Server Naturally, every time there is a request to either read or write by a client, there must be a response from the server. Similar to the callback procedure from the client, with the server there is also a callback procedure triggered when the client makes a request. This callback function will handle both the write and read requests, but the procedure type changes. This function should also be registered using the  App_RegisterGattServerCallback() API. When there is a read request from a client, the server responds with the read status: App_RegisterGattServerCallback( gattServerProcedureCallback ); void gattServerProcedureCallback ( deviceId_t deviceId,                                    gattServerEvent_t* pServerEvent ) {     switch (pServerEvent->eventType)     {         /* ... */         case gEvtAttributeRead_c:             GattServer_SendAttributeReadStatus(deviceId, value_custom, gAttErrCodeNoError_c);                             break;         /* ... */     } } When there is a write request however, the server should write the received data in the corresponding attribute in the GATT database. To do this, the function GattDb_WriteAttribute() can be used: void gattServerProcedureCallback ( deviceId_t deviceId,                                    gattServerEvent_t* pServerEvent ) {     switch (pServerEvent->eventType)     {         /* ... */         case gEvtAttributeWritten_c:             if (pServerEvent->eventData.attributeWrittenEvent.handle == value_custom)             {                 GattDb_WriteAttribute( pServerEvent->eventData.attributeWrittenEvent.handle,                                        pServerEvent->eventData.attributeWrittenEvent.cValueLength,                                        pServerEvent->eventData.attributeWrittenEvent.aValue );                              GattServer_SendAttributeWrittenStatus(deviceId, value_custom, gAttErrCodeNoError_c);             }             break;         /* ... */     } } If you do not register the server callback function, the attribute can still be written in the GATT database (it is actually done automatically), however, if you want something else to happen when you receive a request (turning on a LED, for example), you will need the server callback procedure.
View full article
This document describes how to update and sniff Bluetooth LE wireless applications on the USB-KW41 Programming the USB-KW41 as sniffer   It was noticed that there are some issues trying to follow a Bluetooth LE connection, even if the sniffer catches the connection request. These issues have been fixed in the latest binary file which can be found in the Test Tool for Connectivity Products 12.8.0.0 or newest.   After the Test Tool Installation, you’ll find the sniffer binary file at the following path. C:\NXP\Test Tool 12.8.1.0\images\KW41_802.15.4_SnifferOnUSB.bin   Programming Process. 1. Connect the USB-KW41Z to your PC, and it will be enumerated as Mass Storage Device 2. Drag and drop the "KW41_802.15.4_SnifferOnUSB.bin" included in Test tool for Connectivity Products.    "C:\NXP\Test Tool 12.8.0.0\images\KW41_802.15.4_SnifferOnUSB.bin"   3. Unplug the device and hold the RESET button of the USB-KW41Z, plug to your PC and the K22 will enter in bootloader mode. 4. Drag and drop the "sniffer_usbkw41z_k22f_0x8000.bin" included in Test tool for Connectivity Products.    "C:\NXP\Test Tool 12.8.5.9\images\sniffer_usbkw41z_k22f_0x8000.bin"   5. Then, unplug and plug the USB-KW41Z to your PC.                                                                                                          Note: If the USB-KW41 is not enumerated as Mass Storage Device, please look at the next thread https://community.nxp.com/thread/444708   General Recommendations   Software Tools  Kinetis Protocol Analyzer Wireshark version (2.4.8) Hardware Tools 1 USB-KW41 (updated with KW41_802.15.4_SnifferOnUSB.bin from Test Tool 12.8 or later)   The Kinetis Protocol Analyzer provides the ability to monitor the Bluetooth LE Advertisement Channels. It listens to all the activity and follows the connection when capturing a Connection Request.   Bluetooth LE Peripheral device transmits packets on the 3 advertising channels one after the other, so the USB-KW41 will listen to the 3 channels one by one and could or not catch the connection request.   Common use case The USB-KW41 will follow the Bluetooth LE connection if the connection request happens on the same channel that It is listening. If is listening to a different channel when the connection request is sent, it won't be able to follow it.   A Simple recommendation is the Bluetooth LE Peripheral should be set up to send the adv packets only to one channel and the sniffer just capturing on the same channel.   Improvement Use 3 USB-KW41, each of them will be dedicated to one channel and will catch the connection request.   Configure Kinetis Protocol Analyzer and Wireshark Network Analyzer   Note: For better results, address filter can be activated. When you are capturing all the packets in the air, you will notice 3 adv packets. Each packet will show the adv channel that is getting the adv frame.       One of the three sniffers will capture the Connection Request. In this case, it happens on channel 38.       You will be able to follow the connection, see all the data exchange.   For a better reference, you can look at the USB-KW41 Getting Started     Hope it helps   Regards, Mario
View full article
KW43 uses dual Arm Core ‘CM33’ and supports multiple interfaces and security features. One instance of the Arm core is used for System use and other one is for Radio/Wireless applications and shared single 1.5MB FLASH for program execution. Pin-to-pin compatibility with KW47/KW45: Please refer to the sildes attached below for the pin-to-pin compatibility, thanks.  
View full article
NXP wireless solutions build upon decades of Wi-Fi, Bluetooth®, multiprotocol silicon, software and system design expertise, including 802.15.4 in the latest tri-radio architectures. NXP is committed to driving large-scale deployment across multiple markets by a broad array of power- and cost-optimized Wi-Fi, Bluetooth and 802.15.4 transceivers, enabling products with advanced Wi-Fi and multiradio capabilities including Wi-Fi 4, Wi-Fi 5 and Wi-Fi 6 chips.   Markets Product Wi-Fi Spec Wi-Fi Support IoT IW623 802.11ax (Wi-Fi 6E) 2x2 Tri-band (2.4G/5/76 GHz) + 1x1 Single Band (2.4 GHz) IoT IW693 802.11ax (Wi-Fi 6/6E) CDW 2x2 Dual Band (5-7 GHz) + 1x1 Single Band (2.4 GHz) IoT IW610 802.11ax (Wi-Fi 6) 1x1 DB (2.4/5 GHz) IoT IW612 802.11ax (Wi-Fi 6) 1x1 DB (2.4/5 GHz) IoT IW611 802.11ax (Wi-Fi 6) 1x1 DB (2.4/5 GHz) IoT IW620 802.11ax (Wi-Fi 6) 2x2 DB (2.4/5 GHz) IoT IW416 802.11n (Wi-Fi 4) 1x1 DB (2.4/5 GHz) Wireless MCU Hostless RW612 802.11ax (Wi-Fi 6) 1x1 DB (2.4/5 GHz) Wireless MCU Hostless RW610 802.11ax (Wi-Fi 6) 1x1 DB (2.4/5 GHz) Automotive AW692 802.11ax (Wi-Fi 6) 2x2 + 1x1 CDW DB (2.4/5GHz + 2.4Ghz) Automotive AW693 802.11ax (Wi-Fi 6E) 2x2 + 1x1 CDW TB (2.4/5/6Ghz + 2.4Ghz) Automotive AW611 802.11ax (Wi-Fi 6) 1x1 DB (2.4/5 GHz) Automotive AW690 802.11ax (Wi-Fi 6) 1x1 CDW DB (2.4/5 GHz)   Wireless Module Partners Leading wireless connectivity solution providers offer NXP wireless modules in their wireless connectivity solutions. Module manufacturers develop Wi-Fi modules using NXP’s broad portfolio of Wi-Fi chips (system-on-chip (SoC)), including Wi-Fi 6 chips, Wi-Fi and Bluetooth® combo integrated circuits (ICs) and tri-radio SoCs with 802.15.4. NXP enables a broad range of wireless applications with an ecosystem of wireless module partners.   Why Use a Module Vendor? Accelerate time-to-market Avoid the complexity of RF design and testing Ensure regulatory compliance more easily (e.g. FCC, CE, ISED) Focus on the host product’s functionality while relying on the vendor for wireless performance   Useful Links Wi-Fi Basic concepts: This post provides information about the different terms used in Wi-Fi, 802.11 standards and the three types of 802.11 MAC frames. Wi-Fi Security Concepts: This post covers the security and authentication processes  Wi-Fi Connection/Disconnection process: In 802.11 standards, the connection procedure includes three major steps that shall be performed to make the device part of the Wi-Fi network and communicate in the network. Wi-Fi Software Drivers Locations: NXP Recommends using Wi-Fi source code drivers WiFi_BT_Integretation-(Linux_BSP_compilation_for_iMX_platform): This article describes how to compile the Linux BSP of the i.MX platform under ubuntu 18.04, 20.04 LTS and debian-10. This is a necessary step to integrate WIFI/BT to the I.MX platform. See the attachment for detailed steps. Enabling i.MX8MP-EVK uSDHC1 M.2 for Wi-Fi on Android-11.0.0_2.6.0: Detailed steps on enabling usdhc1 NXP Wi-Fi and Bluetooth Product:  The article will introduce how to build Wi-Fi Mass Market Driver Wi-Fi Firmware Automatic Recovery on RW61x: This article introduces the Wi-Fi automatic recovery feature as well as how to enable and verify it on RW61x SDK. Access Point Wi-Fi configuration on i.MX8 Family: This guide explains how to achieve that, using the i.MX8M Plus EVK (8MP) as the AP device and the i.MX8M Mini EVK (8MM) as the connected device. How to connect to a Wi-Fi network on i.MX8MP: this article guides you step by step how to connect to a Wi-Fi network NXP Wi-Fi/Bluetooth firmware on the i.MX8M series: steps to replace Wi-Fi/Bluetooth firmware on the i.MX8M series on Linux Training FRDM-iMX91 connectivity Wi-Fi Basic Hands-on FRDM-iMX91 connectivity Wi-Fi Bluetooth LE and OT COEX RW612/MCXW71 - Wi-Fi and thread border router Training FRDM-RW612 Getting Started, Wi-Fi CLI on VScode Community Support If you have questions regarding this training, please leave your comments in our Wireless MCU Community! here 
View full article
In modern embedded systems, precise and reliable clocking is fundamental to the correct operation of digital peripherals. Microcontrollers like NXP’s KW45 and MCXW71 rely on internal oscillators to provide timing references for peripherals such as UART, SPI, timers, and ADCs. One such oscillator is the 6 MHz Free Running Oscillator (FRO6M), which is commonly used as a default clock source. This article provides a comprehensive guide to: Selecting and configuring alternative clock sources Choosing an alternative clock source The KW45/MCXW71 microcontroller offers several alternatives, including the Free Running Osilator 192Mhz (FRO192), the RF_OSC , and external crystal oscillators. Each option has its own advantages: FRO192 is stable and available, and external oscillators provide long-term accuracy. The choice of clock source should be based on the peripheral’s timing requirements, power constraints, and the availability of the clock in the current operating mode. Reconfiguring Peripheral Clock Sources Reconfiguring a peripheral’s clock source in KW45 is straightforward using the SDK’s clock management APIs. The function CLOCK_SetIpSrc() allows developers to assign a new clock source to a specific peripheral. Example on changing a UART clocking from FRO6M to other clocksource. UART peripheral connected to FRO6M   uint32_t uartClkSrcFreq = BOARD_DEBUG_UART_CLK_FREQ; CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro6M); DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq);   For example, to switch a UART from FRO6M to FRO-192M, the following code can be used: //Replace kCLOCK_Lpuart1 for your peripheral for clicking CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro192M); Also in the example above we would have to set the  uint32_t uartClkSrcFreq  variable to the correct freq value corresponding to the FRO192M as it is being used as clock source, but the same logic applies to any other clock source for the peripheral.   Other clocking changes for modules can be done as shown in this examples: //Change clock source for LPIT 0 module from 6M FRO to other clocksources /* Iniital source for the LPIT module */ CLOCK_SetIpSrc(kCLOCK_Lpit0, kCLOCK_IpSrcFro6M); /* Set the new source for the LPIT 0 module */ CLOCK_SetIpSrc(kCLOCK_Lpit0, kCLOCK_IpSrcFro192M); /* Set the corresponding divider for application, need to be decided by developer*/ CLOCK_SetIpSrcDiv(kCLOCK_Lpit0, 15U); /* Set the source for the TPM 0 module */ CLOCK_SetIpSrc(kCLOCK_Tpm0, kCLOCK_IpSrcFro6M); /* Set the source for the TPM 0 module */ CLOCK_SetIpSrc(kCLOCK_Tpm0, kCLOCK_IpSrcFro192M); /* Set the corresponding divider for application, need to be decided by developer*/ CLOCK_SetIpSrcDiv(kCLOCK_Tpm0, 3U); //Change clock source for Luart 1 module from 6M FRO to other clocksources CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro6M); /* Set the source for the Lpuart 1 module */ CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro192M); uartClkSrcFreq = CLOCK_GetIpFreq(kCLOCK_Lpuart1); DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq); After changing the clock source, it is important to reinitialize the peripheral to ensure that timing parameters such as baud rate, prescaler, or sampling intervals are correctly recalculated. This step ensures that the peripheral operates reliably with the new clock configuration. Those were some examples on changing clock sources for some peripherals, but the same logic can be applied to any other module or peripheral, those examples were taken from SDK 2.16.00 as an example on how a module configured with a clock source can be switched to another.
View full article
See the necessary steps to enable additional SDK components for a project when using GitHub SDK and Kconfig/CMake.
View full article
Board pictures (KW47-M2) Connectors (KW47-M2) Part Identifier Connector Type Description J3 2x5 pin header SWD DNP J8 1x6 pin header UART1 – FTDI DNP J9 1x6 pin header Power connector DNP Jumpers (KW47-M2) Part Identifier Connector Type Description JP5 2x3 pin header supply power source selection jumper: 1-2 shorted (default configuration): Use this configuration to set target MCU in DCDC mode.  3-4 shorted: Use this configuration to set target MCU in LDO/Bypass mode. All MCU power domains are supplied by P3V3_DUT.  JP4 1x2 pin header Target MCU boot configuration enable jumper: • Open (default setting): ISP mode is disabled • Shorted: ISP mode is enabled Push Buttons (KW47-M2) Part Identifier Switch name Description SW1 Reset button Resets the target MCU. This causes peripherals to reset to their default state. After this, MCU ROM bootloader will be executed. LED D1 turns on at SW1 press. SW2 User PB General purpose input. This pin supports low-power wakeup capabilities through Wake-Up Unit (WUU). LEDs (KW47-M2) Part Identifier Switch name Description D1 Reset LED Indicates a system reset event. When reset is triggered—such as by pressing the SW1 reset button—the D1 LED turns ON. D2 Led Green User indicator, indicates system activity   Power Configurations (KW47-M2) Populate J9 PWR connector. To run KW47 M2 as standalone, supply 3.3V to P3V3_DUT power rail Figure 1 J9 M10 Configuration (KW47-M2)   To get the KW47 M2 up and running, you need to select a power configuration through JP5 jumper. For more information on KW47 power configurations, refer to RM: Part Identifier pin Description JP5 1-2 1-2 shorted (default setting): Sets target MCU to DCDC mode. This mode is the recommended configuration. JP5 3-4 3-4 shorted: Sets target MCU to LDO mode.     External power configuration (KW47-M2) Enable KW47-M2 by supplying power through J9 connector: Note: When using DCDC or LDO mode, it is recommended to supply P3V3_DUT power rail only. Part Identifier pin Description J9 5 Use this pin to supply P3V3_DUT power rail with 3.3V. To get KW47-M2 up and running, it is recommended to set KW47 to DCDC mode and supply P3V3_DUT only. J9 3 Use this pin to supply P1V8_LDO power rail with 1.8V. This power rail is intended for an accurate control of VDD_RF power domain, but it is not necessary. J9 1 Use this pin to supply P1V1_EXT power rail with 1.1V. This power rail is intended for an accurate control of VDD_CORE power domain, but it is not necessary.   Installing LinkServer software in your PC To program the KW47-M2 for the first time, you will need to download the LinkServer software and follow the following steps to install it on your PC. Download the installer for LinkServer distributed via nxp.com. Run the LinkServer installer. Accept the license agreement by clicking on the checkbox in red. Then click the “Next >” button. See the picture below.   Click “Next >” in the following installation steps that refer to the destination folder where the software will be installed. The following window summarizes the installation information. Click the “Install” button to start the installer.     Once the Link Server software has been installed successfully, you can close the installer by clicking the “Finish” button.   Programming the NBU in the KW47-M2 board The following steps guide you to program the NBU software for the KW47-M2 Place a jumper in the JP4 header while holding pressed the reset SW on the module board, attach the USB connector J8 (FTDI connector) to your computer. Then, release the reset SW after you plugged the USB cable on your computer.   Verify what COM Port was assigned to your KW47-M2 board. You can check the COM Port assigned in the Windows “Device Manager” program. Search for “Ports (COM & LPT)” and save the COM Port number. In this example the COM Port assigned was “COM19”   Navigate to your computer to the MCU-Link installation folder. The default installation path is located at “C:\nxp\LinkServer_25.3.31\MCU-LINK_installer Locate the “bin” folder and open it. Run the script “blhost” within a windows command prompt.   Type “blhost.exe -p COMX write-memory 0x48800000”, drag and drop the NBU binary file. When the process is ready you will see the response status "success"  
View full article
Hello, Starting with SDK version 24.12.00, documentation is available online at: https://mcuxpresso.nxp.com/mcuxsdk/latest/html/index.html  To view documentation for previous releases, replace latest in the URL with the specific version number: - example: https://mcuxpresso.nxp.com/mcuxsdk/25.03.00/html/index.html    Bluetooth LE Documentation For Bluetooth LE-related resources, refer to the following sections:  Bluetooth LE Host Documentation (change log and guides): https://mcuxpresso.nxp.com/mcuxsdk/latest/html/middleware/wireless/bluetooth/index.html    Connectivity Framework Documentation(change log and guides):  https://mcuxpresso.nxp.com/mcuxsdk/latest/html/middleware/wireless/framework/index.html   Release Notes by platform To view what's new for each platform, refer to the "What is new" section in the respective release notes: KW45 - EVK:  https://mcuxpresso.nxp.com/mcuxsdk/latest/html/boards/Wireless/kw45b41zevk/releaseNotes/rnindex.html   KW47-EVK:  https://mcuxpresso.nxp.com/mcuxsdk/latest/html/boards/Wireless/kw47evk/releaseNotes/rnindex.html FRDM-MCXW23:  https://mcuxpresso.nxp.com/mcuxsdk/latest/html/boards/MCX/frdmmcxw23/releaseNotes/rnindex.html  Regards, Ovidiu    
View full article
Hello,  Here are some helpful steps to follow when working with the NXP GitHub SDK. Step1: Ensure the necessary toolchains are installed:  https://mcuxpresso.nxp.com/mcuxsdk/latest/html/gsd/repo.html  Additional notes and links: VS code: https://code.visualstudio.com/ MCUXpresso plugin: https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-for-visual-studio-code:MCUXPRESSO-VSC Getting started with MCUXpresso for VS Code: https://www.nxp.com/design/design-center/training/TIP-GETTING-STARTED-WITH-MCUXPRESSO-FOR-VS-CODE   Step 2: Download and Install the SDK: GUI Method: - Open VS Code, navigate to Import Repository and select the Remote option as shown below: - Upon successful import, the repository will show up in the Imported Repositories window:    Command Line Method: - west commands: # Initialize west with the manifest repository west init -m https://github.com/nxp-mcuxpresso/mcuxsdk-manifests/ mcuxpresso-sdk # Update the west projects cd mcuxpresso-sdk west update More details:  https://mcuxpresso.nxp.com/mcuxsdk/latest/html/gsd/installation.html#get-mcuxpresso-sdk-repo  - import the local repository to VS code: Open VS Code, navigate to Import Repository and select the Local option and Browse.. to your local repo:   Step3: Run a Bluetooth LE Example Step3a: Run a Bluetooth LE Example using MCUXpresso for VS code - click Import Example from Repository from the QuickStart Panel - From the open dialog, select the MCUXpresso SDK, the Arm GNU toolchain, your target board, desired template, and application type, and proceed by clicking Import:   For the application type, you’ll typically see two options:  - Repository application  - Freestanding application. The key difference lies in where the project is imported. Repository applications are placed within the MCUXpresso SDK directory, while Freestanding applications can be imported to a custom location defined by the user. - Next, VS Code will prompt you to verify trust for the imported files—click Yes. Navigate to the PROJECTS view. - Identify your project, right click and select the Prestine Build icon to begin building:  - details of the build are into the terminal window: - using Debug button will allow you to download and debug the software:   (useful link: https://mcuxpresso.nxp.com/mcuxsdk/latest/html/gsd/run_a_demo_using_mcuxvsc.html ) Step3b: Run a Bluetooth LE Example using IAR Embedded Workbench for ARM: - use the west list_projects command to list the supported example for boards and the corresponding toolchain: Example to list Bluetooth examples:  west list_project -p .\examples\wireless_examples\bluetooth\ or if you know the platform or/and the project you can use: west list_project -b kw45b41zevk -p .\examples\wireless_examples\bluetooth\w_uart  west list_project -b frdmmcxw23 -p .\examples\wireless_examples\bluetooth\w_uart   Once you've confirmed that the project is available for the IAR toolchain, run the appropriate command to build it: west build -p always examples/wireless_examples/bluetooth/w_uart/freertos --toolchain iar --config debug -b kw45b41zevk The build folder will contain the generated output:   To work with IDE add  -t guiproject in the west command: west build -p always examples/wireless_examples/bluetooth/w_uart/freertos --toolchain iar --config debug -b kw45b41zevk -t guiproject --pristine --build-dir=build/w_uart_freertos_kw45    The result of the build will indicate the path to the *.eww/*.ewp:   (additional details: https://mcuxpresso.nxp.com/mcuxsdk/latest/html/gsd/run_project.html )   Step4: Create a standalone example With the freestanding project approach, only the application code is included in the export folder. Other essential files remain linked to the repository. To generate a complete standalone project, the recommended method is using West by adding -t standalone_project option. Example of command for kw45b41zevk, IAR toolchain: west build -b kw45b41zevk ./examples/wireless_examples/bluetooth/w_uart/freertos -p always --toolchain iar --config debug -t standalone_project -d c:\work\w_uart_kw45  The result of the build will indicate the path to the *.eww/*.ewp:   Example of command for kw45b41zevk, armgcc toolchain: west build -b kw45b41zevk ./examples/wireless_examples/bluetooth/w_uart/freertos -p always --toolchain armgcc --config debug -t standalone_project -d c:\work\w_uart_KW45_armgcc The result of the build will indicate the path to the project that need to be imported in VsCode: Regards, Ovidiu  
View full article
Useful Links: Bluetooth Ranging Access Vehicle Enablement System - NXP Community
View full article
Blue Ravens (Bluetooth Ranging Access Vehicle Enablement System) is a system solution developed by NXP to assist customers in designing their own BLE-based car access solutions using NXP products. It is designed to support a variety of car access use cases through a modular approach. The main objective (but not limited) is to present all the capabilities and advantages of the Channel Sounding technology and NXP BLE Handover in an automotive use case. Channel Sounding is part of the new Bluetooth Low Energy (BLE) standard (BLE 6.0) as a highly accurate distance measurement solution, and available on the NXP KW47 chip. BLE Handover is an NXP proprietary feature developed by NXP to seamlessly transfer a BLE connection from one device to another, without disconnection, using and out of band channel (e.g. CAN). This transfer does not impact the peer device so interoperability is guaranteed. This feature can also be used to enable BLE connection RSSI sniffing to increase RSSI based system security. (KW45 & KW47) Thanks to its modularity, this system can be used to address multiple use-cases, from simple BLE connection system, up to a full BLE Channel Sounding positioning system. Please, note that Channel Sounding is only supported on KW47 chip. KW45 can only be used for simple BLE system. By default, the system on KW47 covers a basic use of Channel Sounding to measure the distance between one remote device (Digital Key) and alternatively several different fixed devices (Car Anchor). At each instant in time, only one anchor is connected to the Digital Key. The other anchors (not connected) can be set in Connection RSSI Sniffing mode (based on Handover). This mode increase the system security by accessing the RSSI value of a connection instead of an advertising packet. These RSSI values can be used to estimated which anchor can be used in the round-robin or to keep the best BLE link around the Car.     The system is composed of multiple KW4x boards, each with a specific role. On board is used as Digital Key, to be caried by the user, the other represent the Car sub-system. On this Car Sub-system, all boards are connected to each other using the CAN bus. The CAN bus fulfills the purpose to power all boards with 12V and to allow communication between the boards: Control Unit (KW4x EVK-Board) Car Anchors (KW4x LOC-Board) Digital Key (KW4x LOC-Board) Role: Central decision-making node Functionality: - Coordinates BLE anchors. - Triggers actions based on received data   Role: BLE devices connected to the Control Unit via CAN bus Functionality: - Advertise BLE presence. - Wait for a Digital Key to connect. - Act as CS initiators during the session. Role: Acts as the remote BLE device Functionality: - Scans for BLE anchors. - Initiates connection with a Car Anchor. - Once connected, behaves as a CS reflector.     A Desktop application is used to monitor the states and monitor the measurement done by the system:   Using the successive measurement on each anchors, the Car sub-system is able to estimate the Digital Key position (Disclaimer: this solution is not consider accurate in dynamic environments)       Features   BLE connection Supporting 1 connection only for now (multiple peer plan) BLE Channel Sounding (KW47 only) Yes RSSI Sniffing Yes – All not connected anchors Automatic exclusion of suboptimal anchors Yes BLE Handover with CS context (No CS repeat) Yes Trilateration algorithm Yes Measurement filtering (real time) Yes Detection area triggering action (e.g. Welcome zone) Yes Car Anchor CAN Synchronization (radio core sync) No (planned for next release) Channel Sounding Sniffing No (feasibility study ongoing)   KPIs   Number of Anchor From 2 to 8 Number of Digital Key 1 BLE Connection Interval 7.5ms – 4s (Default = 30ms) BLE Handover connection transfer time (+CS context transfer) <60ms (CI=30ms) <50ms (CI=10ms) CS start Delay (2+7)*CI CS measurement and data transfer (Real Time) <70ms (CI=30ms) CS Algo <30ms Full cycle time (CS + Handover) [Algorithm runs asynchronously on the anchor after the handover is finished] 390ms (CI=30ms) 190ms (CI=10ms) Line Of Sight CS measurement range 100m Max (at 10dBm) Back Pocket CS measurement range 10m (at 10dB)   This solution is under development and improvement will be added in the future releases.
View full article
As documented in the MCX W23 [ERRATA] for WLCSP packaged devices, Tx modulation quality can potentially be violated on 2 data channels
View full article
This article introduces the Wi-Fi automatic recovery feature as well as how to enable and verify it on RW61x SDK. 1. Introduction Wi-Fi automatic recovery is a NXP proprietary feature that monitors Wi-Fi running status and recovers Wi-Fi out of exception state when running into one of the following cases: Driver fails to wakeup Wi-Fi MCU for commands/Tx Driver fails to receive command response from Wi-Fi MCU Driver detects Wi-Fi firmware is in abnormal state Once Wi-Fi automatic recovery is triggered, Wi-Fi middleware and driver will clean up the running states, reset Wi-Fi MCU power, reload Wi-Fi firmware and restart Wi-Fi initialization. It will not impact the ongoing Bluetooth LE/802.15.4 activities. Figure 1 is the Wi-Fi software architecture. Figure 1: Wi-Fi Software Architecture Figure 2 shows the work flow of Wi-Fi automatic recovery: Figure 2: Wi-Fi Automatic Recovery Work Flow Wi-Fi driver detects command timeout/wakeup card timeout/FW exception   Wi-Fi driver triggers WLAN reset to Stop Wi-Fi activities and de-initialize Wi-Fi Reset Wi-Fi power Reload the Wi-Fi only firmware and wait for the firmware to be active Send an event to notify the application before resetting it   2. SDK Configuration The Wi-Fi automatic recovery feature is not enabled by default in RW61x SDK. It needs to be enabled explicitly: Add below line in <example>/source/wifi_config.h to enable the feature  #define CONFIG_WIFI_RECOVERY 1 Besides, please also make sure the "CONFIG_WIFI_RESET" macro is defined as "1" in the SDK.   3. Automatic Recovery Verification This section introduces how to verify the Wi-Fi automatic recovery feature on RW61x SDK. wifi_cli application is used as example here together with the RW612 RD board. Refer to UM11799: NXP Wi-Fi and Bluetooth Demo Applications for RW61x for steps to flash and run Wi-Fi applications. Below are the steps to verify the Wi-Fi automatic recovery feature: Step 1: Define CONFIG_WIFI_RECOVERY in wifi_cli/source/wifi_config.h     #define CONFIG_WIFI_RECOVERY 1 Step 2: Build and flash the wifi_cli application onto RW612 RD board Step 3: Connect RW612 RD board to a serial terminal Step 4: Reset the power of RW612 RD board Step 5: Trigger Wi-Fi MCU into hung-up state with the following command to mimic a command timeout     # wlan-recovery-test Step 6: Wi-Fi recovery background task detects Wi-Fi FW hang and starts recovery process [wifi] Warn: Command response timed out. command 0x8b, len 12, seqno 0x1c timeout happends. # app_cb: WLAN: FW hang Event: 14 --- Disable WiFi --- [wifi] Warn: Recovery in progress. command 0x10 skipped [wifi] Warn: Recovery in progress. command 0x10 skipped [wifi] Warn: Recovery in progress. command 0xaa skipped [dhcp] Warn: server not dhcpd_running. --- Enable WiFi --- Initialize WLAN Driver [wifi] Warn: WiFi recovery mode done! Wi-Fi cau temperature : 31 STA MAC Address: C0:95:DA:01:1D:A6 board_type: 2, board_type mapping: 0----QFN 1----CSP 2----BGA app_cb: WLAN initialized ======================================== WLAN CLIs are initialized ======================================== ENHANCED WLAN CLIs are initialized ======================================== HOST SLEEP CLIs are initialized ======================================== CLIs Available: ======================================== help clear wlan-version wlan-mac wlan-thread-info wlan-net-stats wlan-set-mac <MAC_Address> wlan-scan wlan-scan-opt ssid <ssid> bssid ... wlan-add <profile_name> ssid <ssid> bssid... wlan-remove <profile_name> wlan-list wlan-connect <profile_name> wlan-connect-opt <profile_name> ... wlan-reassociate wlan-start-network <profile_name> wlan-stop-network wlan-disconnect wlan-stat wlan-info wlan-address wlan-uap-disconnect-sta <mac address> wlan-get-uap-channel wlan-get-uap-sta-list wlan-ieee-ps <0/1> wlan-set-ps-cfg <null_pkt_interval> wlan-deep-sleep-ps <0/1> wlan-get-beacon-interval wlan-get-ps-cfg wlan-set-max-clients-count <max clients count> wlan-get-max-clients-count wlan-rts <sta/uap> <rts threshold> wlan-frag <sta/uap> <fragment threshold> wlan-host-11k-enable <0/1> wlan-host-11k-neighbor-req [ssid <ssid>] wlan-host-11v-bss-trans-query <0..16> wlan-mbo-enable <0/1> wlan-mbo-nonprefer-ch <ch0> <Preference0: 0/1/255> <ch1> <Preference1: 0/1/255> wlan-get-log <sta/uap> <ext> wlan-roaming <0/1> <rssi_threshold> wlan-multi-mef <ping/arp/multicast/del> [<action>] wlan-wakeup-condition <mef/wowlan wake_up_conds> wlan-auto-host-sleep <enable> <mode> <rtc_timer> <periodic> wlan-send-hostcmd wlan-ext-coex-uwb wlan-set-uap-hidden-ssid <0/1/2> wlan-eu-crypto-rc4 <EncDec> wlan-eu-crypto-aes-wrap <EncDec> wlan-eu-crypto-aes-ecb <EncDec> wlan-eu-crypto-ccmp-128 <EncDec> wlan-eu-crypto-ccmp-256 <EncDec> wlan-eu-crypto-gcmp-128 <EncDec> wlan-eu-crypto-gcmp-256 <EncDec> wlan-set-antcfg <ant_mode> <evaluate_time> <evaluate_mode> wlan-get-antcfg wlan-scan-channel-gap <channel_gap_value> wlan-wmm-stat <bss_type> wlan-reset wlan-set-regioncode <region-code> wlan-get-regioncode wlan-11d-enable <sta/uap> <0/1> wlan-uap-set-ecsa-cfg <block_tx> <oper_class> <new_channel> <switch_count> <bandwidth> wlan-csi-cfg wlan-set-csi-param-header <sta/uap> <csi_enable> <head_id> <tail_id> <chip_id> <band_config> <channel> <csi_monitor_enable> <ra4us> wlan-set-csi-filter <opt> <macaddr> <pkt_type> <type> <flag> wlan-txrx-histogram <action> <enable> wlan-subscribe-event <action> <type> <value> <freq> wlan-reg-access <type> <offset> [value] wlan-uapsd-enable <uapsd_enable> wlan-uapsd-qosinfo <qos_info> wlan-uapsd-sleep-period <sleep_period> wlan-tx-ampdu-prot-mode <mode> wlan-rssi-low-threshold <threshold_value> wlan-rx-abort-cfg wlan-set-rx-abort-cfg-ext enable <enable> margin <margin> ceil <ceil_thresh> floor <floor_thresh> wlan-get-rx-abort-cfg-ext wlan-cck-desense-cfg wlan-net-monitor-cfg wlan-set-monitor-filter <opt> <macaddr> wlan-set-monitor-param <action> <monitor_activity> <filter_flags> <radio_type> <chan_number> wlan-set-tsp-cfg <enable> <backoff> <highThreshold> <lowThreshold> <dutycycstep> <dutycycmin> <highthrtemp> <lowthrtemp> wlan-get-tsp-cfg wlan-get-signal wlan-set-bandcfg wlan-get-bandcfg wlan-set-ips <option> wlan-enable-disable-htc <option> wlan-set-su <0/1> wlan-set-forceRTS <0/1> wlan-set-mmsf <enable> <Density> <MMSF> wlan-get-mmsf wlan-set-multiple-dtim <value> wlan-set-country <country_code_str> wlan-set-country-ie-ignore <0/1> wlan-single-ant-duty-cycle <enable/disable> [<Ieee154Duration> <TotalDuration>] wlan-dual-ant-duty-cycle <enable/disable> [<Ieee154Duration> <TotalDuration> <Ieee154FarRangeDuration>] wlan-external-coex-pta enable <PTA/WCI-2/WCI-2 GPIO> ExtWifiBtArb <enable/disable> PolGrantPin <high/low> PriPtaInt <enable/disable> StateFromPta <state pin/ priority pin/ state input disable> SampTiming <Sample timing> InfoSampTiming <Sample timing> TrafficPrio <enable/disable> CoexHwIntWic <enable/disable> wlan-sta-inactivityto <n> <m> <l> [k] [j] wlan-get-temperature wlan-auto-null-tx <sta/uap> <start/stop> wlan-detect-ant <detect_mode> <ant_port_count> channel <channel> ... wlan-recovery-test wlan-get-channel-load <set/get> <duration> wlan-get-txpwrlimit <subband> wlan-set-chanlist wlan-get-chanlist wlan-set-txratecfg <sta/uap> <format> <index> <nss> <rate_setting> <autoTx_set> wlan-get-txratecfg <sta/uap> wlan-get-data-rate <sta/uap> wlan-get-pmfcfg wlan-uap-get-pmfcfg wlan-set-ed-mac-mode <interface> <ed_ctrl_2g> <ed_offset_2g> <ed_ctrl_5g> <ed_offset_5g> wlan-get-ed-mac-mode <interface> wlan-set-tx-omi <interface> <tx-omi> <tx-option> <num_data_pkts> wlan-set-toltime <value> wlan-set-rutxpwrlimit wlan-11ax-cfg <11ax_cfg> wlan-11ax-bcast-twt <dump/set/done> [<param_id> <param_data>] wlan-11ax-twt-setup <dump/set/done> [<param_id> <param_data>] wlan-11ax-twt-teardown <dump/set/done> [<param_id> <param_data>] wlan-11ax-twt-report wlan-get-tsfinfo <format-type> wlan-set-clocksync <mode> <role> <gpio_pin> <gpio_level> <pulse width> wlan-suspend <power mode> ping [-s <packet_size>] [-c <packet_count>] [-W <timeout in sec>] <ipv4/ipv6 address> iperf [-s|-c <host>|-a|-h] [options] dhcp-stat ======================================== --- Done --- Step 7: Run other Wi-Fi shell commands to confirm Wi-Fi resumes to normal state  
View full article
Introduction: Bluetooth Low Energy offers the ability to broadcast data in format of non-connectable advertising packets while not being in a connection. This GAP Advertisement is widely known as a beacon.   In this post we will explore some of the features of the beacon_freertos example included in the SDK package of the KW45B41Z Evaluation Kit for MCUXpresso, for updating a counter every 5 seconds and broadcasting its value with the beacon, so the user can see it using the IoT Toolbox application.    Setup: 1 – SDK installation Download the latest version of the KW45B41Z-EVK SDK package from MCUXpresso SDK Builder Drag and drop the SDK zip file into the Installed SDKs window:   2 – Importing the project In the QuickStart Panel, click on Import SDK example From wireless_examples, select beacon_freertos. It is recommended to select UART for Debug Console when using BLE projects.  Click on finish   App Customization  1 – app_preinclude.h file: Set the following definitions to "0" in order to disable Extended Advertising and Low Power functionality.   2 – app_advertiser.h file: Add these aux prototypes that will allow to get and set the value of some flags.   /*Functions for data exchanging with beacon application*/ bool_t GetBleAppStarted(void); bool_t GetmAdvertisingOn(void); void SetmAdvertisingOn(bool_t value);   3 – app_advertiser.c file: Include fsl_component_timer_manager.h Add the macro UPDATE_BEACON_TIMER (5) to set the update timer to 5 seconds Create a timer ID by using TIMER_MANAGER_HANDLE_DEFINE Declare the callback for the timer Declare and define the "flag" BleAppStarted Include extern variable gAppAdvertisingData   Define the aux functions that will allow to get and set the value of BleAppStarted and mAdvertisingOn flags.   Define the timer callback, which will add the value of the counter into "A" field of the Beacon packet. #include "fsl_component_timer_manager.h" #define UPDATE_BEACON_TIMER (5) //in seconds /*Create timer ID*/ static TIMER_MANAGER_HANDLE_DEFINE(BeaconUpdateDataTimerID); /*Callback prototype*/ static void UpdateBeaconTimerCallback(void * pParam); /*Define the variables*/ static bool_t BleAppStarted = FALSE; static bool_t mAdvertisingOn = FALSE; /*Declare variable as external*/ extern gapAdvertisingData_t gAppAdvertisingData; /*Define functions for data echange*/ bool_t GetBleAppStarted(void) { return BleAppStarted; } bool_t GetmAdvertisingOn(void) { return mAdvertisingOn; } void SetmAdvertisingOn(bool_t value) { mAdvertisingOn = value; } /*define the timer callback*/ static void UpdateBeaconTimerCallback(void * pParam) { /*Value that will be advertised*/ static int32_t count = 1; /* Stop ADV and handle the update on the callbacks*/ Gap_StopAdvertising(); mAdvertisingOn = !mAdvertisingOn; /* On ADV data 0-1 = company ID, 2 = Beacon ID, 3 -18 = UUID, /* 19-20: A Data, 21-22: B Data, 23-24: C Data */ gAppAdvertisingData.aAdStructures[1].aData[19] = (uint8_t)((count >> 8) & 0xFF); gAppAdvertisingData.aAdStructures[1].aData[20] = (uint8_t)(count & 0xFF); count++; }   Inside App_AdvertiserHandler function, gAdvertisingParametersSetupComplete_c event is triggered when the advertising parameters setup is complete. Here, Advertising Data is set, and we are going to use this event to start the timer. Once the Advertising Data Setup is complete, we are going to use gAdvertisingDataSetupComplete_c event in App_AdvertiserHandler function to start advertising and update the timer. Every time the Data Setup is complete, the timer will start again.  case gAdvertisingParametersSetupComplete_c: { (void)Gap_SetAdvertisingData(mpAdvParams->pGapAdvData, mpAdvParams->pScanResponseData); if (!BleAppStarted) { BleAppStarted = TRUE; /*Allocate timer*/ (void) TM_Open(BeaconUpdateDataTimerID); /* Start data update timer */ (void) TM_InstallCallback((timer_handle_t) BeaconUpdateDataTimerID, UpdateBeaconTimerCallback, NULL); (void) TM_Start((timer_handle_t) BeaconUpdateDataTimerID, (uint8_t) kTimerModeSingleShot | (uint8_t) kTimerModeLowPowerTimer, TmSecondsToMilliseconds(UPDATE_BEACON_TIMER)); } } break; case gAdvertisingDataSetupComplete_c: { (void) Gap_StartAdvertising(App_AdvertisingCallback, App_ConnectionCallback); /* Start data update timer */ (void) TM_InstallCallback((timer_handle_t) BeaconUpdateDataTimerID, UpdateBeaconTimerCallback, NULL); (void) TM_Start((timer_handle_t) BeaconUpdateDataTimerID, (uint8_t) kTimerModeSingleShot | (uint8_t) kTimerModeLowPowerTimer, TmSecondsToMilliseconds(UPDATE_BEACON_TIMER)); } break;   4 – beacon.c file:  Wrap the mAppExtAdvParams structure inside gBeaconAE_c definition macro to avoid problems with the declaration of the extended advertising parameters  #if defined(gBeaconAE_c) && (gBeaconAE_c) static appExtAdvertisingParams_t mAppExtAdvParams = { &gExtAdvParams, &gAppExtAdvertisingData, NULL, mBeaconExtHandleId_c, gBleExtAdvNoDuration_c, gBleExtAdvNoMaxEvents_c }; #endif /*gBeaconAE_c */   BleApp_AdvertisingCallback handles BLE Advertising callback from the host stack. Every time advertising state changes, we are going to update Advertising Data when the device is not advertising and BleApp has already started. Replace the existing content of gAdvertisingStateChanged_c event.  case gAdvertisingStateChanged_c: { /* update ADV data when is disabled */ if((!GetmAdvertisingOn()) && GetBleAppStarted()) { Gap_SetAdvertisingData(&gAppAdvertisingData, NULL); SetmAdvertisingOn(true); } if(GetmAdvertisingOn()) { Led1On(); } else { Led1Off(); #if defined(gBeaconAE_c) && (gBeaconAE_c) if(mAppTargetState == mAppState_ExtAdv_c) { if (gBleSuccess_c != BluetoothLEHost_StartExtAdvertising(&mAppExtAdvParams, BleApp_AdvertisingCallback, NULL)) { panic(0, 0, 0, 0); } } #endif } } break;   Testing the application: The IoT Toolbox is an all-in-one application that demonstrates NXP’s BLE functionalities, the implementation of BLE and custom profiles and the compatibility with different smartphones. This mobile application can be downloaded from the App Store and Google Play Store.  Please, refer to the IoT Toolbox Mobile Application User Manual for more information on features, requirements and how to install the application.  Select Beacons  Press scan Press the USERINTERFACE Button (carrier board) to start advertising  In the IoT Toolbox app, you should be able to see the counter increasing its value every 5 seconds in the field "A"
View full article
Using the Signal Frequency Analyzer (SFA) to Measure the FRO 6M Frequency Overview The Signal Frequency Analyzer (SFA) is a specialized hardware peripheral available in NXP’s KW45, MCXW71, KW47, and MCXW72 microcontrollers. It is designed to provide precise, real-time measurement and analysis of digital signal characteristics, including frequency, period, and timing intervals. This makes it a valuable tool for applications requiring accurate timing diagnostics, signal validation, and system debugging. By utilizing internal 32-bit counters and configurable trigger mechanisms, the SFA enables high-resolution capture of signal transitions, supporting robust system monitoring and fault detection. Functional Capabilities of the SFA The SFA module supports the following measurements: Clock signal frequency of a Clock Under Test (CUT) Clock signal period It operates using two 32-bit counters: One for the Reference Clock (REF) One for the Clock Under Test (CUT) Measurement is performed by comparing the counts of both clocks until predefined target values are reached. FRO 6M Frequency Failure Scenarios The 6 MHz Free Running Oscillator (FRO6M) may occasionally output an incorrect frequency under certain conditions: When the device exits reset When the device wakes from low-power modes To mitigate potential issues caused by incorrect FRO6M output, it is the application developer’s responsibility to verify the oscillator’s frequency and apply corrective measures as needed. Monitoring the FRO 6M Using the SFA To monitor the FRO6M signal, the following configuration is recommended: SFA Configuration Parameters Reference Clock (REF): CPU Clock (e.g., 96 MHz) Clock Under Test (CUT): FRO6M routed via CLKOUT Interrupt Mode: Enabled for asynchronous measurement completion Code Implementation The presented functions are meant to be implemented in users application, the inner functions are part of the implementations of the SFA driver from the NXP’s SDK. It can be used on MCXW71, MCXW72, KW45, kKW47, just make sure SFA Peripheral Initialization  void init_SFA_peripheral(void) { /* Enable SFA interrupt. */ EnableIRQ(SFA_IRQn); /* Set SFA interrupt priority. */ NVIC_SetPriority(SFA_IRQn, 1); SFA_Init(DEMO_SFA_BASEADDR); SFA_InstallCallback(DEMO_SFA_BASEADDR, EXAMPLE_SFA_CALLBACK); } SFA Callback Function void EXAMPLE_SFA_CALLBACK(status_t status) { if (status == kStatus_SFA_MeasurementCompleted) { SfaMeasureFinished = true; } sfa_callback_status = status; } Frequency Measurement Function This function sets up the measurement of the FRO6M signal using the CPU clock as the reference. uint8_t SFA_freq_measurement_6M_FRO(void) { uint8_t ratio = 0; uint32_t freq = 0UL; sfa_config_t config; CLOCK_SetClkOutSel(kClockClkoutSelSirc); //set clokout to SIRC SFA_GetDefaultConfig(&config); //Get SFA default config config.mode = kSFA_FrequencyMeasurement0; config.refSelect = kSFA_REFSelect1; //Set CPU clk as ref clk config.cutSelect = kSFA_CUTSelect1; //Set clkout as CUT config.refTarget = 0xFFFFFFUL; config.cutTarget = 0xFFFFUL; config.enableCUTPin = true; freq = get_ref_freq_value(CPU_CLK); SFA_SetMeasureConfig(DEMO_SFA_BASEADDR, &config); SFA_MeasureNonBlocking(DEMO_SFA_BASEADDR); while (1) { if (SfaMeasureFinished) { SfaMeasureFinished = false; if(kStatus_SFA_MeasurementCompleted == sfa_callback_status) { freq = SFA_CalculateFrequencyOrPeriod(DEMO_SFA_BASEADDR, freq);//Calculate the FRO freq if(FREQ_6MHZ + TOLERANCE <= freq ) { ratio = 1; } else { if(FREQ_3MHZ + TOLERANCE <= freq) { ratio = 2; } else { if(FREQ_2MHZ + TOLERANCE <= freq) { ratio = 3; } else { ratio = 4; } } } break; } } else { __WFI(); } } return ratio; } Result Interpretation and Usage To test the FRO 6M after adding the above functions the FRO can be tested after executing: init_SFA_peripheral(); SFA_freq_measurement_6M_FRO(); The measured FRO6M frequency is printed to the serial terminal for human-readable diagnostics. Developers can use this result to: Adapt peripheral clocking if the FRO6M frequency is incorrect Trigger corrective actions such as  switching to an alternate clock source Steps to Reconfigure Peripheral Clocking When FRO6M output frequency is lower Detect the Faulty FRO6M Output Use the SFA measurement as described earlier to determine if the FRO6M is operating below its expected frequency (6 MHz). If the result is significantly lower, proceed to reconfigure. Choose an Alternative Clock Source Most NXP MCUs offer multiple internal and external clock sources. Common alternatives include: FRO 192M OSC RF 32M Sys OSC RTC OSC Choose one that is: Stable Available in your current power mode Compatible with the peripheral’s timing requirements You can add more clock divers if needed to make a higher frequency clock reach a certain lower frequency. Reconfigure the Peripheral Clock Source Use the SDK’s CLOCK_Set... APIs to change the clock source. You may also need to: Adjust dividers to match the required baud rate or timing Reinitialize the peripheral with the new clock settings Example Scenario: Measuring the FRO and Adjusting UART Based on Frequency Ratio Imagine your application relies on the 6 MHz Free Running Oscillator (FRO), and its accuracy directly affects UART communication. To ensure reliable operation, you can use the System Frequency Adjustment (SFA) feature to monitor the FRO output and dynamically adjust the UART configuration. After measuring the 6 MHz FRO using the recommended method, the system returns a frequency ratio value. This value ranges from 1 to 4, where: 1 indicates the frequency is within expected limits (no issues), 2 to 4 represent varying degrees of deviation from the expected frequency. Using this ratio, you can initialize and configure the UART peripheral and its driver to compensate for any frequency variation, ensuring stable and accurate communication. */ int main(void) { BOARD_InitHardware(); uint8_t ch = 0; uint8_t FRO_ratio = 0; init_SFA_peripheral(); /*Measure FRO6M output frequency*/ FRO_ratio = SFA_freq_measurment_6M_FRO(); /*Init debug console and compensate in case a different frequency is output */ if(0 == FRO_ratio) { assert(0);//this user defined return value means something went wrong while measuring 6Mz FRO } uint32_t uartClkSrcFreq = BOARD_DEBUG_UART_CLK_FREQ/FRO_ratio;//Compensate the src frequency set for uart module CLOCK_EnableClock(kCLOCK_Lpuart1); CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro6M); DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq); ...... } SDK 25.0.00 Enhancements for FRO6M Calibration To address known reliability issues with the 6 MHz Free Running Oscillator (FRO6M), particularly during transitions from low-power modes, SDK version 25.06.00 introduces a set of software enhancements aimed at improving oscillator validation and calibration. Key Features Introduced FRO6M Calibration API Two new functions have been added to facilitate runtime verification of the FRO6M frequency: PLATFORM_StartFro6MCalibration() Initializes the calibration process by enabling the cycle counter, capturing a timestamp, and preparing the system to measure elapsed time using both the CPU and the FRO6M-based timestamp counter. PLATFORM_EndFro6MCalibration() Completes the calibration by comparing the time measured via CPU cycles and the FRO6M timestamp counter. This comparison determines whether the oscillator is operating at the expected 6 MHz or has erroneously locked to a lower frequency (e.g., 2 MHz). The result is stored in a global ratio variable (fwk_platform_FRO6MHz_ratio) for use by the system. These functions provide a lightweight and efficient mechanism to detect and respond to oscillator misbehavior, ensuring system stability and timing accuracy. Configuration Macro gPlatformEnableFro6MCalLowpower_d This macro enables automatic FRO6M frequency verification upon exiting low-power modes. When defined, the system will invoke the calibration functions to validate the oscillator before resuming normal operation. Default Integration The calibration mechanism is enabled by default in the SDK configuration file fwk_config.h, ensuring that all applications benefit from this safeguard without requiring manual setup. Use Case and Benefits These enhancements are particularly valuable in applications where: Precise timing is critical (e.g., wireless communication, sensor sampling). The system frequently enters and exits low-power states. Clock source integrity must be guaranteed to avoid peripheral misbehavior or timing faults. By integrating these calibration routines, developers can proactively detect and correct FRO6M frequency anomalies, improving overall system robustness and reducing the risk of runtime errors due to clock instability.  
View full article
The MCX W23 is a family of devices. All devices are Arm Cortex®-M33 based wireless microcontrollers for embedded applications supporting Bluetooth Low Energy 5.3. It can be used to develop IoT solutions. MCX W23xA supports LV_SM mode. MCX W23xB supports HV_SM and XR_SM mode. These devices include: • Up to 128 kB of on-chip SRAM • Up to 1024 kB on-chip flash • Quad SPI interface for operation from external SPI NVM • Five general-purpose timers (CTIMER) • One SCTimer/PWM • One RTC/alarm timer • One 24-bit multirate timer (MRT) • Windowed watchdog timer (WWDT) • Three flexible serial communication peripherals (each of which can be a USART, SPI, or I2C interface) Building on NXP's strong history of providing industrial edge solutions, the MCX W series offers a wide operating temperature range from -40 °C to 125 °C . The Arm Cortex-M33 provides a security foundation, offering isolation to protect valuable IP and data with TrustZone technology. It simplifies the design and software development of digital signal control systems with the integrated digital signal processing (DSP) instructions. To support security requirements, the MCX W23 also offers support for SHA-1, SHA2-256, AES, RSA, ECC, UUID, dynamic encryption, and decryption of the flash data using a PRINCE engine, debug authentication, and TBSA-M compliance.   Bluetooth Specifications The MCX W23 is compatible with the Bluetooth Low Energy 5.3 specification: – Bluetooth Low Energy 5.3 controller subsystem (QDID 200592) – Bluetooth Low Energy 5.3 host subsystem (QDID 226395) – Includes a 48-bit unique bluetooth device address – Up to 4 simultaneous connections supported The MCX W23 supports the following Bluetooth Low Energy features: – Device privacy and network privacy modes (version 5.0) – Advertising extension PDUs (version 5.0) – Anonymous device address type (version 5.0) – Up to 2 Mbps data rate (version 5.0) – Long range (version 5.0) – High-duty cycle, nonconnectable advertising (version 5.0) – Channel selection algorithm #2 (version 5.0) – High output power (version 5.0) – Advertising channel index (version 5.1) – Periodic advertising sync transfer (PAST) (version 5.1) – Supports LE power control feature (version 5.2) RF antenna: 50 Ω single-ended RF receiver characteristics: – Sensitivity −94 dBm in Bluetooth Low Energy 2 Mbps – Sensitivity −97 dBm in Bluetooth Low Energy 1 Mbps – Sensitivity −100 dBm in Bluetooth Low Energy 500 kbps – Sensitivity −102 dBm in Bluetooth Low Energy 125 kbps – Accurate RSSI measurement with ±3 dB accuracy Flexible RF transmitter level configurability: – TX mode 1 (TXM1): Range from −31 dBm to +2 dBm when VDD_RF exceeds 1.1 V – TX mode 2 (TXM2): Range from −28 dBm to +6 dBm when VDD_RF exceeds 1.7   Bluetooth_5.0_Feature_Overview  Bluetooth_5.1_Feature_Overview  Bluetooth_5.2_Feature_Overview Bluetooth_5.3_Feature_Overview   Training MCX W Series Training - NXP Community   Equipment Wireless Equipment: This article provides the links to the Equipment that helps to the project development    Useful Links Transmitter Maximum Output Power Override Application Note   Development Tools  NXP MCUXpresso: MCUXpresso IDE offers advanced editing, compiling and debugging features with the addition of MCU-Specific debugging. Supports connections with all general-purpose Arm Cortex-M.  VSCode: MCUXpresso for Visual Studio Code (VS Code) provides an optimized embedded developer experience for code editing and development. Zephyr RTOs  NXP Application Code Hub: Application Code Hub (ACH) repository enables engineers to easily find microcontroller software examples, code snippets, application software packs and demos developed by our in-house experts. This space provides a quick, easy and consistent way to find microcontroller applications. NXP SPSDK: Is a unified, reliable, and easy to use Python SDK library working across the NXP MCU portfolio providing a strong foundation from quick customer prototyping up to production deployment. NXP SEC Tool: The MCUXpresso Secure Provisioning Tool us a GUI-based application provided to simplify generation and provisioning of bootable executables on NCP MCU devices. NXP OTAP Tool: Is an application that helps the user to perform an over the air firmware update of an NXP development board. Support If you have questions regarding MCX W23, please leave your question in our Wireless MCU Community! here
View full article
The customer wanted to update the FW of the PN7462 to an NFC cockpit. In general, we recommend that customers use MASS STORAGE MODE to update two files (including Flash and EEPROM) into memory. But there will always be customers who don’t know or how to successfully access MASS STORAGE MODE. They cannot succeed in doing so. Therefore, it is recommended to use the GUI FLASH tool to upgrade the FW to the NFC cabin. In order to clearly indicate the user how to use the GUI FLASH tool, this document describes this step by step.
View full article