cancel
Showing results for 
Search instead for 
Did you mean: 

Issues Running BLE_Beacon with X-NUCLEO-BNRG2A1 in UART Network Coprocessor Mode

shak2300
Associate II

I’m using the X-NUCLEO-BNRG2A1 in network coprocessor mode (UART), but I’m stuck trying to run the BLE_Beacon example.

Here is what I have done so far:

  1. I followed the AN5651 guide using a NUCLEO-L433RC-P.

  2. Since BlueNRG-1ST-LINK does not work on Windows 11, I used RF-Flasher Utility to flash the DTM_UART.hex file onto the X-NUCLEO. I took this hex file from the STSW-BLUENRG1-DK package
    This part worked correctly, and the X-NUCLEO is now configured as a network coprocessor through UART.

The problem appears on the STM32 side.

The STSW-BLUENRG1-DK package includes several applications such as BLE_Beacon, but they are written for EWARM (IAR) and are not integrated into CubeIDE.
I tried flashing BLE_Beacon_NWK_UART.hex to my NUCLEO STM32 board using CubeProgrammer, but after it configured, the communication with the module doesn't work. I assume this is because the application is configured for the NUCLEO-L476RG, not the L433, so the pins or hardware settings do not match.

As a result, I’m stuck and unable to start a BLE Beacon application using the network coprocessor.

I also looked into X-CUBE-BLE2, but the examples provided with CubeMX/CubeIDE seem to support only the SPI interface. If UART is supported, I haven't been able to find how.


Could you help me set up a working environment between a NUCLEO STM32 and the X-NUCLEO-BNRG2A1 in network coprocessor mode using UART in CubeIDE? Is there an example I can use with the X-NUCLEO and an STM32 as a Beacon?

1 ACCEPTED SOLUTION

Accepted Solutions
shak2300
Associate II

Corrected Guide – BLE_Beacon with X-NUCLEO-BNRG2A1

After several attempts, I was finally able to run the BLE_Beacon application correctly. The main issue was related to the UART pin configuration, which is unclear and inconsistent in the official documentation.

I hope this guide can help anyone who encountered similar difficulties. It is also clear that the current ST documentation should be updated.


Important note about UART pins

In the X-NUCLEO-BNRG2A1 documentation, the UART pins are reported as:

  • DIO4

  • DIO5

However, if you use the STSW-BLUENRG1-DK package to load the firmware, the actual UART pins without flow control used by the device are:

  • DIO8 (TX)

  • DIO11 (RX)

:warning: Warning: for DIO11, you must populate the resistor R76, otherwise the UART communication will not work correctly.


X-NUCLEO-BNRG2A1 firmware

  1. Power the expansion board from the NUCLEO 3V3 supply.

    • Do not plug the expansion board directly onto the NUCLEO, as this may cause errors.

    • Instead, create a direct connection using SWD and power supply pins.

  2. Use RF-Flasher Utility to flash the firmware:

    • DTM_UART.hex


NUCLEO-L476RG firmware

  1. Use STM32CubeProgrammer.

  2. Flash the .hex or .bin file named:

    • BLE_Beacon_NWK_UART

:warning: This firmware is specifically designed for the NUCLEO-L476RG and cannot be reused as-is on other NUCLEO boards.


Hardware connections

  • Connect the two devices using physical wires.

  • Make sure to also connect the RSTN pin.

  • Carefully verify:

    • Power supply

    • Common GND

    • Correct UART lines (DIO8 / DIO11)


Verifying correct operation

Using the nRF Connect application, you should be able to see your BLE device advertising correctly as a beacon.


Using X-CUBE-BLE2 (recommended for portability)

It is also possible to use X-CUBE-BLE2, with a small software modification:

  • Modify the hci_tl_interface file, which only manages the communication type.

  • Create an interrupt to read each byte received from the UART interface.

  • Store the received bytes into a buffer.

  • Once the reception is complete, call the function:

    hci_tl_lowlevel_isr();

No other changes are required.

:white_heavy_check_mark: Key advantage: unlike the provided BLE_Beacon firmware, X-CUBE-BLE2 can be used with any STM32 NUCLEO board, making it a more flexible and portable solution.


Attachments

A working example for the NUCLEO-L476RG is provided as an attachment.

View solution in original post

1 REPLY 1
shak2300
Associate II

Corrected Guide – BLE_Beacon with X-NUCLEO-BNRG2A1

After several attempts, I was finally able to run the BLE_Beacon application correctly. The main issue was related to the UART pin configuration, which is unclear and inconsistent in the official documentation.

I hope this guide can help anyone who encountered similar difficulties. It is also clear that the current ST documentation should be updated.


Important note about UART pins

In the X-NUCLEO-BNRG2A1 documentation, the UART pins are reported as:

  • DIO4

  • DIO5

However, if you use the STSW-BLUENRG1-DK package to load the firmware, the actual UART pins without flow control used by the device are:

  • DIO8 (TX)

  • DIO11 (RX)

:warning: Warning: for DIO11, you must populate the resistor R76, otherwise the UART communication will not work correctly.


X-NUCLEO-BNRG2A1 firmware

  1. Power the expansion board from the NUCLEO 3V3 supply.

    • Do not plug the expansion board directly onto the NUCLEO, as this may cause errors.

    • Instead, create a direct connection using SWD and power supply pins.

  2. Use RF-Flasher Utility to flash the firmware:

    • DTM_UART.hex


NUCLEO-L476RG firmware

  1. Use STM32CubeProgrammer.

  2. Flash the .hex or .bin file named:

    • BLE_Beacon_NWK_UART

:warning: This firmware is specifically designed for the NUCLEO-L476RG and cannot be reused as-is on other NUCLEO boards.


Hardware connections

  • Connect the two devices using physical wires.

  • Make sure to also connect the RSTN pin.

  • Carefully verify:

    • Power supply

    • Common GND

    • Correct UART lines (DIO8 / DIO11)


Verifying correct operation

Using the nRF Connect application, you should be able to see your BLE device advertising correctly as a beacon.


Using X-CUBE-BLE2 (recommended for portability)

It is also possible to use X-CUBE-BLE2, with a small software modification:

  • Modify the hci_tl_interface file, which only manages the communication type.

  • Create an interrupt to read each byte received from the UART interface.

  • Store the received bytes into a buffer.

  • Once the reception is complete, call the function:

    hci_tl_lowlevel_isr();

No other changes are required.

:white_heavy_check_mark: Key advantage: unlike the provided BLE_Beacon firmware, X-CUBE-BLE2 can be used with any STM32 NUCLEO board, making it a more flexible and portable solution.


Attachments

A working example for the NUCLEO-L476RG is provided as an attachment.