2019-04-27 09:15 AM
Hello,
I am working with X-Cube-NFC3 (V2.0.0) for source code. Using one of the projects built for F401RE, I setup a project wherein:
I now used the Ready projects to create some dummy code. I got the code built but all I get is that my board is not initialized. Check out my source code and my output:
/* USER CODE BEGIN 2 */
/* Initialize log module */
// __HAL_SPI_CLEAR_OVRFLAG(&hspi1);
logUsartInit(&huart2);
platformLog("\r\nWelcome to X-NUCLEO-NFC03A1 (SPI Interface)\r\n");
/* Initalize RFAL */
rfalAnalogConfigInitialize();
if(rfalAnalogConfigIsReady() == 1)
{
platformLog("rfalAnalogConfigIsReady\r\n");
}
else if(rfalAnalogConfigIsReady() == 0)
{
platformLog("Not rfalAnalogConfigIsReady\r\n");
}
ErrorVariable = rfalInitialize();
platformLog("Error Code: %u\r\n", ErrorVariable);
if( ErrorVariable != ERR_NONE )
{
/*
* in case the rfal initalization failed signal it by flashing all LED
* and stoping all operations
*/
platformLog("RFAL initialization failed..\r\n");
while(1)
{
platformLedToogle(PLATFORM_LED_A_PORT, PLATFORM_LED_A_PIN);
platformLedToogle(PLATFORM_LED_B_PORT, PLATFORM_LED_B_PIN);
platformLedToogle(PLATFORM_LED_F_PORT, PLATFORM_LED_F_PIN);
platformLedToogle(PLATFORM_LED_V_PORT, PLATFORM_LED_V_PIN);
platformDelay(100);
}
}
else
{
platformLog("RFAL initialization succeeded..\r\n");
for (int i = 0; i < 6; i++)
{
platformLedToogle(PLATFORM_LED_A_PORT, PLATFORM_LED_A_PIN);
platformLedToogle(PLATFORM_LED_B_PORT, PLATFORM_LED_B_PIN);
platformLedToogle(PLATFORM_LED_F_PORT, PLATFORM_LED_F_PIN);
platformLedToogle(PLATFORM_LED_V_PORT, PLATFORM_LED_V_PIN);
platformDelay(200);
}
platformLedOff(PLATFORM_LED_A_PORT, PLATFORM_LED_A_PIN);
platformLedOff(PLATFORM_LED_B_PORT, PLATFORM_LED_B_PIN);
platformLedOff(PLATFORM_LED_F_PORT, PLATFORM_LED_F_PIN);
platformLedOff(PLATFORM_LED_V_PORT, PLATFORM_LED_V_PIN);
}
The output I got was:
Welcome to X-NUCLEO-NFC03A1 (SPI Interface)<CR><LF>
rfalAnalogConfigIsReady<CR><LF>
Init failed<CR><LF>
Error Code: 8<CR><LF>
RFAL initialization failed..<CR><LF>
The error code 8 corresponds to SystemError. Could someone help me out with how to proceed. I did make the following changes to the Middlewares:
//#ifndef RFAL_FEATURE_DPO
// #error " RFAL: Module configuration missing. Please enable/disable Dynamic Power module by setting: RFAL_FEATURE_DPO "
//#endif
Any and all help is useful.
Solved! Go to Solution.
2019-04-29 07:19 AM
With updated IOC file (B1 button label renamed)
Let me know if the proper pin assignment solves your initialization issue
Rgds
BT
2019-04-29 06:39 AM
Hi,
1/ DPO
rfal_dpo.c is not needed for ST25R95. It is delivered as part of the common RFAL but is not part of the list of files being compiled in ST25R95 projects. You can removed it from your project.
2/ NUCLEO-F413ZH vs. NUCLEO-F401RE
NUCLEO-F413ZH is refered in the title of the post whereas NUCLEO-F401RE is refered in the description of the issue
3. If the initialization still fails, you can add more trace (set ST25R95_DEBUG to true in st25r95_com.c and st25r95_com_spi.c)
Rgds
BT
2019-04-29 07:19 AM
With updated IOC file (B1 button label renamed)
Let me know if the proper pin assignment solves your initialization issue
Rgds
BT
2019-05-16 03:10 AM
Hello @Brian TIDAL_O , the above link was helpful. My initial implementation had SPI running at much higher speeds. At present, the initialization works. However, I am still facing some issues with the main implementation. I am trying to read data from a classic MiFare 1kb card (ISO14443, NFCA) and send it over the usart. Any help would be awesome. I need a starting point. I am kinda stuck.
Thanking You.
2019-05-16 05:26 AM
Hi,
such tags require proprietary authentication before any memory operation (see datasheet from the manufacturer of these tags). If you want to use such tags with the CR95HF reader, you will have to implement this proprietary authentication and the ciphering. See other posts on this topic in this forum (e.g. CR95HF reader Mifare Desfire secure mode)
I would rather recommend to use fully compliant tags from the ST25 family such as ST25TA (Type 4A Tags) or fully compliant Type 2 Tags (i.e. tags not requiring proprietary stuff).
Rgds
BT
2019-12-09 02:26 PM
Hello @Abhishek Deouskar, I am experiencing the similar problem, when it comes to initialization of NFC03a1 board with Nucleo-L152RE. What do you mean by "My initial implementation had SPI running at much higher speeds."? You have adjusted the APB1 clock (or any other...) or eg. SPI1 Maximum Output Speed?
While debugging during rfalInitialize() I end up with the following result in rfal_rfst25r95 ->>>
/* Initialize chip */
if (st25r95Initialize() != ERR_NONE)
{
return (ERR_SYSTEM);
}
Thanks in advance for any help;)
2019-12-10 02:35 AM
Hi,
rfalInitialize performs the startup sequence (as per ST25R95 Datasheet §3.2) and then sends echo command until a valid reply is received or the max retries is reached.
Can you connect a logic analyzer on the SPI pin on the X-NUCLEO-NFC03A1 to check the SPI communication? Can you check the PIN assignment between the NUCLEO-L152RE and the X-NUCELO-NFC03A?
Make sure to have:
PA5 -- SPI1_SCLK
PA6 -- SPI1_MISO
PA7 -- SPI1_MOSI
PB8 -- nSPI_SS Output Push_Pull Output level high
PC7 -- SSI_0 Output Push_Pull Output level high
PA9 -- nIRQ_IN Output Push_Pull Output level low
PA8 -- LED1
PB10 -- LED2
PB4 -- LED3
PB5 -- LED4
PA10 -- nIRQ_OUT Input mode
The SPI clock max frequency is 2.0 MHz (see table 49 in ST25R95 datasheet). For HCLK=32MHz, you can set for example the prescaler to 32 (SPI clock =1MHz)., CPOL=Low, CPHA=1 edge.
Feel free to send me your STM32CubeMX ioc file.
Rgds
BT