cancel
Showing results for 
Search instead for 
Did you mean: 

Writing 300 bytes causes hard fault using X-CUBE NFC-6 on X-NUCLEO-NFC06A1

Wladimir
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Rene Lenerve
ST Employee

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.

View solution in original post

5 REPLIES 5
Wladimir
Associate II

About setting up Card Emulation mode see this topic:

my question about CE mode

Wladimir
Associate II

Same thing happens when i write 2 records of 150 bytes each , next read or write operation causes hard fault.

Wladimir
Associate II

When writing messages on tag i using NFC Tools Pro android app

Rene Lenerve
ST Employee

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.

Thank you, it helps!)