ワイヤレス接続に関するナレッジベース

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Wireless Connectivity Knowledge Base

ディスカッション

ソート順:
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"
記事全体を表示
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.
記事全体を表示
In this document we will be seeing how to create a BLE demo application for an adopted BLE profile based on another demo application with a different profile. In this demo, the Pulse Oximeter Profile will be implemented.  The PLX (Pulse Oximeter) Profile was adopted by the Bluetooth SIG on 14th of July 2015. You can download the adopted profile and services specifications on https://www.bluetooth.org/en-us/specification/adopted-specifications. The files that will be modified in this post are, app.c,  app_config.c, app_preinclude.h, gatt_db.h, pulse_oximeter_service.c and pulse_oximeter_interface.h. A profile can have many services, the specification for the PLX profile defines which services need to be instantiated. The following table shows the Sensor Service Requirements. Service Sensor Pulse Oximeter Service Mandatory Device Information Service Mandatory Current Time Service Optional Bond Management Service Optional Battery Service Optional Table 1. Sensor Service Requirements For this demo we will instantiate the PLX service, the Device Information Service and the Battery Service. Each service has a source file and an interface file, the device information and battery services are already implemented, so we will only need to create the pulse_oximeter_interface.h file and the pulse_oximeter_service.c file. The PLX Service also has some requirements, these can be seen in the PLX service specification. The characteristic requirements for this service are shown in the table below. Characteristic Name Requirement Mandatory Properties Security Permissions PLX Spot-check Measurement C1 Indicate None PLX Continuous Measurement C1 Notify None PLX Features Mandatory Read None Record Access Control Point C2 Indicate, Write None Table 2. Pulse Oximeter Service Characteristics C1: Mandatory to support at least one of these characteristics. C2: Mandatory if measurement storage is supported for Spot-check measurements. For this demo, all the characteristics will be supported. Create a folder for the pulse oximeter service in  \ConnSw\bluetooth\profiles named pulse_oximeter and create the pulse_oximeter_service.c file. Next, go to the interface folder in \ConnSw\bluetooth\profiles and create the pulse_oximeter_interface.h file. At this point these files will be blank, but as we advance in the document we will be adding the service implementation and the interface macros and declarations. Clonate a BLE project with the cloner tool. For this demo the heart rate sensor project was clonated. You can choose an RTOS between bare metal or FreeRTOS. You will need to change some workspace configuration.  In the bluetooth->profiles->interface group, remove the interface file for the heart rate service and add the interface file that we just created. Rename the group named heart_rate in the bluetooth->profiles group to pulse_oximeter and remove the heart rate service source file and add the pulse_oximeter_service.c source file. These changes will be saved on the actual workspace, so if you change your RTOS you need to reconfigure your workspace. To change the device name that will be advertised you have to change the advertising structure located in app_config.h. /* Scanning and Advertising Data */ static const uint8_t adData0[1] =  { (gapAdTypeFlags_t)(gLeGeneralDiscoverableMode_c | gBrEdrNotSupported_c) }; static const uint8_t adData1[2] = { UuidArray(gBleSig_PulseOximeterService_d)}; static const gapAdStructure_t advScanStruct[] = { { .length = NumberOfElements(adData0) + 1, .adType = gAdFlags_c, .aData = (void *)adData0 }, { .length = NumberOfElements(adData1) + 1, .adType = gAdIncomplete16bitServiceList_c, .aData = (void *)adData1 }, { .adType = gAdShortenedLocalName_c, .length = 8, .aData = "FSL_PLX" } }; We also need to change the address of the device so we do not have conflicts with another device with the same address. The definition for the address is located in app_preinclude.h and is called BD_ADDR. In the demo it was changed to: #define BD_ADDR 0xBE,0x00,0x00,0x9F,0x04,0x00 Add the definitions in ble_sig_defines.h located in Bluetooth->host->interface for the UUID’s of the PLX service and its characteristics. /*! Pulse Oximeter Service UUID */ #define gBleSig_PulseOximeterService_d         0x1822 /*! PLX Spot-Check Measurement Characteristic UUID */ #define gBleSig_PLXSpotCheckMeasurement_d      0x2A5E /*! PLX Continuous Measurement Characteristic UUID */ #define gBleSig_PLXContinuousMeasurement_d     0x2A5F /*! PLX Features Characteristic UUID */ #define gBleSig_PLXFeatures_d                  0x2A60 /*! Record Access Control Point Characteristic UUID */ #define gBleSig_RecordAccessControlPoint_d     0x2A52 We need to create the GATT database for the pulse oximeter service. The requirements for the service can be found in the PLX Service specification. The database is created at compile time and is defined in the gatt_db.h.  Each characteristic can have certain properties such as read, write, notify, indicate, etc. We will modify the existing database according to our needs. The database for the pulse oximeter service should look something like this. PRIMARY_SERVICE(service_pulse_oximeter, gBleSig_PulseOximeterService_d)     CHARACTERISTIC(char_plx_spotcheck_measurement, gBleSig_PLXSpotCheckMeasurement_d, (gGattCharPropIndicate_c))         VALUE_VARLEN(value_PLX_spotcheck_measurement, gBleSig_PLXSpotCheckMeasurement_d, (gPermissionNone_c), 19, 3, 0x00, 0x00, 0x00)         CCCD(cccd_PLX_spotcheck_measurement)     CHARACTERISTIC(char_plx_continuous_measurement, gBleSig_PLXContinuousMeasurement_d, (gGattCharPropNotify_c))         VALUE_VARLEN(value_PLX_continuous_measurement, gBleSig_PLXContinuousMeasurement_d, (gPermissionNone_c), 20, 3, 0x00, 0x00, 0x00)         CCCD(cccd_PLX_continuous_measurement)     CHARACTERISTIC(char_plx_features, gBleSig_PLXFeatures_d, (gGattCharPropRead_c))         VALUE_VARLEN(value_plx_features, gBleSig_PLXFeatures_d, (gPermissionFlagReadable_c), 7, 2, 0x00, 0x00)     CHARACTERISTIC(char_RACP, gBleSig_RecordAccessControlPoint_d, (gGattCharPropIndicate_c | gGattCharPropWrite_c))         VALUE_VARLEN(value_RACP, gBleSig_RecordAccessControlPoint_d, (gPermissionNone_c), 4, 3, 0x00, 0x00, 0x00)         CCCD(cccd_RACP) For more information on how to create a GATT database you can check the BLE Application Developer’s Guide chapter 7. Now we need to make the interface file that contains all the macros and declarations of the structures needed by the PLX service. Enumerated types need to be created for each of the flags field or status field of every characteristic of the service. For example, the PLX Spot-check measurement field has a flags field, so we declare an enumerated type that will help us keep the program organized and well structured. The enum should look something like this: /*! Pulse Oximeter Service - PLX Spotcheck Measurement Flags */ typedef enum {     gPlx_TimestampPresent_c                      = BIT0,     /* C1 */     gPlx_SpotcheckMeasurementStatusPresent_c     = BIT1,     /* C2 */     gPlx_SpotcheckDeviceAndSensorStatusPresent_c = BIT2,     /* C3 */     gPlx_SpotcheckPulseAmplitudeIndexPresent_c   = BIT3,     /* C4 */     gPlx_DeviceClockNotSet_c                     = BIT4 } plxSpotcheckMeasurementFlags_tag; The characteristics that will be indicated or notified need to have a structure type that contains all the fields that need to be transmitted to the client. Some characteristics will not always notify or indicate the same fields, this varies depending on the flags field and the requirements for each field. In order to notify a characteristic we need to check the flags in the measurement structure to know which fields need to be transmitted. The structure for the PLX Spot-check measurement should look something like this: /*! Pulse Oximeter Service - Spotcheck Measurement */ typedef struct plxSpotcheckMeasurement_tag {     ctsDateTime_t              timestamp;             /* C1 */     plxSpO2PR_t                SpO2PRSpotcheck;       /* M */     uint32_t                   deviceAndSensorStatus; /* C3 */     uint16_t                   measurementStatus;     /* C2 */     ieee11073_16BitFloat_t     pulseAmplitudeIndex;   /* C4 */     uint8_t                    flags;                 /* M */ }plxSpotcheckMeasurement_t; The service has a configuration structure that contains the service handle, the initial features of the PLX Features characteristic and a pointer to an allocated space in memory to store spot-check measurements. The interface will also declare some functions such as Start, Stop, Subscribe, Unsubscribe, Record Measurements and the control point handler. /*! Pulse Oximeter Service - Configuration */ typedef struct plxConfig_tag {     uint16_t      serviceHandle;     plxFeatures_t plxFeatureFlags;     plxUserData_t *pUserData;     bool_t        procInProgress; } plxConfig_t; The service source file implements the service specific functionality. For example, in the PLX service, there are functions to record the different types of measurements, store a spot-check measurement in the database, execute a procedure for the RACP characteristic, validate a RACP procedure, etc. It implements the functions declared in the interface and some static functions that are needed to perform service specific tasks. To initialize the service you use the start function. This function initializes some characteristic values. In the PLX profile, the Features characteristic is initialized and a timer is allocated to indicate the spot-check measurements periodically when the Report Stored Records procedure is written to the RACP characteristic. The subscribe and unsubscribe functions are used to update the device identification when a device is connected to the server or disconnected. bleResult_t Plx_Start (plxConfig_t *pServiceConfig) {         mReportTimerId = TMR_AllocateTimer();         return Plx_SetPLXFeatures(pServiceConfig->serviceHandle, pServiceConfig->plxFeatureFlags); } All of the services implementations follow a similar template, each service can have certain characteristics that need to implement its own custom functions. In the case of the PLX service, the Record Access Control Point characteristic will need many functions to provide the full functionality of this characteristic. It needs a control point handler, a function for each of the possible procedures, a function to validate the procedures, etc. When the application makes a measurement it must fill the corresponding structure and call a function that will write the attribute in the database with the correct fields and then send an indication or notification. This function is called RecordMeasurement and is similar between the majority of the services. It receives the measurement structure and depending on the flags of the measurement, it writes the attribute in the GATT database in the correct format. One way to update a characteristic is to create an array of the maximum length of the characteristic and check which fields need to be added and keep an index to know how many bytes will be written to the characteristic by using the function GattDb_WriteAttribute(handle, index, &charValue[0]). The following function shows an example of how a characteristic can be updated. In the demo the function contains more fields, but the logic is the same. static bleResult_t Plx_UpdatePLXContinuousMeasurementCharacteristic ( uint16_t handle, plxContinuousMeasurement_t *pMeasurement ) {     uint8_t charValue[20];     uint8_t index = 0;     /* Add flags */     charValue[0] = pMeasurement->flags;     index++;     /* Add SpO2PR-Normal */     FLib_MemCpy(&charValue[index], &pMeasurement->SpO2PRNormal, sizeof(plxSpO2PR_t));     index += sizeof(plxSpO2PR_t);         /* Add SpO2PR-Fast */     if (pMeasurement->flags & gPlx_SpO2PRFastPresent_c)     {       FLib_MemCpy(&charValue[index], &pMeasurement->SpO2PRFast, sizeof(plxSpO2PR_t));       index += sizeof(plxSpO2PR_t);     }        return GattDb_WriteAttribute(handle, index, &charValue[0]); } The app.c handles the application specific functionality. In the PLX demo it handles the timer callback to make a PLX continuous measurement every second. It handles the key presses and makes a spot-check measurement each time the SW3 pushbutton is pressed. The GATT server callback receives an event when an attribute is written, and in our application the RACP characteristic is the only one that can be written by the client. When this event occurs, we call the Control Point Handler function. This function makes sure the indications are properly configured and check if another procedure is in progress. Then it calls the Send Procedure Response function, this function validates the procedure and calls the Execute Procedure function. This function will call one of the 4 possible procedures. It can call Report Stored Records, Report Number of Stored Records, Abort Operation or Delete Stored Records. When the project is running, the 4 LEDs will blink indicating an idle state. To start advertising, press the SW4 button and the LED1 will start flashing. When the device has connected to a client the LED1 will stop flashing and turn on. To disconnect the device, hold the SW4 button for some seconds. The device will return to an advertising state. In this demo, the spot-check measurement is made when the SW3 is pressed, and the continuous measurement is made every second. The spot-check measurement can be stored by the application if the Measurement Storage for spot-check measurements is supported (bit 2 of Supported Features Field in the PLX Features characteristic). The RACP characteristic lets the client control the database of the spot-check measurements, you can request the existing records, delete them, request the number of stored records or abort a procedure. To test the demo you can download and install the nRF Master Control application by Nordic Semiconductor on an Android Smartphone that supports BLE. This app lets you discover the services in the sensor and interact with each characteristic. The application will parse known characteristics, but because the PLX profile is relatively new, these characteristics will not be parsed and the values will be displayed in a raw format. Figure 1. nRF Master Control app
記事全体を表示
Useful Links: Bluetooth Ranging Access Vehicle Enablement System - NXP Community
記事全体を表示
The slides were prepared for European School of Antennas at Carlos III University in Madrid. The contents: - About NXP and wireless controllers - About channel sounding and NXP solutions - Design of CS antennas and functional tests - CS antenna arrays and CS localization
記事全体を表示
As documented in the MCX W23 [ERRATA] for WLCSP packaged devices, Tx modulation quality can potentially be violated on 2 data channels
記事全体を表示
The customer submitted a case through DFAE to seek support from NXP. They designed the product using PN5180, and according to feedback, about 10% of the boards could not read the card. The specific manifestation of the problem is: after the host issues the RF_ON command, RF field seems cannot be turned on and then fails to detect the card. Therefore, it can be seen that the problem should be on TX, not RX. The customer's device does not enable DPC and LPCD.
記事全体を表示
    As the support for MCUXpresso IDE as GUI and toolchain will be stopped and will be replaced by MCUXpresso for Visual Studio Code, I am sharing here some essential steps to start development on Visual Studio Code and MCUXpresso plugin. Preparation: - MCUXpresso for VS Code is installed as an extension inside Microsoft VS Code - see https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-for-visual-studio-code:MCUXPRESSO-VSC - The rest of the toolchain including ARMGCC, west and other tools which work with MCUX for VS Code installation is available via MCUXpresso SDK option of the MCUXpresso Installer: https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-installer:MCUXPRESSO-INSTALLER - See also generic Getting Started Guide for MCUX SDK with MCUX for VS Code at: https://mcuxpresso.nxp.com/mcuxsdk/latest/html/gsd/run_a_demo_using_mcuxvsc.html   Here I will provide the procedure to import the loc_reader example from the repository.   Import the repository: The recommended approach is to import REMOTE ARCHIVE which has a similar environment as the legacy MCUXpresso IDE. Here I will provide the procedure to import the loc_reader example from the repository From the MCUXpresso plugin, select "Import Repository", then in the "REMOTE ARCHIVE" tab, select the board, the SDK version and the location: Wait for the repository to be imported, this procedure can take several minutes. Once the import is succeed, it will appear here: Import demo projects and run: Once the repository is successfully imported, you can then import demo examples from the repo by selecting "Import Example from Repository": then select the demo example from "Template". "AppType" should be "Freestanding application" if you want a standalone project. "Location" is where the project will be located.  "Toolchain" should be the Arm GNU one that you installed in preparation steps Build and run the imported project:  
記事全体を表示
In daily work, many customers are asking how to develop Mifare Desfire EV3. Yes, it is true that the Mifare Desfire EV3 is a highly secure product, and the related application documents are complicated and difficult for customers to use or take too much time to research, so I want to share them with you.
記事全体を表示
This article shares 2 step by step methods to create P2P connections between 2 IW612 modules. One is not setting pin code, another is setting pin code. And also shares local test results and printed logs for your reference. The basic environment: Hardware: 2 IW612 modules(Murata LBES5PL2EL) + I.MX93-EVK Software: Linux 6.12.20 Wi-Fi Driver and FW version = SDIW612---w9177o-V1, SDIO, FP99, 18.99.3.p25.7-MM6X18537.p9-GPL-(FP92) As a reference, you can also test on other NXP's Wi-Fi products based on Linux OS.   Best regards, Christine.
記事全体を表示
The KW43 product family is a low-power, secure, single-chip wireless MCU that integrates a high performance, Bluetooth Low Energy, Bluetooth Channel Sounding, EdgeLock Secure Accelerators, and various MCU peripherals targeted for Automotive applications. The KW43 family utilizes an Arm® Cortex®-M33 core (Armv8-M architecture) running up to 96 MHz for customer applications. The family includes memory configurations of up to 1.5MB flash and 256 KB SRAM across all listed part numbers. All devices in the family integrate a state-of-the-art, scalable security architecture including Arm’s TrustZone®-M, a resource domain controller and an isolated EdgeLock Secure Accelerators supporting hardware cryptographic accelerators, random number generators and key generation, storage, and management along with secure debug. All members of the KW43 family are designed to be compliant to a SESIP Level 3 certification following the Arm PSA Level 3 profile. KW43 uses dual Arm Core Cortex-M33 (‘CM33’) and supports multiple interfaces and security features. One is for application and system use and other is for radio link layer and both cores share a common flash of 1.5 MB. The devices include a full certified Bluetooth LE 6.x controller stack with support for up to 10 simultaneous connections in any controller/peripheral combination. The multiprotocol radio subsystem integrated in the KW43 Family is energy efficient and is designed for Wi-Fi coexistence. The radio is supported with tested software stacks for Bluetooth Low Energy for standalone and hosted applications to enable a range of Automotive, IoT and industrial applications. There is also software and hardware support for 2.4 GHz proprietary protocols. To address ranging requirements, the Localization Engine (LCE) is integrated into the system for enhanced localization performance. The KW43 series is supported by the MCUXpresso Developer Experience to optimize, ease and help accelerate embedded system development. Early access program The KW43 is in pre-production, developers can get started today with the KW45/KW47, which is pin and software compatible.   you can request access contacting NXP sales team - Pascal Bernard (pascal.bernard@nxp.com) Join KW47 early access program here: KW43 Early Access Training Bluetooth Low energy 6.0 NXP Introduction Interested in Bluetooth technology? Bluetooth® Low Energy Primer – Essential reading for understanding BLE fundamentals. Bluetooth® Specifications – Full list of standards, protocols, and technical documents. Awards and Recognition - Every year, the Bluetooth Special Interest Group (SIG) celebrates the hard work and commitment of working groups, committee members, and contributors who have been recognized by their peers as making a difference in advancing Bluetooth technology.  2024: Channel Sounding 2025: Channel sounding amplitude-based attack resilience, LE test mode enhancements and Ranging profile and service.  Bluetooth Feature Overview Bluetooth_5.0_Feature_Overview  Bluetooth_5.1_Feature_Overview  Bluetooth_5.2_Feature_Overview Bluetooth_5.3_Feature_Overview Bluetooth_5.4_Feature_Overview Bluetooth_6_Feature_Overview Bluetooth_6.1_Feature_Overview Bluetooth_6.2_Feature_Overview Bluetooth_6.3_Feature_Overview RF Switch Comparison Absorptive/Reflective Standards Comparison ETSI / FCC / ARIB requirements BLE Channel Sounding  - Overview BLE Channel Sounding - RF Hardware BLE Channel Sounding - ANSYS Modeling Tools  BLE Channel Sounding - Antenna Prototypes Validation Measurements Equipment Wireless Equipment: This article provides the links to the Equipment that helps to the project development  Useful Links How to import and run demo examples with MCUXpresso for Visual Studio Code: This article gives information on how to import and run demo examples from the new SDK with ARM GCC toolchain, in MCUXpresso for Visual Studio Code. [MCUXSDK] How to use GitHub SDK for KW4x, MCXW7x, MCXW2x - NXP Community this community post provides step by step how to use GitHub SDK [MCUXSDK] GitHub SDK - Documentation for Bluetooth LE platforms - NXP Community this community post provides the documentation for BLE platforms.  How to use the HCI_bb on Kinetis family products and get access to the DTM mode:  This article is presenting two parts: How to flash the HCI_bb binary into the Kinetis product. Perform RF measurement using the R&S CMW270 BLE HCI Application to set transmitter/receiver test commands: This article provides the steps to show how user could send serial commands to the device. Bluetooth LE HCI Black Box Quick Start Guide: This article describes a simple process for enabling the user controls the radio through serial commands. Support If you have questions regarding KW45/KW47, please leave your question in our Wireless MCU Community! here  
記事全体を表示
Hello, all, Bellow you can find the necessary steps to enable dual monitor mode on our Wi-Fi chip: 88W9098. This procedure is helpful for using 88W9098's dual interfaces in monitor mode to simultaneously capture Wi-Fi sniffer logs in different band . Below is my test environment: Hardware: I.MX8MQ-EVK M.2 AzureWave PCIe XM458 module Software: Linux kernel version: L6.6.52 (prebuilt image for I.MX8MQ-EVK) Device Tree: imx8mq-evk-pcie1-m2.dtb Wi-Fi/BT Driver & Firmware: Version: PCIE9098--17.92.1.p149.81-MM6X17540.p33-(FP92) Firmware: nxp/pcieuart9098_combo_v1.bin Configuration: Edit wifi_mod_para.conf and add: mon_filter=0x27 max_vir_bss=2 Example configuration: PCIE9098_0 = { cfg80211_wext=0xf max_vir_bss=2 cal_data_cfg=none ps_mode=1 auto_ds=1 host_mlme=1 mon_filter=0x27 fw_name=nxp/pcieuart9098_combo_v1.bin } PCIE9098_1 = { cfg80211_wext=0xf max_vir_bss=2 cal_data_cfg=none ps_mode=1 auto_ds=1 host_mlme=1 mon_filter=0x27 fw_name=nxp/pcieuart9098_combo_v1.bin } Compile tcpdump Compile libpcap: wget https://www.tcpdump.org/release/libpcap-1.10.4.tar.gz tar -xvf libpcap-1.10.4.tar.gz cd libpcap-1.10.4 ./configure --host=arm-linux-gnueabihf --prefix=/opt/tcpdump make Output: libpcap.so.1.10.4 Compile tcpdump: wget https://www.tcpdump.org/release/tcpdump-4.99.4.tar.gz tar -xvf tcpdump-4.99.4.tar.gz cd tcpdump-4.99.4/ ./configure --host=arm-linux-gnueabihf --prefix=/opt/tcpdump --with-pcap=/opt/tcpdump make Output: tcpdump Deploy to Board: Copy libpcap.so.1.10.4 and tcpdump to the board Add execute permission: chmod +x tcpdump Dual Monitor Mode on 88W9098 Load the Wi-Fi drivers and firmware: modprobe moal mod_para=nxp/wifi_mod_para.conf Monitor Interface Setup 5 GHz (mlan0): iw mlan0 interface add mon0 type monitor ip link set mon0 up ip link set mlan0 down iw mon0 set channel 36 ./tcpdump -i mon0 -w capture_5g.pcap & ./tcpdump -r capture_5g.pcap 2.4 GHz (mmlan0): iw mmlan0 interface add mon1 type monitor ip link set mon1 up ip link set mmlan0 down iw mon1 set channel 6 ./tcpdump -i mon1 -w capture_2g.pcap & ./tcpdump -r capture_2g.pcap Simultaneous Capture ./tcpdump -i mon0 -w capture_5g.pcap & ./tcpdump -i mon1 -w capture_2g.pcap & Stop Capture killall tcpdump Read Captures ./tcpdump -r capture_5g.pcap ./tcpdump -r capture_2g.pcap Reference link: https://docs.nxp.com/bundle/RM00297/page/connectivity-features/topics/monitor_mode.html   Best regards, Christine.
記事全体を表示
This post will cover how to install the CMSIS-DAP/SEGGER J-link firmware for the KW47-EVK and FRDM-MCXW72 using NXP’s MCU-LINK installer. CMSIS-DAP Installation for KW47-EVK Place a jumper on JP20 1-2 while the board is disconnected  Connect the board using a USB-A to USB-C cable between the host PC and the KW47-EVK board’s J14 connector, the D13 red LED should turn ON, indicating that the board is in ISP mode.                         Double click the script called program_CMSIS or program_JLINK  to execute the script. These scripts are found on the following path: C:\NXP\MCU-LINK_installer_3.167\scripts​ ​Note: MCU-Link installer version may vary. Press any key to execute the script, if the board entered ISP mode correctly, the board will be programmed with the selected debug probe firmware:    for FRDM-MCXW72  Place a jumper on JP5 1-2 while the board is disconnected    Connect the board using a USB-A to USB-C cable between the host PC and the FRDM-MCXW72 board’s J10 connector, the ISP_EN_ML INK red LED should turn ON, indicating that the board is in ISP mode.                                                              Double click the script called program_CMSIS to open the command window. This script is found on the following path:  C:\NXP\MCU-LINK_installer_3.167\scripts​​​  Note: MCU-Link installer version may vary.   Press any key to execute the script, if the board entered ISP mode correctly, the board will be programmed with the CMISIS-DAP firmware:                              Once the sequence finishes, the command window will display a completion message like the example below:    Remove the ISP jumper (JP5). Then reboot the board by disconnecting it from the host PC and reconnecting it again. After reconnecting, the ISP_EN_MLINK red LED should be OFF, and the USB_ACT green LED should be ON.    
記事全体を表示
What's DPP? DPP:Device Provisioning Protocol It is also called: Wi-Fi Easy Connect.   The DUT is a device that needs to join the network. It actively initiates DPP authentication (Initiator + Enrollee), which is configured by CTT1, and finally joins the Wi-Fi network provided by CTT2 (Responder + AP) as a STA.   DPP Role introduction: CTT1 (Configurator) Reads DUT's bootstrap key Coordinates DPP Authentication/Configuration Sends Wi‑Fi credentials to the DUT DUT (Initiator + Enrollee + STA) Is the device being provisioned Initiates DPP Authentication toward CTT2 Receives Wi‑Fi credentials from CTT1 Connects as a STA to the AP on CTT2 CTT2 (Responder + AP + Enrollee) Responds to DUT’s DPP Authentication messages Operates as an AP using hostapd The DUT will join this AP after provisioning   Below is the process flow: 1.Add a Configurator and generate QR code on CTT1 (configurator). 2.Authenticate the DUT on DUT(STA) 3.Generate the QR Code and get URI on CTT2 4.Enter the QR Code on CTT1 and authenticate 5.Update AP configuration on CTT2 6.The connection between the DUT (STA) and CTT2 (AP) is successful.     Reference: https://docs.nxp.com/bundle/RM00297/page/connectivity-features/topics/wi-fi_easy_connect_dpp.html Wi-Fi Easy Connect Specification   The red fonts in the pdf are commands. The green fonts in the pdf are comments. CTT1:Configurator Typically, it's a mobile phone or PC used to scan QR codes and issue Wi-Fi credentials. IMX93-EVK+IW612 module   imx93evk login: root root@imx93evk:~# uname -a Linux imx93evk 6.12.34-lts-next-gbe78e49cb433 #1 SMP PREEMPT Wed Sep  3 05:59:19 UTC 2025 aarch64 GNU/Linux root@imx93evk:~# cat /lib/firmware/nxp/wifi_mod_para.conf     SDIW612 = { cfg80211_wext=0xf max_vir_bss=1 cal_data_cfg=none ps_mode=2 auto_ds=2 host_mlme=1 drv_mode=0x17 fw_name=nxp/sduart_nw61x_v1.bin.se }   root@imx93evk:~# vi wpa_supplicant.conf root@imx93evk:~# cat wpa_supplicant.conf ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 update_config=1 dpp_config_processing=2     modprobe moal mod_para=nxp/wifi_mod_para.conf   root@imx93evk:~# wpa_supplicant -i mlan0 -D nl80211 -c wpa_supplicant.conf -B & [1] 678 root@imx93evk:~# Successfully initialized wpa_supplicant rfkill: Cannot open RFKILL control device   [1]+  Done                    wpa_supplicant -i mlan0 -D nl80211 -c wpa_supplicant.conf -B root@imx93evk:~# root@imx93evk:~# root@imx93evk:~# wpa_cli wpa_cli v2.11-M005 Copyright (c) 2004-2024, Jouni Malinen <j@w1.fi> and contributors   This software may be distributed under the terms of the BSD license. See README for more details.     Selected interface 'mlan0'   Interactive mode   > DPP_CONFIGURATOR_ADD 1 > SET dpp_configurator_params " conf=sta-dpp configurator=1" OK > DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=fc:84:a7:51:87:fc //MAC address of CTT1 itself. 1 > DPP_BOOTSTRAP_GET_URI 1  //Attention here, after this command, will generate a QR code, which will be use on DUT with command:DPP_QR_CODE DPP:C:81/1;M:fc84a75187fc;V:2;K:MDkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDIgAD/bYibd4JdGvnK1etdgX/z4P+aJE2ztv89Q8xwjmbZNc=;; > DPP_LISTEN 2412 role=configurator OK   //Hold on here, and now go to DUT side to authenticate the DUT with above QR Code. After authenticate on DUT, will auto output below logs.   <3>DPP-RX src=20:4e:f6:bb:08:d9 freq=2412 type=0 <3>DPP-TX dst=20:4e:f6:bb:08:d9 freq=2412 type=1 <3>DPP-TX-STATUS dst=20:4e:f6:bb:08:d9 freq=2412 result=SUCCESS <3>DPP-RX src=20:4e:f6:bb:08:d9 freq=2412 type=2 <3>DPP-AUTH-SUCCESS init=0 pkhash=74a40ec058ac8c7f7acb6589253e76f5d1a9582359353bcd5e6983ee97c3a382 own=1 peer=-1 <3>DPP-CONF-REQ-RX src=20:4e:f6:bb:08:d9 <3>DPP-BAND-SUPPORT 81,82,83,84,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130 <3>DPP-RX src=20:4e:f6:bb:08:d9 freq=2412 type=11 <3>DPP-CONF-SENT conf_status=0   //Now continue, after you generate the QR Code and get URI on CTT2. Enter the QR Code on CTT1 and authenticate: > DPP_QR_CODE DPP:C:81/1;M:02e93a0db8cd;V:2;K:MDkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDIgACQOp5kWO1ex4L2U5rRXdS9yPYWA9NdRXTsuT+v5L/jvc=;; 2 //On successfully adding QR Code, a bootstrapping info id is returned as shown 2 in above command and should input in below command DPP_AUTH_INIT > DPP_AUTH_INIT peer=2 conf=ap-dpp configurator=1 OK //Now go to CTT2 to update AP configurations. <3>DPP-TX dst=02:e9:3a:0d:b8:cd freq=2412 type=0 <3>DPP-TX-STATUS dst=02:e9:3a:0d:b8:cd freq=2412 result=SUCCESS <3>DPP-RX src=02:e9:3a:0d:b8:cd freq=2412 type=1 <3>DPP-AUTH-DIRECTION mutual=0 <3>DPP-TX dst=02:e9:3a:0d:b8:cd freq=2412 type=2 <3>DPP-TX-STATUS dst=02:e9:3a:0d:b8:cd freq=2412 result=SUCCESS <3>DPP-AUTH-SUCCESS init=1 pkhash=22233c6d83a272944eeb9788870b0b564b46ba8d48fd80787f5cc22bcec95c87 own=-1 peer=2 <3>DPP-CONF-REQ-RX src=02:e9:3a:0d:b8:cd <3>DPP-RX src=02:e9:3a:0d:b8:cd freq=2412 type=11 <3>DPP-CONF-SENT conf_status=0     > list_networks network id / ssid / bssid / flags > quit root@imx93evk:~# cat /proc/mwlan/adapter0/mlan0/info driver_name = "wlan" driver_version = SDIW612---18.99.3.p26.7-MM6X18540.p7-(FP92) interface_name="mlan0" firmware_major_version=18.99.3 uuid = 1653948cf99e5b2bbe5ad9b851d6151a bss_mode ="Managed" media_state="Disconnected" mac_address="fc:84:a7:51:87:fc" multicast_count="2" essid="" bssid="00:00:00:00:00:00" channel="0" region_code = "00" multicast_address[0]="33:33:00:00:00:01" multicast_address[1]="01:00:5e:00:00:01" num_tx_bytes = 0 num_rx_bytes = 0 num_tx_pkts = 0 num_rx_pkts = 0 num_tx_pkts_dropped = 0 num_rx_pkts_dropped = 0 num_tx_pkts_err = 0 num_rx_pkts_err = 0 carrier off tx queue 0:  stopped tx queue 1:  stopped tx queue 2:  stopped tx queue 3:  stopped === tp_acnt.on:0 drop_point:0 === ====Tx accounting==== [0] Tx packets     : 0 [0] Tx packets last: 0 [0] Tx packets rate: 0 [0] Tx bytes       : 0 [0] Tx bytes last  : 0 [0] Tx bytes rate  : 0Mbps [1] Tx packets     : 0 [1] Tx packets last: 0 [1] Tx packets rate: 0 [1] Tx bytes       : 0 [1] Tx bytes last  : 0 [1] Tx bytes rate  : 0Mbps [2] Tx packets     : 0 [2] Tx packets last: 0 [2] Tx packets rate: 0 [2] Tx bytes       : 0 [2] Tx bytes last  : 0 [2] Tx bytes rate  : 0Mbps [3] Tx packets     : 0 [3] Tx packets last: 0 [3] Tx packets rate: 0 [3] Tx bytes       : 0 [3] Tx bytes last  : 0 [3] Tx bytes rate  : 0Mbps [4] Tx packets     : 0 [4] Tx packets last: 0 [4] Tx packets rate: 0 [4] Tx bytes       : 0 [4] Tx bytes last  : 0 [4] Tx bytes rate  : 0Mbps Tx amsdu cnt            : 0 Tx amsdu cnt last       : 0 Tx amsdu cnt rate       : 0 Tx amsdu pkt cnt        : 0 Tx amsdu pkt cnt last : 0 Tx amsdu pkt cnt rate : 0 Tx intr cnt             : 1 Tx intr last        : 0 Tx intr rate        : 0 Tx pending          : 0 Tx xmit skb realloc : 0 Tx stop queue cnt : 0 ====Rx accounting==== [0] Rx packets     : 0 [0] Rx packets last: 0 [0] Rx packets rate: 0 [0] Rx bytes       : 0 [0] Rx bytes last  : 0 [0] Rx bytes rate  : 0Mbps [1] Rx packets     : 0 [1] Rx packets last: 0 [1] Rx packets rate: 0 [1] Rx bytes       : 0 [1] Rx bytes last  : 0 [1] Rx bytes rate  : 0Mbps [2] Rx packets     : 0 [2] Rx packets last: 0 [2] Rx packets rate: 0 [2] Rx bytes       : 0 [2] Rx bytes last  : 0 [2] Rx bytes rate  : 0Mbps [3] Rx packets     : 0 [3] Rx packets last: 0 [3] Rx packets rate: 0 [3] Rx bytes       : 0 [3] Rx bytes last  : 0 [3] Rx bytes rate  : 0Mbps [4] Rx packets     : 0 [4] Rx packets last: 0 [4] Rx packets rate: 0 [4] Rx bytes       : 0 [4] Rx bytes last  : 0 [4] Rx bytes rate  : 0Mbps Rx amsdu cnt             : 0 Rx amsdu cnt last        : 0 Rx amsdu cnt rate        : 0 Rx amsdu pkt cnt         : 0 Rx amsdu pkt cnt last : 0 Rx amsdu pkt cnt rate : 0 Rx intr cnt      : 7 Rx intr last        : 0 Rx intr rate        : 0 Rx pending          : 0 Rx pause            : 0 Rx rdptr full cnt   : 0 root@imx93evk:~#     DUT:Initiator + Enrollee + STA The device you want it to join the network. IMX8MQ-EVK+88W8997 module     root@imx8mqevk:~# uname -a Linux imx8mqevk 6.12.49-lts-next-gdf24f9428e38 #1 SMP PREEMPT Fri Nov 21 03:24:46 UTC 2025 aarch64 GNU/Linux   root@imx8mqevk:~# cat /lib/firmware/nxp/wifi_mod_para.conf   PCIE8997 = {         cfg80211_wext=0xf         max_vir_bss=1         cal_data_cfg=none         ps_mode=1         auto_ds=1         host_mlme=1         fw_name=nxp/pcieuart8997_combo_v4.bin }     root@imx8mqevk:~# cat wpa_supplicant.conf ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 update_config=1 dpp_config_processing=2   root@imx8mqevk:~# modprobe moal mod_para=nxp/wifi_mod_para.conf     root@imx8mqevk:~# wpa_supplicant -i mlan0 -D nl80211 -c wpa_supplicant.conf -B & [1] 799 root@imx8mqevk:~# Successfully initialized wpa_supplicant rfkill: Cannot open RFKILL control device   [1]+  Done                    wpa_supplicant -i mlan0 -D nl80211 -c wpa_supplicant.conf -B root@imx8mqevk:~# wpa_cli wpa_cli v2.11-M005 Copyright (c) 2004-2024, Jouni Malinen <j@w1.fi> and contributors   This software may be distributed under the terms of the BSD license. See README for more details.     Selected interface 'mlan0'   Interactive mode   > DPP_QR_CODE DPP:C:81/1;M:fc84a75187fc;V:2;K:MDkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDIgAD/bYibd4JdGvnK1etdgX/z4P+aJE2ztv89Q8xwjmbZNc=;; 1 > DPP_AUTH_INIT peer=1 role=enrollee OK <3>DPP-TX dst=fc:84:a7:51:87:fc freq=2412 type=0 <3>DPP-TX-STATUS dst=fc:84:a7:51:87:fc freq=2412 result=SUCCESS <3>DPP-RX src=fc:84:a7:51:87:fc freq=2412 type=1 <3>DPP-AUTH-DIRECTION mutual=0 <3>DPP-TX dst=fc:84:a7:51:87:fc freq=2412 type=2 <3>DPP-TX-STATUS dst=fc:84:a7:51:87:fc freq=2412 result=SUCCESS <3>DPP-AUTH-SUCCESS init=1 pkhash=6785abbd108e5ef6fe780819634ef620fc6eb71715b92b07f393e58af7afa0b6 own=-1 peer=1 <3>GAS-QUERY-START addr=fc:84:a7:51:87:fc dialog_token=199 freq=2412 <3>GAS-QUERY-DONE addr=fc:84:a7:51:87:fc dialog_token=199 freq=2412 status_code=0 result=SUCCESS <3>DPP-CONF-RECEIVED <3>DPP-CONFOBJ-AKM dpp <3>DPP-CONFOBJ-SSID test <3>DPP-CONNECTOR eyJ0eXAiOiJkcHBDb24iLCJraWQiOiJWV0hoQmp0enJVZ0xTSjhpTTJDRmRtNkxPQ0FFWHVCSWJEU3hzMEhaSDhnIiwiYWxnIjoiRVMyNTYifQ.eyJncm91cHMiOlt7Imdyb3VwSWQiOiIqIiwibmV0Um9sZSI6InN0YSJ9XSwibmV0QWNjZXNzS2V5Ijp7Imt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoibjBQbXlSMVhUUE14WUNiM2tqYjF1Yjh3Q055bUUtREFTcE4tZ2I0ZDhDcyIsInkiOiJfbmlkd1V6NkFkM1AySy1RYVJuXzZTem9KYlJWRGt3d0VYeTdZU2JoMDU4In19.kfVVpSaFNaTfoLVE5Yu16bLMfpSlVXGlul07FNwQ7gLPlYOTGS5lbOLwCTkP246kSC1Wn-8MWSUXpxgpSpsX2A <3>DPP-C-SIGN-KEY 3039301306072a8648ce3d020106082a8648ce3d0301070322000226d58dd75a168da8b901b47e01694868af2158d57db2984784349e12768e668b <3>DPP-PP-KEY 3039301306072a8648ce3d020106082a8648ce3d03010703220002a0008bd0723f2723408ef53550f5cbc55785ea625ec5265d81e16c0cd45a5e3a <3>DPP-NET-ACCESS-KEY 30770201010420cedd6e85e66768b1a8e14e2e048fd54b7f09277195c3db3f6b1887e8b449e872a00a06082a8648ce3d030107a144034200049f43e6c91d574cf3316026f79236f5b9bf3008dca613e0c04a937e81be1df02bfe789dc14cfa01ddcfd8af906919ffe92ce825b4550e4c30117cbb6126e1d39f <3>CTRL-EVENT-NETWORK-ADDED 0 <3>DPP-NETWORK-ID 0 <3>DPP-TX dst=fc:84:a7:51:87:fc freq=2412 type=11 <3>DPP-TX-STATUS dst=fc:84:a7:51:87:fc freq=2412 result=SUCCESS <3>CTRL-EVENT-SCAN-STARTED <3>CTRL-EVENT-SCAN-RESULTS <3>WPS-AP-AVAILABLE <3>CTRL-EVENT-NETWORK-NOT-FOUND <3>CTRL-EVENT-SCAN-STARTED <3>CTRL-EVENT-SCAN-RESULTS <3>WPS-AP-AVAILABLE <3>CTRL-EVENT-NETWORK-NOT-FOUND <3>CTRL-EVENT-SCAN-STARTED <3>CTRL-EVENT-SCAN-RESULTS <3>WPS-AP-AVAILABLE <3>CTRL-EVENT-NETWORK-NOT-FOUND > DPP_STOP_LISTEN OK   //All commands on DUT side finished until here. Now go to CTT2 side to continue, generate the QR Code and get URI on CTT2.   <3>CTRL-EVENT-SCAN-RESULTS <3>DPP-TX dst=02:e9:3a:0d:b8:cd freq=2412 type=5 <3>DPP-TX-STATUS dst=02:e9:3a:0d:b8:cd freq=2412 result=SUCCESS <3>DPP-RX src=02:e9:3a:0d:b8:cd freq=2412 type=6 <3>PMKSA-CACHE-ADDED 02:e9:3a:0d:b8:cd 0 <3>DPP-INTRO peer=02:e9:3a:0d:b8:cd status=0 version=2 <3>SME: Trying to authenticate with 02:e9:3a:0d:b8:cd (SSID='test' freq=2412 MHz) <3>Trying to associate with 02:e9:3a:0d:b8:cd (SSID='test' freq=2412 MHz) <3>Associated with 02:e9:3a:0d:b8:cd <3>CTRL-EVENT-SUBNET-STATUS-UPDATE status=0 <3>EAPOL-RX 02:e9:3a:0d:b8:cd 99 <3>EAPOL-RX 02:e9:3a:0d:b8:cd 195 <3>WPA: Key negotiation completed with 02:e9:3a:0d:b8:cd [PTK=CCMP GTK=CCMP] <3>CTRL-EVENT-CONNECTED - Connection to 02:e9:3a:0d:b8:cd completed [id=0 id_str=] > list_networks network id / ssid / bssid / flags 0       test    any     [CURRENT] > quit root@imx8mqevk:~# cat /proc/mwlan/adapter0/mlan0/info driver_name = "wlan" driver_version = PCIE8997--16.92.21.p153.7-MM6X16540.p33-GPL-(FP92) interface_name="mlan0" firmware_major_version=16.92.21 bss_mode ="Managed" media_state="Connected" mac_address="20:4e:f6:bb:08:d9" multicast_count="4" essid="test" bssid="02:e9:3a:0d:b8:cd" channel="1" region_code = "00" multicast_address[0]="33:33:00:00:00:01" multicast_address[1]="01:00:5e:00:00:01" multicast_address[2]="33:33:ff:bb:08:d9" multicast_address[3]="33:33:00:00:00:fb" num_tx_bytes = 2458 num_rx_bytes = 350 num_tx_pkts = 19 num_rx_pkts = 3 num_tx_pkts_dropped = 0 num_rx_pkts_dropped = 0 num_tx_pkts_err = 0 num_rx_pkts_err = 0 carrier on tx queue 0:  started tx queue 1:  started tx queue 2:  started tx queue 3:  started === tp_acnt.on:0 drop_point:0 === ====Tx accounting==== [0] Tx packets     : 0 [0] Tx packets last: 0 [0] Tx packets rate: 0 [0] Tx bytes       : 0 [0] Tx bytes last  : 0 [0] Tx bytes rate  : 0Mbps [1] Tx packets     : 0 [1] Tx packets last: 0 [1] Tx packets rate: 0 [1] Tx bytes       : 0 [1] Tx bytes last  : 0 [1] Tx bytes rate  : 0Mbps [2] Tx packets     : 0 [2] Tx packets last: 0 [2] Tx packets rate: 0 [2] Tx bytes       : 0 [2] Tx bytes last  : 0 [2] Tx bytes rate  : 0Mbps [3] Tx packets     : 0 [3] Tx packets last: 0 [3] Tx packets rate: 0 [3] Tx bytes       : 0 [3] Tx bytes last  : 0 [3] Tx bytes rate  : 0Mbps [4] Tx packets     : 0 [4] Tx packets last: 0 [4] Tx packets rate: 0 [4] Tx bytes       : 0 [4] Tx bytes last  : 0 [4] Tx bytes rate  : 0Mbps Tx amsdu cnt            : 0 Tx amsdu cnt last       : 0 Tx amsdu cnt rate       : 0 Tx amsdu pkt cnt        : 0 Tx amsdu pkt cnt last : 0 Tx amsdu pkt cnt rate : 0 Tx intr cnt             : 18 Tx intr last        : 0 Tx intr rate        : 0 Tx pending          : 0 Tx xmit skb realloc : 19 Tx stop queue cnt : 0 ====Rx accounting==== [0] Rx packets     : 0 [0] Rx packets last: 0 [0] Rx packets rate: 0 [0] Rx bytes       : 0 [0] Rx bytes last  : 0 [0] Rx bytes rate  : 0Mbps [1] Rx packets     : 0 [1] Rx packets last: 0 [1] Rx packets rate: 0 [1] Rx bytes       : 0 [1] Rx bytes last  : 0 [1] Rx bytes rate  : 0Mbps [2] Rx packets     : 0 [2] Rx packets last: 0 [2] Rx packets rate: 0 [2] Rx bytes       : 0 [2] Rx bytes last  : 0 [2] Rx bytes rate  : 0Mbps [3] Rx packets     : 0 [3] Rx packets last: 0 [3] Rx packets rate: 0 [3] Rx bytes       : 0 [3] Rx bytes last  : 0 [3] Rx bytes rate  : 0Mbps [4] Rx packets     : 0 [4] Rx packets last: 0 [4] Rx packets rate: 0 [4] Rx bytes       : 0 [4] Rx bytes last  : 0 [4] Rx bytes rate  : 0Mbps Rx amsdu cnt             : 0 Rx amsdu cnt last        : 0 Rx amsdu cnt rate        : 0 Rx amsdu pkt cnt         : 0 Rx amsdu pkt cnt last : 0 Rx amsdu pkt cnt rate : 0 Rx intr cnt      : 67 Rx intr last        : 0 Rx intr rate        : 0 Rx pending          : 0 Rx pause            : 0 Rx rdptr full cnt   : 0 root@imx8mqevk:~#                       CTT2 (AP):Responder + AP + Enrollee IMX8MPlus EVK + 88W8997 module   root@imx8mpevk:~# uname -a Linux imx8mpevk 6.12.49-lts-next-gdf24f9428e38 #1 SMP PREEMPT Fri Nov 21 03:24:46 UTC 2025 aarch64 GNU/Linux       root@imx8mpevk:~# cat /lib/firmware/nxp/wifi_mod_para.conf   PCIE8997 = {         cfg80211_wext=0xf         max_vir_bss=1         cal_data_cfg=none         ps_mode=1         auto_ds=1         host_mlme=1         fw_name=nxp/pcieuart8997_combo_v4.bin }   root@imx8mpevk:~# hostapd hostapd.conf -B & [1] 1731 root@imx8mpevk:~# HT (IEEE 802.11n) with WPA/WPA2 requires CCMP/GCMP to be enabled, disabling HT capabilities rfkill: Cannot open RFKILL control device uap0: interface state UNINITIALIZED->ENABLED uap0: AP-ENABLED   [1]+  Done                    hostapd hostapd.conf -B root@imx8mpevk:~# hostapd_cli hostapd_cli v2.11-M005 Copyright (c) 2004-2024, Jouni Malinen <j@w1.fi> and contributors   This software may be distributed under the terms of the BSD license. See README for more details.     Selected interface 'uap0'   Interactive mode > DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=02:e9:3a:0d:b8:cd //MAC address of CTT2 itself and returned 1 is bootstrap info id which require to get QR code in below command. 1> DPP_BOOTSTRAP_GET_URI 1 //Attention here, after this command, will generate a QR code, which will be use on CTT1 with command:DPP_QR_CODE. Then directly go to CTT1 to enter the QR Code. DPP:C:81/1;M:02e93a0db8cd;V:2;K:MDkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDIgACQOp5kWO1ex4L2U5rRXdS9yPYWA9NdRXTsuT+v5L/jvc=;;>     //Hold on here, and now go to CTT1 to authenticate this AP with above QR Code. After authenticate on CTT1 with QR Code, will auto output below logs. Pay attention on the keys and connectors info, will use them later when you update the AP.   > <3>DPP-RX src=fc:84:a7:51:87:fc freq=2412 type=0 <3>DPP-TX dst=fc:84:a7:51:87:fc freq=2412 type=1 <3>DPP-TX-STATUS dst=fc:84:a7:51:87:fc result=SUCCESS <3>DPP-RX src=fc:84:a7:51:87:fc freq=2412 type=2 <3>DPP-AUTH-SUCCESS init=0 pkhash=8b3e0f88b70610446a84f53ea9d792f5631b2b87e30cd219a8059c6f7893c501 own=1 peer=-1 <3>GAS-QUERY-START addr=fc:84:a7:51:87:fc dialog_token=0 freq=2412 <3>GAS-QUERY-DONE addr=fc:84:a7:51:87:fc dialog_token=0 freq=2412 status_code=0 result=SUCCESS <3>DPP-CONF-RECEIVED <3>DPP-CONFOBJ-AKM dpp <3>DPP-CONFOBJ-SSID test <3>DPP-CONNECTOR eyJ0eXAiOiJkcHBDb24iLCJraWQiOiJWV0hoQmp0enJVZ0xTSjhpTTJDRmRtNkxPQ0FFWHVCSWJEU3hzMEhaSDhnIiwiYWxnIjoiRVMyNTYifQ.eyJncm91cHMiOlt7Imdyb3VwSWQiOiIqIiwibmV0Um9sZSI6ImFwIn1dLCJuZXRBY2Nlc3NLZXkiOnsia3R5IjoiRUMiLCJjcnYiOiJQLTI1NiIsIngiOiJEbVRmSVFTRFNPVXVkVFBkN0pobEQtQ2xOa0U3U2lEWmctLWpYeGdNRXRJIiwieSI6Iml2NlVCc1J0YXhGSEpzcEtPbWFQSktqUmNDTFV5REh6WHFFeWtLbkhsOGcifX0.vEzfQywitO8AMvmcXenL_qidmkNl7t_jen2YW9OV8M5OID9jmTu-GqVUUkMEQE7R7Ja5vGnOMQ2-x-h7qyRKIQ <3>DPP-C-SIGN-KEY 3039301306072a8648ce3d020106082a8648ce3d0301070322000226d58dd75a168da8b901b47e01694868af2158d57db2984784349e12768e668b <3>DPP-NET-ACCESS-KEY 307702010104200be4b069c34a39d844fca856dd1e583a729e74f394370a4da8bc7d68d0dfadc2a00a06082a8648ce3d030107a144034200040e64df21048348e52e7533ddec98650fe0a536413b4a20d983efa35f180c12d28afe9406c46d6b114726ca4a3a668f24a8d17022d4c831f35ea13290a9c797c8 <3>DPP-TX dst=fc:84:a7:51:87:fc freq=2412 type=11 <3>DPP-TX-STATUS dst=fc:84:a7:51:87:fc result=SUCCESS   //Now update AP configurations on CTT2: //First disable AP: > disable <3>AP-DISABLED OK   //Update AP parameters: > set ssid test OK > set wpa 2 OK > set wpa_key_mgmt DPP OK > set ieee80211w 2 OK > set rsn_pairwise CCMP OK > set dpp_connector eyJ0eXAiOiJkcHBDb24iLCJraWQiOiJWV0hoQmp0enJVZ0xTSjhpTTJDRmRtNkxPQ0FFWHVCSWJEU3hzMEhaSDhnIiwiYWxnIjoiRVMyNTYifQ.eyJncm91cHMiOlt7Imdyb3VwSWQiOiIqIiwibmV0Um9sZSI6ImFwIn1dLCJuZXRBY2Nlc3NLZXkiOnsia3R5IjoiRUMiLCJjcnYiOiJQLTI1NiIsIngiOiJEbVRmSVFTRFNPVXVkVFBkN0pobEQtQ2xOa0U3U2lEWmctLWpYeGdNRXRJIiwieSI6Iml2NlVCc1J0YXhGSEpzcEtPbWFQSktqUmNDTFV5REh6WHFFeWtLbkhsOGcifX0.vEzfQywitO8AMvmcXenL_qidmkNl7t_jen2YW9OV8M5OID9jmTu-GqVUUkMEQE7R7Ja5vGnOMQ2-x-h7qyRKIQ OK > set dpp_csign 3039301306072a8648ce3d020106082a8648ce3d0301070322000226d58dd75a168da8b901b47e01694868af2158d57db2984784349e12768e668b OK > set dpp_netaccesskey 307702010104200be4b069c34a39d844fca856dd1e583a729e74f394370a4da8bc7d68d0dfadc2a00a06082a8648ce3d030107a144034200040e64df21048348e52e7533ddec98650fe0a536413b4a20d983efa35f180c12d28afe9406c46d6b114726ca4a3a668f24a8d17022d4c831f35ea13290a9c797c8 OK   //Re-enable the AP after updates: > enable <3>AP-ENABLED OK   //just wait here, it will output below logs after some seconds. > <3>DPP-RX src=20:4e:f6:bb:08:d9 freq=2412 type=5 <3>DPP-TX dst=20:4e:f6:bb:08:d9 freq=2412 type=6 status=0 <3>DPP-TX-STATUS dst=20:4e:f6:bb:08:d9 result=SUCCESS <3>AP-STA-CONNECTED 20:4e:f6:bb:08:d9 dpp_pkhash=74a40ec058ac8c7f7acb6589253e76f5d1a9582359353bcd5e6983ee97c3a382 <3>EAPOL-4WAY-HS-COMPLETED 20:4e:f6:bb:08:d9 > quit > root@imx8mpevk:~# cat /proc/mwlan/adapter0/uap0/info driver_name = "uap" driver_version = PCIE8997--w8997o-V4, RF878X, FP92, 16.92.21.p153.7-MM6X16540.p33-GPL-(FP92) interface_name="uap0" firmware_major_version=16.92.21 media_state="Connected" mac_address="02:e9:3a:0d:b8:cd" num_tx_bytes = 462 num_rx_bytes = 2248 num_tx_pkts = 4 num_rx_pkts = 20 num_tx_pkts_dropped = 0 num_rx_pkts_dropped = 0 num_tx_pkts_err = 60 num_rx_pkts_err = 0 carrier on tx queue 0:  started tx queue 1:  started tx queue 2:  started tx queue 3:  started tkip_mic_failures = 0 ccmp_decrypt_errors = 0 wep_undecryptable_count = 0 wep_icv_error_count = 0 decrypt_failure_count = 0 mcast_tx_count = 20 failed_count = 3 retry_count = 0 multiple_retry_count = 0 frame_duplicate_count = 0 rts_success_count = 0 rts_failure_count = 0 ack_failure_count = 30 rx_fragment_count = 55 mcast_rx_frame_count = 18 fcs_error_count = 401368 tx_frame_count = 22 rsna_tkip_cm_invoked = 0 rsna_4way_hshk_failures = 0 === tp_acnt.on:0 drop_point:0 === ====Tx accounting==== [0] Tx packets     : 0 [0] Tx packets last: 0 [0] Tx packets rate: 0 [0] Tx bytes       : 0 [0] Tx bytes last  : 0 [0] Tx bytes rate  : 0Mbps [1] Tx packets     : 0 [1] Tx packets last: 0 [1] Tx packets rate: 0 [1] Tx bytes       : 0 [1] Tx bytes last  : 0 [1] Tx bytes rate  : 0Mbps [2] Tx packets     : 0 [2] Tx packets last: 0 [2] Tx packets rate: 0 [2] Tx bytes       : 0 [2] Tx bytes last  : 0 [2] Tx bytes rate  : 0Mbps [3] Tx packets     : 0 [3] Tx packets last: 0 [3] Tx packets rate: 0 [3] Tx bytes       : 0 [3] Tx bytes last  : 0 [3] Tx bytes rate  : 0Mbps [4] Tx packets     : 0 [4] Tx packets last: 0 [4] Tx packets rate: 0 [4] Tx bytes       : 0 [4] Tx bytes last  : 0 [4] Tx bytes rate  : 0Mbps Tx amsdu cnt            : 0 Tx amsdu cnt last       : 0 Tx amsdu cnt rate       : 0 Tx amsdu pkt cnt        : 0 Tx amsdu pkt cnt last : 0 Tx amsdu pkt cnt rate : 0 Tx intr cnt             : 22 Tx intr last        : 0 Tx intr rate        : 0 Tx pending          : 0 Tx xmit skb realloc : 64 Tx stop queue cnt : 0 ====Rx accounting==== [0] Rx packets     : 0 [0] Rx packets last: 0 [0] Rx packets rate: 0 [0] Rx bytes       : 0 [0] Rx bytes last  : 0 [0] Rx bytes rate  : 0Mbps [1] Rx packets     : 0 [1] Rx packets last: 0 [1] Rx packets rate: 0 [1] Rx bytes       : 0 [1] Rx bytes last  : 0 [1] Rx bytes rate  : 0Mbps [2] Rx packets     : 0 [2] Rx packets last: 0 [2] Rx packets rate: 0 [2] Rx bytes       : 0 [2] Rx bytes last  : 0 [2] Rx bytes rate  : 0Mbps [3] Rx packets     : 0 [3] Rx packets last: 0 [3] Rx packets rate: 0 [3] Rx bytes       : 0 [3] Rx bytes last  : 0 [3] Rx bytes rate  : 0Mbps [4] Rx packets     : 0 [4] Rx packets last: 0 [4] Rx packets rate: 0 [4] Rx bytes       : 0 [4] Rx bytes last  : 0 [4] Rx bytes rate  : 0Mbps Rx amsdu cnt             : 0 Rx amsdu cnt last        : 0 Rx amsdu cnt rate        : 0 Rx amsdu pkt cnt         : 0 Rx amsdu pkt cnt last : 0 Rx amsdu pkt cnt rate : 0 Rx intr cnt      : 28229 Rx intr last        : 0 Rx intr rate        : 0 Rx pending          : 0 Rx pause            : 0 Rx rdptr full cnt   : 0 root@imx8mpevk:~#            
記事全体を表示
Most available example applications use UART as the serial interface for terminal communication. This approach is commonly chosen because a terminal provides a simple and efficient method for interacting with the application during development and debugging. The KW47-EVK supports two CAN/CAN-FD interface; as well as two UART interfaces accessible through the onboard USB-to-UART bridge.  The corresponding SoC peripheral instances are CAN0 and CAN1 for the CAN/CAN‑FD interfaces, and LPUART0 and LPUART1 for the UART interfaces. Since the LPUART1 serial interface and the CAN1 interface are routed to the same pins (PTC2 and PTC3) at the board level, and both functions can be enabled through header configuration, external isolation is required to ensure correct operation and prevent interference from other onboard components. If CAN1 must be enabled and your application also requires a serial terminal interface, then LPUART0 must be used as the serial interface.To enable both CAN1 and LPUART0 on the KW47‑EVK, follow the steps below: Changes required on hardware CAN Node A CAN Node B Pin name Board jumper Pin name Board jumper CANH J21 - 1 CANH J21 - 1 CANL J21 - 2 CANL J21 - 2 GND J21 - 4 GND J21 - 4 P12V J21 - 3 P12V J21 - 3  Note: Plug in the 12V power supply on J9 to supply the P5V_CAN. LPUART0 interface connection Functionality Board jumper Connection configuration LIN_RX JP11 2 - 3 LIN_TX JP12 2 - 3 UART_RX_USB selector JP16 2 - 3 UART_TX_USB selector JP17 2 - 3 CAN_RX_1 selector JP56 1 - 2 CAN_TX_1 selector JP57 1 - 2   Changes required on software Note: These steps assume you are using a FlexCAN SDK example application. If your application requires enabling CAN1 instead of the default CAN0, update the following configuration in your project’s source code: 1. In board.c, modify the LPUART instance, kCLOCK_Lpuart1 -> kCLOCK_Lpuart0: /* Initialize debug console. */ void BOARD_InitDebugConsole(void) { uint32_t uartClkSrcFreq = 0U; /* Set LPUART0 clock source */ CLOCK_SetIpSrc(kCLOCK_Lpuart0, kCLOCK_IpSrcFro192M); uartClkSrcFreq = CLOCK_GetIpFreq(kCLOCK_Lpuart0); DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq); } 2. In board.h, modify the LPUART instance definitions: BOARD_DEBUG_UART_BASEADDR LPUART1 -> LPUART0 BOARD_DEBUG_UART_INSTANCE 1U -> 0U BOARD_DEBUG_UART_CLK_FREQ kCLOCK_Lpuart1 -> kCLOCK_Lpuart0 /* The UART to use for debug messages. */ #define BOARD_USE_LPUART #define BOARD_DEBUG_UART_TYPE kSerialPort_Uart #define BOARD_DEBUG_UART_BASEADDR (uint32_t) LPUART0 #define BOARD_DEBUG_UART_INSTANCE 0U #define BOARD_DEBUG_UART_CLK_FREQ (CLOCK_GetIpFreq(kCLOCK_Lpuart0)) 3. In hardware_init.c, modify the CAN instance to CAN1 at FlexCAN functional clock configuration: void BOARD_InitHardware(void) { BOARD_InitPins(); BOARD_BootClockRUN(); BOARD_InitDebugConsole(); /* FRO192M is configured as CAN1 functional clock in this example but other clock options may be available */ CLOCK_SetIpSrc(kCLOCK_Can1, kCLOCK_IpSrcFro192M); CLOCK_SetIpSrcDiv(kCLOCK_Can1, kSCG_SysClkDivBy1); } 4. In app.h, modify the EXAMPLE_CAN definition to CAN1: #define EXAMPLE_CAN CAN1 #define USE_CANFD (1) #define RX_MESSAGE_BUFFER_NUM (0) #define TX_MESSAGE_BUFFER_NUM (1) 5. In pin_mux.c, modify pin multiplexing configuration to enable CAN1 and LPUART0 pins respectively. You can copy and paste the below code to replace BOARD_InitPins function: void BOARD_InitPins(void) { /* Clock Config: Peripheral clocks are enabled; module does not stall low power mode entry */ CLOCK_EnableClock(kCLOCK_PortA); CLOCK_EnableClock(kCLOCK_PortC); const port_pin_config_t porta16_pin11_config = {/* Internal pull-up/down resistor is disabled */ (uint16_t)kPORT_PullDisable, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as LPUART0_RX */ (uint16_t)kPORT_MuxAlt6, /* Does not invert */ (uint16_t)kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTA16 (pin 11) is configured as LPUART0_RX */ PORT_SetPinConfig(PORTA, 16U, &porta16_pin11_config); const port_pin_config_t porta17_pin12_config = {/* Internal pull-up/down resistor is disabled */ (uint16_t)kPORT_PullDisable, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as LPUART0_TX */ (uint16_t)kPORT_MuxAlt6, /* Does not invert */ (uint16_t)kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTA17 (pin 12) is configured as LPUART0_TX */ PORT_SetPinConfig(PORTA, 17U, &porta17_pin12_config); const port_pin_config_t portc2_pin39_config = {/* Internal pull-up/down resistor is disabled */ (uint16_t)kPORT_PullDisable, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as CAN1_RX */ (uint16_t)kPORT_MuxAlt11, /* Does not invert */ (uint16_t)kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTC2 (pin 39) is configured as CAN1_RX */ PORT_SetPinConfig(PORTC, 2U, &portc2_pin39_config); const port_pin_config_t portc3_pin40_config = {/* Internal pull-up/down resistor is disabled */ (uint16_t)kPORT_PullDisable, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as CAN1_TX */ (uint16_t)kPORT_MuxAlt11, /* Does not invert */ (uint16_t)kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTC3 (pin 43) is configured as CAN1_TX */ PORT_SetPinConfig(PORTC, 3U, &portc3_pin40_config); } Run your demo application Connect a USB cable between the host PC and the KW47-EVK board J14. Open a serial terminal on PC for each board with the following settings: 115200 baud rate 8 data bits No parity One stop bit No flow control Download the program to the target board Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
記事全体を表示
As mentionned in the KW47/MCXW72 errata, a DCDC failure can occur infrequently during a drive strength change to low, and the DCDC output voltage becomes greater than or equal to the current output voltage. To avoid this particular case from happening, a software workaround can be implemented to make the voltage level at the low-power low drive-strength mode lower than the current output voltage of the DCDC. We will take the low power peripheral reference design demo application as example to show the workaround implementation. First of all, the default DCDC configuration in this demo project will never trigger this DCDC failure, because the DCDC is always in low drive-strength mode. To force it to the failure condition, we have to change the DCDC setting in board_dcdc.c. The DCDC configuration should be set to Normal drive strength mode, and the output voltage to 1.25V. BOARD_DCDC_config(kSPC_DCDC_NormalDriveStrength, kSPC_DCDC_LowUnderVoltage, false); The workaround requires the SPC high power mode to be enabled. SPC0->HP_CNFG_CTRL |= SPC_HP_CNFG_CTRL_HP_REQ_EN_MASK; The DCDC output voltage during high power mode is to set to 1.35V (higher than that of the active mode and low power mode): RF_CMC1->SPC_HP_CTRL |= 0x2U;   The SPC_HP mode is to be enabled just at the moment before going into low power mode. To do this, the nbu_ble project needs to be modified, and the NBU needs to be reprogrammed with this change. In the nbu_ble project, please modify the file fwk_platform_lowpower.c. The function PLATFORM_HandleLowPowerEntry manages the low power mode entry, thus we can add here: RF_CMC1->SPC_HP_CTRL |= 0x1U; //enable HP mode while ((RF_CMC1->SPC_HP_STAT && RF_CMC1_SPC_HP_STAT_SPC_HP_ACK_MASH) == 0); //wait for HP mode requested to be ackownledged RF_CMC1->SPC_HP_CTRL &= 0x0U; //disable HP mode while ((RF_CMC1->SPC_HP_STAT && RF_CMC1_SPC_HP_STAT_SPC_HP_ACK_MASH) == 0); //wait for HP mode requested to be ackownledged /* WFI will trigger low power entry procedure */ __DSB(); __WFI(); __ISB();   Please note that this workaround is valid for all wireless connectivity examples where low power mode is used. It does not apply to non-connectivity examples.    
記事全体を表示
This pages is used to log key items related with KW4X products evaluation, development with SDK, power and RF performance evaluation, etc.
記事全体を表示
This post provides guidance on how to port the example projects from the NXP NCI 2.0 NFC library to the MCXW71 Wireless MCU using SPI interface to communicate with PN7160 SPI EVK. To follow this guide, please use the following environment: MCUXpresso IDE 25.06.136. FRDM-MCXW71 SDK v25.12.00 (last available for MCUXpresso IDE). FRDM-MCXW71. OM27160B1 (PN7160 SPI EVK). Hardware Setup. The MCXW71 complies with the Arduino header standard as the OM27160B1 board, therefore you can connect directly the shield over the FRDM-MCXW71 as the pin connection match among both, allowing an easy connection between the devices. Take into consideration that this setup forces us to use the LPSPI1 instance of the MCXW71, it is possible to use another instance, but we would not be able to connect the boards directly, rather we would need to do the connections with jumpers.   Downloading base projects and adapting for MCXW71 port. To start with the porting work, download the NXP-NCI example project from this page. This compressed file contains the base project for different boards that will allow us to do the required modifications to add support for the MCXW71. Once downloaded, extract the SW6705 file into a known path (e.g. the Downloads folder) to later import the project to the IDE. The extracted folder should contain a .zip file with the examples that we will later import to the IDE. Download the FRDM-MCXW71's SDK from the SDK Builder page, make sure to select the 25.12.00 version, as it is the latest SDK available to use along the MCUXpresso IDE. Now we have to import the NXP-NCI2.0_MCUXpresso_examples.zip file we previously extracted to the IDE's workspace, to do so, click on the Import project(s) from file system and in the Project archive (zip) tab, browse for the extracted file of step 1 (NXP-NCI2.0_MCUXpresso_examples.zip) and click on Next >. NOTE: Don’t worry if the IDE shows an error message for not having the SDKs of the default boards (iMXRT1170, LPC55S6x, LPC82x) or having a different version, close the warning message, we only need these examples to copy the NCI library and example files. Your workspace should now look like the following image: Import the hello_world example from the FRDM-MCXW71 SDK: Add the SPI drivers to the imported project by right clicking over the project, hover the cursor over the SDK Management option and select the option Manage SDK Components: Select the driver, click Ok and if you are asked to refresh files accept it, after this you should be able to see the driver in the "drivers" folder of the project. Copy the contents of the source folder of the iMXRT1170 project, as well as the NfcLibrary folder and paste them into the imported hello_world project:   Make sure to delete the hello_world.c and hello_word.mex files as we won't need it again. After this process your project should look like the following image: To avoid compiling issues, exclude from the build the files nfc_example_P2P.c and nfc_example_RW.c, to do so right click on the file, go to Resource Configurations and select Exclude from Build… and select for all configurations. Do this for each file. Add the preprocessor macro: BOARD_NXPNCI_INTERFACE_SPI, as this is used by the example to select the interface with the board. To do this, right-click on the project and select Properties, then drop-down the C/C++ Build option and go to the Settings tab. Here, add the macro in the Preprocessor option, click on Apply and accept the index rebuild. Add the root folder in C/C++ General > Paths and Symbols > Source Location tab, click on Ok and then Apply: Still in Paths and Symbols, go to the Includes tab and add the source, TML and tool folders from workspace, click Ok and Apply. Make sure to add them one by one. Now, go to C/C++ Build > Settings > Includes and add the following folders from Workspace. You can select all of them and add them at the same time or also do it one by one. Once done, click on Apply and Apply and Close. If you are asked to rebuild the index, do it. "${workspace_loc:/${ProjName}/source/TML}" "${workspace_loc:/${ProjName}/source/tool}" "${workspace_loc:/${ProjName}/NfcLibrary}" "${workspace_loc:/${ProjName}/NfcLibrary/inc}" "${workspace_loc:/${ProjName}/NfcLibrary/NdefLibrary}" "${workspace_loc:/${ProjName}/NfcLibrary/NdefLibrary/inc}" "${workspace_loc:/${ProjName}/NfcLibrary/NdefLibrary/src}" "${workspace_loc:/${ProjName}/NfcLibrary/NxpNci20}" "${workspace_loc:/${ProjName}/NfcLibrary/NxpNci20/inc}" "${workspace_loc:/${ProjName}/NfcLibrary/NxpNci20/src}" Source Code Changes. In the board folder, open the board.h file and add the following definitions to refer to the peripherals and clocks to be used. Please notice that you may change the LPSPI instance, however you would need to connect jumpers instead of connecting directly the shield over the FRDM. #ifdef BOARD_NXPNCI_INTERFACE_SPI #define BOARD_NXPNCI_SPI_CLOCK (CLOCK_GetIpFreq(kCLOCK_Lpspi1)) #define BOARD_NXPNCI_SPI_INSTANCE (LPSPI1) #define BOARD_NXPNCI_SPI_BAUDRATE (400000) #endif #define BOARD_NXPNCI_IRQ_PORT (GPIOC) // J2.10 - GPIO0 [PN7160] - IRQ -> J2.10 GPIOC0 [MCXW71] #define BOARD_NXPNCI_VEN_PORT (GPIOA) // J4.1 - GPIO1 [PN7160] - VEN -> J1.8 GPIOA21 [MCXW71] #define BOARD_NXPNCI_DWL_PORT (GPIOA) // J4.2 - GPIO2 [PN7160] - REQ -> J1.7 GPIOA20 [MCXW71] #define BOARD_NXPNCI_IRQ_PIN (0U) #define BOARD_NXPNCI_VEN_PIN (21U) #define BOARD_NXPNCI_DWL_PIN (20U) Now we need to add the required clock, peripheral and pin initialization for our board. To do this, go to the hardware_init.c file inside the board folder, and overwrite the BOARD_InitHardware function with the following: void BOARD_InitHardware(void) { BOARD_InitPins(); BOARD_BootClockRUN(); BOARD_InitDebugConsole(); CLOCK_SetIpSrc(kCLOCK_Lpspi1, kCLOCK_IpSrcFro192M); CLOCK_SetIpSrcDiv(kCLOCK_Lpspi1, kSCG_SysClkDivBy16); }   To add the correct pin multiplexing and configuration for our SPI and GPIO pins, go to the pin_mux.c file (also in the board folder) and overwrite the BOARD_InitPins function with the following: void BOARD_InitPins(void) { /* Clock Configuration: Peripheral clocks are enabled; module does not stall low power mode entry */ CLOCK_EnableClock(kCLOCK_GpioA); CLOCK_EnableClock(kCLOCK_GpioC); CLOCK_EnableClock(kCLOCK_PortA); CLOCK_EnableClock(kCLOCK_PortB); CLOCK_EnableClock(kCLOCK_PortC); /*IF SHORTING SH11, SH12, SH13, SH14 needed for LPSPI1*/ const port_pin_config_t portb0_pin46_config = {/* Internal pull-up resistor is enabled */ (uint16_t)kPORT_PullUp, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as LPSPI0_PCS0 */ (uint16_t)kPORT_MuxAlt2, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTB0 (pin 46) is configured as LPSPI1_PCS0 */ PORT_SetPinConfig(PORTB, 0U, &portb0_pin46_config); const port_pin_config_t portb1_pin47_config = {/* Internal pull-up resistor is enabled */ (uint16_t)kPORT_PullUp, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as LPSPI0_SIN */ (uint16_t)kPORT_MuxAlt2, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTB1 (pin 47) is configured as LPSPI1_SIN */ PORT_SetPinConfig(PORTB, 1U, &portb1_pin47_config); const port_pin_config_t portb3_pin1_config = {/* Internal pull-up resistor is enabled */ (uint16_t)kPORT_PullUp, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as LPSPI0_SOUT */ (uint16_t)kPORT_MuxAlt2, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTB3 (pin 1) is configured as LPSPI1_SOUT */ PORT_SetPinConfig(PORTB, 3U, &portb3_pin1_config); const port_pin_config_t portb2_pin48_config = {/* Internal pull-up resistor is enabled */ (uint16_t)kPORT_PullUp, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as LPSPI0_SCK */ (uint16_t)kPORT_MuxAlt2, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTA19 (pin 14) is configured as LPSPI1_SCK */ PORT_SetPinConfig(PORTB, 2U, &portb2_pin48_config); /*IF SHORTING SH11, SH12, SH13, SH14 needed for LPSPI1*/ const port_pin_config_t irq_pin = {/* Internal pull-up/down resistor is disabled */ (uint16_t)kPORT_PullUp, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as PTC0 */ (uint16_t)kPORT_MuxAsGpio, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTC0 (pin 37) is configured as PTC0 */ PORT_SetPinConfig(PORTC, 0U, &irq_pin); const port_pin_config_t ven_pin = {/* Internal pull-up/down resistor is disabled */ (uint16_t)kPORT_PullDisable, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as PTA20 */ (uint16_t)kPORT_MuxAsGpio, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTA20 (pin 17) is configured as PTA20 */ PORT_SetPinConfig(PORTA, 20U, &ven_pin); const port_pin_config_t req_pin = {/* Internal pull-up/down resistor is disabled */ (uint16_t)kPORT_PullDisable, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as PTA21 */ (uint16_t)kPORT_MuxAsGpio, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTA21 (pin 18) is configured as PTA21 */ PORT_SetPinConfig(PORTA, 21U, &req_pin); const port_pin_config_t portc2_pin39_config = {/* Internal pull-up/down resistor is disabled */ (uint16_t)kPORT_PullDisable, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as LPUART1_RX */ (uint16_t)kPORT_MuxAlt3, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTC2 (pin 39) is configured as LPUART1_RX */ PORT_SetPinConfig(PORTC, 2U, &portc2_pin39_config); const port_pin_config_t portc3_pin40_config = {/* Internal pull-up/down resistor is disabled */ (uint16_t)kPORT_PullDisable, /* Low internal pull resistor value is selected. */ (uint16_t)kPORT_LowPullResistor, /* Fast slew rate is configured */ (uint16_t)kPORT_FastSlewRate, /* Passive input filter is disabled */ (uint16_t)kPORT_PassiveFilterDisable, /* Open drain output is disabled */ (uint16_t)kPORT_OpenDrainDisable, /* Low drive strength is configured */ (uint16_t)kPORT_LowDriveStrength, /* Normal drive strength is configured */ (uint16_t)kPORT_NormalDriveStrength, /* Pin is configured as LPUART1_TX */ (uint16_t)kPORT_MuxAlt3, /* Pin Control Register fields [15:0] are not locked */ (uint16_t)kPORT_UnlockRegister}; /* PORTC3 (pin 40) is configured as LPUART1_TX */ PORT_SetPinConfig(PORTC, 3U, &portc3_pin40_config); }   To add the required interfacing APIs specific of our chip, we need to modify the tml.c file from the TML folder, in this file overwrite the functions: INTF_INIT, INTF_WRITE and INTF_READ with the following: static void INTF_INIT(void) { lpspi_master_config_t userConfig; uint32_t srcFreq = 0; /*SPI configuration*/ LPSPI_MasterGetDefaultConfig(&userConfig); userConfig.baudRate = BOARD_NXPNCI_SPI_BAUDRATE; srcFreq = BOARD_NXPNCI_SPI_CLOCK; userConfig.whichPcs = (lpspi_which_pcs_t)kLPSPI_Pcs0; userConfig.pcsActiveHighOrLow = (lpspi_pcs_polarity_config_t)kLPSPI_PcsActiveLow; /*Initialize SPI*/ LPSPI_MasterInit(BOARD_NXPNCI_SPI_INSTANCE, &userConfig, srcFreq); } static status_t INTF_WRITE(uint8_t *pBuff, uint16_t buffLen) { uint8_t temp[1000]; temp[0] = 0x7F; memcpy(temp+1, pBuff, buffLen); masterXfer.txData = temp; masterXfer.rxData = NULL; masterXfer.dataSize = buffLen+1; masterXfer.configFlags = kLPSPI_MasterPcs0 | kLPSPI_MasterPcsContinuous | kLPSPI_MasterByteSwap;; return LPSPI_MasterTransferBlocking(BOARD_NXPNCI_SPI_INSTANCE, &masterXfer); } static status_t INTF_READ(uint8_t *pBuff, uint16_t buffLen) { status_t status; uint8_t temp[257]; temp[0] = 0xFF; masterXfer.txData = temp; masterXfer.rxData = temp; masterXfer.dataSize = buffLen+1; masterXfer.configFlags = kLPSPI_MasterPcs0 | kLPSPI_MasterPcsContinuous | kLPSPI_MasterByteSwap;; status = LPSPI_MasterTransferBlocking(BOARD_NXPNCI_SPI_INSTANCE, &masterXfer); if(status == kStatus_Success) memcpy(pBuff, temp+1, buffLen); SDK_DelayAtLeastUs(10, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); return status; } #endif   We also need to overwrite the functions: tml_Init, tml_DeInit and tml_Reset to adapt them to use the specific APIs for the GPIOs of our board. static Status tml_Init(void) { gpio_pin_config_t in_config = {kGPIO_DigitalInput, 0}; gpio_pin_config_t out_config = {kGPIO_DigitalOutput, 0}; GPIO_PinInit(BOARD_NXPNCI_IRQ_PORT, BOARD_NXPNCI_IRQ_PIN, &in_config); GPIO_PinInit(BOARD_NXPNCI_VEN_PORT, BOARD_NXPNCI_VEN_PIN, &out_config); GPIO_PinInit(BOARD_NXPNCI_DWL_PORT, BOARD_NXPNCI_DWL_PIN, &out_config); INTF_INIT(); return SUCCESS; } static Status tml_DeInit(void) { GPIO_PortClear(BOARD_NXPNCI_VEN_PORT, 1U << BOARD_NXPNCI_VEN_PIN); return SUCCESS; } static Status tml_Reset(void) { /* Set DWL_REQ low for NCI protocol */ GPIO_PortClear(BOARD_NXPNCI_DWL_PORT, 1U << BOARD_NXPNCI_DWL_PIN); GPIO_PortClear(BOARD_NXPNCI_VEN_PORT, 1U << BOARD_NXPNCI_VEN_PIN); Sleep(10); GPIO_PortSet(BOARD_NXPNCI_VEN_PORT, 1U << BOARD_NXPNCI_VEN_PIN); Sleep(10); return SUCCESS; }   Finally, modify the main file so it uses the APIs to initialize our board clocks and pins: #include <stdio.h> #include <string.h> #include "app.h" #include "board.h" #include "pin_mux.h" #include "fsl_debug_console.h" extern void nfc_example (void); int main(void) { BOARD_InitHardware(); #ifdef BOARD_NXPNCI_INTERFACE_I2C PRINTF("\nRunning the NXP-NCI2.0 example (I2C interface)\n"); #else PRINTF("\nRunning the NXP-NCI2.0 example (SPI interface)\n"); #endif nfc_example(); } Testing the example. At this point we have everything set to build and flash our example with SPI interface, you may proceed to build and debug/flash the example by pressing the blue beetle button: Once the example is flashed, open a serial terminal such as Teraterm with the following settings: Baudrate: 115200. Data: 8 bits. Parity: None. Stop bits: 1 bit. No flow control. While running, the example should output the following logs to the terminal: When a tag is placed near the antenna, the example should print the tag information in the terminal as shown:
記事全体を表示
Be aware that it is necessary to work with the matching narrow band unit (NBU) image for the SDK version of the application you are working with. This means that when you download your SDK, prior to loading any wireless SDK example, update your NBU image with the provided binaries in the following folder of the SDK: ../middleware/wireless/ble-controller/bin   Here you will find the image for the NBU firmware:   To update the NBU, you may use the LinkFlash tool as follow: Open the path to LinkFlash tool. Usually, this path would be: C:\nxp\LinkServer_xx.x.xx ​ Select  KW47B42ZB7xxxA:KW47-EVK  as device, serial wire debug (SWD) as protocol and 0x48800000 as address. Check the 'Mass erase before programming' checkbox. Select ' kw47_nbu_ble_all_hosted.bin ' as image file. Press the 'Program' button and wait for the flash operation to be completed.    
記事全体を表示