This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UART between NRF52 dev board and STM32F429ZI6 Discovery

Hello,

I am trying to make a basic uart communication between my nordic NRF52 dev board (PCA10040, s132) and my STM32f429ZIT6 discovery board.

NRF52 : I used the example from sdk 11.0.0 for the fifo uart STM32 : I used the example from STM32Cube_FW_F4_V1.13.0 for the UART_TwoBoards_commIT (basically uart on interruption)

I changed the uart parameters on both side to match:

  • baudrate 9600
  • no parity
  • no HW flow control

First the STM32 wait for the button to be pushed, then it send a character and wait for the NRF52 to send it back. The NRF52 start by waiting for a character from the STM32 and when it receive it, it send it back.

On the nordic the leds are turned on if the received character is the good one. On the STM32 side, LED3 is blinking while in reception mode and LED4 is blinking when receive is complete.

So far it seems that the transmition from the stm to the NRF52 works fine but for the other way, the interruption is not tringerred on the STM32 side.

I tried the loopback test on the nordic and it worked.

The app_uart_put function on the NRF52 return NRF_SUCCESS.

I thought maybe there was a mistake in the example code for the stm32 and the interruption was disabled but I managed to trigger the interruption by plugging the RX pin to GND.

Thank you very much for your help.

  • Hi StanB,

    Have you tried to do loopback test with the STM ? Just to check if the configuration was correct and you can receive RX interrupt ?

    Have you tried to hook up a logic analyzer and check if the nRF52 sending something back to your STM ?

  • Hi HungBui,

    the tx and rx use the same interruption handler so I don't think it can do a loopback, no ? I mean is it possible that the transmission interupt is interupt by the same interupt routine but for the reception ? The exemple for the STM is made for two boards. I test the STM uart connection only with my computer through usb and it worked perfectly fine so that lead me to think that the problem is on the pin configuration. I don't have an analyzer yet (I will order one) but I tried to set the nRF52 tx pin to low after the communication to see with a voltmetre if it's what happen but the state is high. It seems that the rx pin on the STM side force its state to high and the nRF is not able to change it... I don't know if what I am saying is clear

  • The STM should not drive the RX pin. Otherwise it won't be able to receive anything. You can test by connecting the TX pin of the 52 to smth else and see if it's toggle.

    I haven't used the STM32, but it should have similar architecture with the NRF5 that the TX and RX interrupt has the same interrupt handler but different interrupt flag. You can check the flag and see which event is arrived. Same level interrupt won't preempt the other.

  • I find out what it is, I tried on different uart on the stm32 and it works ! I tried usart1 and uart4 and it was not working, I suppose that the associated pins were used elsewhere on the discovery board and that it was interfering with the communication. usart2 works fine

Related