2023-12-14 09:39 AM
Hi,
we are currently developing an application where we need to integrate the ST25DV16KC NFC together with ST32WL.
For this use-case I downloaded the firmware STSW-ST25DV010 and flashed it on the NUCLEO-WL55JC. This is working fine.
Because we are using the STM32WLE5 in our project I transferred the libraries to our project and adjusted it, so it can work with the STM32WLE5. This only works for NFC initialisation, but not for writing NDEF. From the example code in main.c I have this piece of code
if ( nfc_init( ) != 0 ) {
APP_PRINTF("NFC init failed!\r\n");
Error_Handler();
} else {
int sts;
sts = lp_write_ndef_uri_dev_id( NULL, 0 );
APP_PRINTF("NFC write failed! %d\r\n", sts);
if ( sts != 0 ) {
APP_PRINTF("NFC write failed!\r\n");
// Error_Handler();
}
nfc_mb_init();
}
The lp_write_ndef_uri_def_id method fails with status code -3, so I digged deeper and the problem is in lib_provisioning.c where the method getURI is. Digging deeper we have NDEF_ReadNDEF method is where the status code -3 from main.c initially appears. I double checked everything and cant get into the right direction. Still wondering why init works perfectly but the NDEF method only on the NUCLEO-WL55JC.
Thanks in advance
Solved! Go to Solution.
2024-02-01 06:15 AM
Hi CMoeb.1,
Looking into the code of the STSW-ST25DV010, it seems that the error code -3 is returned by lp_write_ndef_uri_dev_id after that
/* Read back written URI */
if(status == NDEF_OK)
{
status = getURI(&r_uri);
}
if((status != NDEF_OK) || \
strcmp(r_uri.protocol,w_uri.protocol) || \
strcmp(r_uri.URI_Message,w_uri.URI_Message))
{
APP_PRINTF("Store URI failure!\r\nNDEF has not been written!\r\n");
return -3;
}
else
{
APP_PRINTF("NDEF message has been written: %s%s\r\n", r_uri.protocol, r_uri.URI_Message);
}
But -3 seems not to be an error value that getURI can return. Could you check which error code is sent back by getURI and even better which function exactly is returning this error code.
Kind Regards.
2024-02-01 06:15 AM
Hi CMoeb.1,
Looking into the code of the STSW-ST25DV010, it seems that the error code -3 is returned by lp_write_ndef_uri_dev_id after that
/* Read back written URI */
if(status == NDEF_OK)
{
status = getURI(&r_uri);
}
if((status != NDEF_OK) || \
strcmp(r_uri.protocol,w_uri.protocol) || \
strcmp(r_uri.URI_Message,w_uri.URI_Message))
{
APP_PRINTF("Store URI failure!\r\nNDEF has not been written!\r\n");
return -3;
}
else
{
APP_PRINTF("NDEF message has been written: %s%s\r\n", r_uri.protocol, r_uri.URI_Message);
}
But -3 seems not to be an error value that getURI can return. Could you check which error code is sent back by getURI and even better which function exactly is returning this error code.
Kind Regards.