This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

STM32F411 to NRF51822 to Android Phone

Development Environment

S130 / SDK_12.3.0 Central Central NRF51 DONGLE

S130 / SDK_12.3.0 Central Peri NRF51822 + STM32F411

 

BUART_BAUDRATE_BAUDRATE_Baud115200

Hi, I am trying to implement BLE communication by sending STM32 data to the NRF.

I tested  STM32 UART communication to NRF51822 by Terminal Program,'Teraterm'.  and checked normal operation.

and, I tested nrf51822 and nrf51 dongle communication by Terminal Program,'Teraterm'.  and checked normal operation.

However, sending data from STM32 to NRF51 DONGLE fails.

I think I made wrong code for NRF51822. 

 

now, I am using Nrf_BLE_NUS_Services.

here is my code.

-------------------------------------------------------

uint8_t data_array[20];
data_array[0] = NRF_UART0->TXD;

....

for(;;)

{

 ble_nus_string_send(&m_nus, data_array, sizeof(data_array));
 nrf_delay_ms(10);
 power_manage();

}

-------------------------------------------------------

It is the most basic code, but it does not make this part.
By the end of this week, code must be created to interact with STM32 and NRF51 DONGLE. 
I'd appreciate your help.

Parents Reply Children
  • I checked this demo already. and, it is working...

    I changed RX_TX_PIN NUMBER also..  my custom rx pin is 5, tx pin is 4..

    that's why i start to use stm32.. um.. ;(

    I think we can use this  function ' ble_nus_string_send()'... 

    I sent the text from nrf51822 to nrf 51 dongle.. 

    and, I thought NRF_UART0->RXD is date which is from stm32... 

  • I changed RX_TX_PIN NUMBER also..  my custom rx pin is 5, tx pin is 4..

    But before doing that, did you use the RTT logging to see what's happening inside the code, and understand the flow of the data through the code?

    that's why i start to use stm32

    Did you check that your code still works by using TeraTerm before moving to the STM32?

    This really is key to successful development: take small steps; only change one thing at a time!

    I think we can use this  function ' ble_nus_string_send()'... 

    Don't just "think" - use the debugger and/or the RTT logging to prove it

  • As you said, I am trying to find a reason why it shouldn't be revised from the beginning.

    First, I tried to communicate using nrf51822 and Android phones. and I did. NRF RTT confirmed sending and receiving data.

    Second, it started Nrf51822 and UART communication from STM32 to UART, and matched pin map and baudrate.

    Now I use the NRF RX pin 4,  TX pin is 5..

    But, in the example app_uart, button is using pin 4. There is no pin 4 on my board, so I did not modify it at that time. now, I started to change.

    First, I changed the pinmap of button and Ble started to stop working. So I annotated the button, but this time, I started to get an error. I immediately began to sort out the functions of the button.

    And after that, Finally, I sent a string using the printf function from nrf to stm32. There's a phrase coming out of the stm32 debug port.

    But still Data sent from stm32 to nrf are not verified. 

    You seem to be making some progress. 
    Thank you.

Related