2021-05-21 02:45 AM
Hello!
I using X-CUBE NFC-6 library on X-NUCLEO-NFC06A1 board in Card Emulation mode and writing on "tag" (board) 300 bytes of data and it causes hard fault during next read or write "tag".
I think it's a bug in library, can you help me with that problem?
Best regards, Vladimir
Solved! Go to Solution.
2021-05-21 07:01 AM
Hi @Wladimir,
Ok I have seen what is going on, the CCFile defined in the code sets the frame length for each response (MLe) to 127 bytes and the buffer to send data is only of 100 bytes. So if you change the buffer txBuf (line 482, function demoCE) in the file demo_polling.c to that :
uint8_t txBuf[130];
this should fix your issue. So the issue is only on the read command, and this is happening only when you are writing data above 100 bytes, because the default ndef is under this size.
130, because we need to add the 2 bytes responce 90 00 at the end (so it could be above 129).
I Hope this can help you.
Best Regards.
2021-05-21 02:50 AM
About setting up Card Emulation mode see this topic:
2021-05-21 03:09 AM
Same thing happens when i write 2 records of 150 bytes each , next read or write operation causes hard fault.
2021-05-21 05:23 AM
When writing messages on tag i using NFC Tools Pro android app
2021-05-21 07:01 AM
Hi @Wladimir,
Ok I have seen what is going on, the CCFile defined in the code sets the frame length for each response (MLe) to 127 bytes and the buffer to send data is only of 100 bytes. So if you change the buffer txBuf (line 482, function demoCE) in the file demo_polling.c to that :
uint8_t txBuf[130];
this should fix your issue. So the issue is only on the read command, and this is happening only when you are writing data above 100 bytes, because the default ndef is under this size.
130, because we need to add the 2 bytes responce 90 00 at the end (so it could be above 129).
I Hope this can help you.
Best Regards.
2021-05-21 07:27 AM
Thank you, it helps!)