How to use MAC 802.15.4 Association and Data exchange.
MAC, 802.15.4, association, data, STM32WBA, Node, LPUART, Active scan, diassociate, data poll, RTC timer
Mac_802_15_4/Mac_802_15_4_RFD/
This example runs on STM32WBA52xx devices.
This example has been tested with an STMicroelectronics STM32WBA52CG-Nucleo board and can be easily tailored to any other supported device and development board.
On STM32WBA52CG-Nucleo, the jumpers must be configured as described in this section. Starting from the top left position up to the bottom right position, the jumpers on the Board must be set as follows:
This application requires two STM32WBA52xx-Nucleo boards. One device will act as 802.15.4 coordinator ensuring association response and network establishment. The other device will act as a MAC 802.15.4 - Node. The Node request association on startup and send data to the coordinator.
Below example implements the Node Devices.
Minimum requirements for the demo:
In order to make the program work, you must do the following:
Connect 2 STM32WBA52xx-Nucleo boards to your PC
To get the traces in real time, you can connect an HyperTerminal to the LPUART PIN CN3-32.
The Serial interface must be configured as follows:
You can also use an MAC 802.15.4 over the air sniffer on channel write on HyperTerminal to spy MAC 802.15.4 frames exchanged between the devices.
START DEMO
By default, after a reset, both board starts. Coordinator must be started firstly to be able to answer to the node association request.
This MAC 802.15.4 example is to demonstrate Point-to-Point communication using MAC components between a FFD (ie.: the COORDINATOR) and an RFD (ie.: the NODE).
Upon COORDINATOR start, the device initializes the MAC 802.15.4 and associates resources in non-beaconned enable mode.
MAC PIB is then configured as follow :
Once MAC PIB is initialized, Coordinator is started on least noisy channel with ED scan as an association capable coordinator. At this stage the Coordinator is waiting for an association request. Blue LED (ID 1) is switch on once the coordinator is started.
On Node side, the MAC layer is initialized on startup. In this state, blue LED (ID 1) is switch on.
The Node device can recognize the coordinator device with the beacon payload define in app_conf.h on both devices.
Node issues an association request to the Coodinator to retrieve its short address. On in coming association request Coordinator’s green LED (ID 2) blinks.
Once the association between two devices is completed, Node’s green LED (ID 2) is switch on to indicate the node is associated to the coordinator.
The Node sends data to the coordinator that issues a Data Indication. On both devices side, on data transmission red led (ID 3) blinked.
User can issue data from Node to Coordinator, by pressing the button 1 (SW1). Data transmission with poll request every 5 seconds can be then observe using OTA sniffer, UART logs and LED status.
User can issue data from Node in broadcast, by pressing the button 2 (SW2). Data transmission can be then observe using OTA sniffer, UART logs and LED status.
User can issue disassociate from the Coordinator, by pressing the button 3 (SW3). Data transmission can be then observe using OTA sniffer, UART logs and LED status.