2019-07-23 01:05 PM
I have the X-NUCLEO-NFC03A1 expansion board connected to the NUCLEO-F401RE, successfully running the demo polling code from X-CUBE-NFC3. I would like to modify the code to allow the two boards to communicate using UART alone (no SPI pins necessary). The X-CUBE-NFC3 user guide suggests that this is possible at the end of the document when it says:
" [The X-NUCLEO-NFC03A1] capable of interfacing with the external STM32 microcontroller on STM32 Nucleo board using SPI/UART transport layer. By default it will run using SPI interface. The user can choose to compile with one of the two interfaces by selecting the right target under Projects properties."
I'm using the IAR Embedded Workbench IDE, and can't find anything like Projects -> properties that would allow me to change the default interface. Could anyone outline the steps I should take to make this change?
Thanks!
Solved! Go to Solution.
2019-07-25 12:10 AM
Hi
#include "st25r95_com.h" has to be added in main.c as HAL_UART_TxCpltCallback (resp. HAL_UART_RxCpltCallback and HAL_UART_ErrorCallback) calls st25r95UartTxCpltCallback (resp. st25r95UartRxCpltCallback, st25r95UartErrorCallback).
Make sure to diff each file provided in the zip with the original files to have all the needed modifications
Rgds
BT
2019-07-24 07:30 AM
Hi,
since X-CUBE-NFC3 v2.0.0, only SPI support is delivered by default. UM2045 §5.3.3 needs to be updated as no UART target is provided.
Anyway, it is possible to use UART for CR95HF with X-CUBE-NFC3 v2.0.0
As an example, I've attached in a Zip the various modified files (example based on NUCLEO-L476RG + MDK-ARM, beware that the file location in uvprojx may differs from the one in the cube package). Make sure to power cycle the X-NUCLEO-NFC03A1 the first time after you have donwloaded the FW with UART support. You may use STM32CubeMX to generate the proper UART initialisation (ioc file attached in the zip for NUCLEO-L476RG, can be used as template for porting to NUCLEO-F401RE).
Personally, I would rather recommend to use SPI. Feel free to share more information about your application in particular why UART is prefered
Rgds
BT
2019-07-24 03:37 PM
Hi Brian,
Thank you for your detailed response! I've followed your instructions, but when I try to build the code, I get errors that the functions st25r95UartTxCpltCallback. st25r95UartRxCpltCallback, and st25r95UartErrorCallback, are not defined. I see that they are defined in st25r95_com_uart.c, so I'm not sure why these errors are happening. Any ideas?
Thanks!
2019-07-25 12:10 AM
Hi
#include "st25r95_com.h" has to be added in main.c as HAL_UART_TxCpltCallback (resp. HAL_UART_RxCpltCallback and HAL_UART_ErrorCallback) calls st25r95UartTxCpltCallback (resp. st25r95UartRxCpltCallback, st25r95UartErrorCallback).
Make sure to diff each file provided in the zip with the original files to have all the needed modifications
Rgds
BT