2024-04-01 04:20 PM
Hi,
I want to use ST25R3916B with nRF5340 from nordic semiconductor. The software for ST25R3916B is written mainly for STM32 MCUs. How can I port the software to nRF5340? How can I start at all?
Thanks.
https://www.st.com/en/embedded-software/x-cube-nfc6.html
Solved! Go to Solution.
2024-04-04 07:48 AM - edited 2024-04-05 08:50 AM
Hi,
the RFAL uses 3 function-like macros for the SPI defined in rfal_platform.h:
and one macro:
The RFAL does not care about the SPI pins and only uses those 3 function-like macros for the SPI communication. The SPI has to be configured inside the porting glue.
If the Select pin is managed in frame mode by your SPI hardware, define ST25R_COM_SINGLETXRX and define platformSpiSelect/platformSpiDeselect as empty.
If theSelect pin is managed by software, redirect platformSpiSelect/platformSpiDeselect to the GPIO management function to set the Select pin low or high.
The platformSpiTxRx has to be redirected to the nRF SPI transceive function.
Rgds
BT
2024-04-02 12:17 AM
Hi,
The ST25R3916 RF Abstraction Layer (RFAL) is a scalable and portable C language source code library. It can be ported on many ST or non-ST MCU.
A rfal_platform.h file is used to configure the various protocols for a given application and is used to define the interface to the external services (timer, SPI communication, log, etc.). See UM2890 RF/NFC abstraction layer (RFAL).
Rgds
BT
2024-04-04 07:28 AM - edited 2024-04-04 07:39 AM
Thank you, I read the UM and have some questions:
In RFAL, SPI pins and SS pin are configured, but nRF SDK uses device-tree for device configurations, and SPI device is added as device-tree overlay.
For example:
https://github.com/nrfconnect/sdk-nrf/tree/main/samples/nfc/tag_reader
The line in https://github.com/nrfconnect/sdk-nrf/blob/main/lib/st25r3911b/st25r3911b_spi.c#L21 gets SPI device from device-tree overlay.
How can I configure SPI devices in RFAL as device-tree overlays in nRF SDK?
2024-04-04 07:46 AM
Implement platformSpiTxRx() using the device-tree approach?
2024-04-04 07:48 AM - edited 2024-04-05 08:50 AM
Hi,
the RFAL uses 3 function-like macros for the SPI defined in rfal_platform.h:
and one macro:
The RFAL does not care about the SPI pins and only uses those 3 function-like macros for the SPI communication. The SPI has to be configured inside the porting glue.
If the Select pin is managed in frame mode by your SPI hardware, define ST25R_COM_SINGLETXRX and define platformSpiSelect/platformSpiDeselect as empty.
If theSelect pin is managed by software, redirect platformSpiSelect/platformSpiDeselect to the GPIO management function to set the Select pin low or high.
The platformSpiTxRx has to be redirected to the nRF SPI transceive function.
Rgds
BT