This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

neard test command for trf7970a

Other Parts Discussed in Thread: TRF7970A

Hello, everyone,

I restart my linux project with the trf7970a chip. Now other people help me to include the trf7970a driver and neard into the linux kernel. I am testing it with the neard test command.

The following is from the console term:

root@phycore-am335x-1:/usr/lib/neard# ./test-adapter powered nfc0 on
root@phycore-am335x-1:/usr/lib/neard# ./test-adapter poll nfc0 on Initiator
root@phycore-am335x-1:/usr/lib/neard# [ 7483.165874] systemd-journald[1041]: /dev/kmsg buffer overrun, some messages lost.
[ 7483.188894] systemd-journald[1041]: /dev/kmsg buffer overrun, some messages lost.
[ 7483.216274] systemd-journald[1041]: /dev/kmsg buffer overrun, some messages lost.

......................

[ 7484.225002] systemd-journald[1041]: /dev/kmsg buffer overrun, some messages lost.
[ 7484.255893] systemd-journald[1041]: /dev/kmsg buffer overrun, some messages lost.

root@phycore-am335x-1:/usr/lib/neard# ./test-tag list(no feedback)
root@phycore-am335x-1:/usr/lib/neard# ./test-tag dump(no feedback)


root@phycore-am335x-1:/usr/lib/neard# nfctool --list
nfc0:
Tags: [ tag24 ]
Devices: [ ]
Protocols: [ Felica MIFARE ISO-DEP NFC-DEP ]
Powered: Yes
RF Mode: Initiator
lto: 150
rw: 15
miux: 2047

root@phycore-am335x-1:/usr/lib/neard#

-------------------------------------------------------------------------------------------

Compared with the sloa210.pdf, I have some questions:

(1) For every command, no command prompt back. It is normal?

(2) After calling the command "test-tag list" and the command "test-tag dump", I did not get any response.

     Then I use the command "nfctool --list". I found that each time i swipe the rfid card, the string in the Tags item will change like "tag1", "tag2", "tag3", "tag4", "tag5", "tag6", "tag7",....  It seems that the nfc tag has been read out.

(3) where can i find some document about how to program the user space code for neard?

Thank you

Fei

  • Hi Fei

    Can u please turn on the debug in neard.
    U can do it by ./neard -n -d "*" and send the logs.

    Also was the tag kept properly over the antenna.It may have moved out of field.
  • Hi, deep ter,

    Thank you for your help.

    (1) When I called the command "./neard -n -d "*"", it can not return to the command line:

    root@phycore-am335x-1:/usr/lib/neard# ./neard -n -d "*"
    neard[2070]: NEAR daemon version 0.14
    neard[2070]: src/dbus.c:__near_dbus_init()
    neard[2070]: src/netlink.c:__near_netlink_init()
    neard[2070]: src/netlink.c:nl_get_multicast_id()
    neard[2070]: src/netlink.c:__nl_send_msg()
    neard[2070]: src/netlink.c:family_handler()
    neard[2070]: src/netlink.c:ack_handler()
    neard[2070]: src/netlink.c:nl_get_multicast_id() multicast id 1
    neard[2070]: src/agent.c:__near_agent_init()
    neard[2070]: src/tag.c:__near_tag_init()
    neard[2070]: src/device.c:__near_device_init()
    neard[2070]: src/adapter.c:__near_adapter_init()
    neard[2070]: src/ndef.c:__near_ndef_init()
    neard[2070]: src/manager.c:__near_manager_init()
    neard[2070]: src/manager.c:__near_manager_init() connection 0x45988
    neard[2070]: src/netlink.c:__near_netlink_get_adapters()
    neard[2070]: src/netlink.c:__nl_send_msg()
    neard[2070]: src/netlink.c:get_devices_handler()
    neard[2070]: src/manager.c:__near_manager_adapter_add() idx 0
    neard[2070]: src/adapter.c:__near_adapter_create() Powered 0
    neard[2070]: src/adapter.c:__near_adapter_add() /org/neard/nfc0
    neard[2070]: src/adapter.c:__near_adapter_add() connection 0x45988
    neard[2070]: src/netlink.c:__finish_handler()
    neard[2070]: src/bluetooth.c:__near_bluetooth_init()
    neard[2070]: src/plugin.c:__near_plugin_init()
    neard[2070]: plugins/p2p.c:p2p_init()
    neard[2070]: plugins/phdc.c:phdc_init()
    neard[2070]: plugins/p2p.c:near_p2p_register() driver 0x3f68c name NPP service com.android.npp
    neard[2070]: plugins/p2p.c:near_p2p_register() driver 0x3f6b4 name SNEP service urn:nfc:sn:snep
    neard[2070]: plugins/p2p.c:near_p2p_register() driver 0x3f6dc name VALIDATION_SNEP service urn:nfc:xsn:nfc-forum.org:snep-validation
    neard[2070]: plugins/llcp-validation.c:llcp_validation_init()
    neard[2070]: plugins/p2p.c:near_p2p_register() driver 0x3f704 name VALIDATION_LLCP_CL service urn:nfc:sn:cl-echo
    neard[2070]: plugins/p2p.c:near_p2p_register() driver 0x3f72c name VALIDATION_LLCP_CO service urn:nfc:sn:co-echo
    neard[2070]: plugins/p2p.c:near_p2p_register() driver 0x3f754 name Handover service urn:nfc:sn:handover
    neard[2070]: src/device.c:near_device_driver_register()
    neard[2070]: src/adapter.c:adapter_listen() /org/neard/nfc0
    neard[2070]: plugins/p2p.c:p2p_bind()
    neard[2070]: plugins/p2p.c:__p2p_bind() Binding Handover
    neard[2070]: plugins/p2p.c:p2p_bind()
    neard[2070]: plugins/p2p.c:__p2p_bind() Binding VALIDATION_LLCP_CO
    neard[2070]: plugins/p2p.c:p2p_bind()
    neard[2070]: plugins/p2p.c:__p2p_bind() Binding VALIDATION_LLCP_CL
    neard[2070]: plugins/p2p.c:p2p_bind()
    neard[2070]: plugins/p2p.c:__p2p_bind() Binding VALIDATION_SNEP
    neard[2070]: plugins/p2p.c:p2p_bind()
    neard[2070]: plugins/p2p.c:__p2p_bind() Binding SNEP
    neard[2070]: plugins/p2p.c:p2p_bind()
    neard[2070]: plugins/p2p.c:__p2p_bind() Binding NPP
    neard[2070]: plugins/nfctype4.c:nfctype4_init()
    neard[2070]: src/tag.c:near_tag_driver_register()
    neard[2070]: src/tag.c:near_tag_driver_register()
    neard[2070]: plugins/nfctype3.c:nfctype3_init()
    neard[2070]: src/tag.c:near_tag_driver_register()
    neard[2070]: plugins/nfctype2.c:nfctype2_init()
    neard[2070]: src/tag.c:near_tag_driver_register()
    neard[2070]: plugins/nfctype1.c:nfctype1_init()
    neard[2070]: src/tag.c:near_tag_driver_register()
    neard[2070]: src/adapter.c:append_protocols() protocols 0xfc

    It will stay here.................

    (2) When I called the command "./neard", it will return to the command line in a short time.

    root@phycore-am335x-1:/usr/lib/neard# ./neard

    root@phycore-am335x-1:/usr/lib/neard#

    what is the problem?

    Thank you

    Fei

  • Hi Fei

    Sorry for late reply.

    Try giving command ./neard -n -d "*" &

    & is given to run the neard daemon in background.

    Also from the logs it is seen that the Neard which you are using is old.It does not have nfctype5 support. Have you checked out the branch which is mentioned in sloa210.pdf. Or should I send you the tar of neard

    Then you can test with the commands for polling the tags and listing the tags.

    It will help you. Send the logs.

    Regards
    Deep Ter
  • Hi, Deep Ter,

    Thank you for your response.

    Today I made the SPI cable shorter than before. Also I got another rfid card to test. Now it can work like in the sloa210 pdf.

    I think my old problem is from my rfid card. The old test card is labeled with "NFC TAG Sample". I did not know what kind of card type it is.

    Now I use a Mifare card to test the neard. the following is the console log.

    ======================================================================

    root@phycore-am335x-1:/usr/lib/neard# ./test-adapter poll nfc0 on Initiator
    root@phycore-am335x-1:/usr/lib/neard# [ 2874.905046] systemd-journald[1156]: /dev/kmsg buff.
    [ 2874.935521] systemd-journald[1156]: /dev/kmsg buffer overrun, some messages lost.
    ......
    [ 2876.720771] systemd-journald[1156]: /dev/kmsg buffer overrun, some messages lost.
    [ 2876.740103] systemd-journald[1156]: /dev/kmsg buffer overrun, some messages lost.
    ./test-tag list
    [ /org/neard/nfc0/tag20 ]
    Protocol = MIFARE
    ReadOnly = false
    Type = Type 2
    Adapter = /org/neard/nfc0
    root@phycore-am335x-1:/usr/lib/neard# ./test-tag dump
    [ /org/neard/nfc0/tag20 ]
    root@phycore-am335x-1:/usr/lib/neard#

    ============================================================

    (1) There is one tiny problem. After the command "./test-tag dump" is called, only the string "[ /org/neard/nfc0/tag20 ]" is returned. But in the slo210 pdf docuemnt, more messages are returned. This does not matter or not?

    (2) For the current neard test command, can i get the rfid card number?

    (3) Please send me the latest neard to fei@tmsitech.ca when you are not busy.

    Thank you

    Fei