This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NFC code not working

Hi,

I'm trying to get NFC working on a PCA10040 dev board. Using the nfc/record_url hex file it works fine, so the hardware is obviously ok.

However, when I use the exact same code as in the record_url example from my software, it doesn't do anything. All functions execute without errors, but then log_uart_printf gets called with:

[NFC_HAL]: initialize
[NFC_HAL]: start
// ------------- put NFC device near 
[NFC_HAL]: fielddetected
[NFC_HAL]: reinitialize
[NFC_HAL]: fielddetected
[NFC_HAL]: fielddetected
[NFC_HAL]: reinitialize
[NFC_HAL]: fielddetected
[NFC_HAL]: reinitialize
[NFC_HAL]: fielddetected
[NFC_HAL]: reinitialize
[NFC_HAL]: fielddetected
[NFC_HAL]: fielddetected
[NFC_HAL]: fielddetected
[NFC_HAL]: fielddetected
[NFC_HAL]: reinitialize
[NFC_HAL]: fielddetected
[NFC_HAL]: reinitialize

Also, will the NFC code ever be distributed as something that's not a binary blob? I'm using a language interpreter (Espruino), and it expects functions to be compiled without hardware floating point (the call style is different). Currently the only way I can use NFC is to recompile with VFP, which means I'm then unable to pass floating point values into any functions!

  • @Gordon: Do you have any activity that can occupy the CPU for long period ? I suspect it could be a timing issue.

  • I just got the new devkits here - exactly the same problem :( I don't occupy the CPU in interrupts at all at the moment - it's just sitting there spinning around (because I'm not putting it into sleep in the main loop). Is there anything I can break on in the debugger or add prints to to find out why it's re-initialising? If it helps I can provide binaries, and it's all open source.

  • @Gordon: It's as expected that the new kit won't fix the issue with NFC as nothing changed regarding NFC on Engineering B and Production revision.

    I'm afraid that I have little or no experience with Espruino JS. But what you can do is to send me the hex file and I can test on my PCA10040 and my phone. Make sure you remove all dependencies (peripheral for example) and let me know the UART configuration.

    You are not putting the CPU to sleep in the mainloop, but do you have any other activity such as timer, data sampling, interrupt handler also running ? You mentioned that it's a big project. Any BLE activity ?

    I'm still not sure why you can't disable some code/functions to strip down the project and get the NFC to work (as it worked with the record_url example ).

  • So I just tried the example code out on its own - I used the Makefile from Espruino but deleted all references to my code, and put main.c from the nfc_url_record example in. Exactly the same failure, but if I build nfc_url_record myself then it works. I'm a bit stumped to be honest - all the CPU flags seem the same, and none of Nordic's other stuff has issues with the compile

  • Hi Gordon,

    Could you check if you have defined PCA10040 in your makefile ? We need that macro define so that HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND will be implemented. It's for NFC errata #79.

    I will try to get to the NFC developer to see what could be wrong here. I will also try to find time to compile with your Espruino repo, is there anything I should know that could be tricky to compile with the Makefile in the repo ?

    If we can reproduce the issue here, then it wouldn't be easier to shoot the trouble.

Related