1 (edited by cryptodraco 2016-02-24 10:54:21)

Topic: libnfc.driver.pn532_i2c Application level error detected (127)

Hi,

I'm using the apdu_example with my ITEAD PN532 NFC Module, using with i2c.

When I launch the program, it can detect my mifare, and read the information. But when the example try to "Select application", it exit because libnfc.driver.pn532_i2c return me an "Application level error detected (127)".

The fact is, I absolutly don't know what does it mean.
Here is the output of the debug:

./apdu_example 
debug    libnfc.general    log_level is set to 3
debug    libnfc.general    allow_autoscan is set to true
debug    libnfc.general    allow_intrusive_scan is set to false
debug    libnfc.general    1 device(s) defined by user
debug    libnfc.general      #0 name: "Itead_PN532_SPI", connstring: "pn532_i2c:/dev/i2c-1"
./apdu_example uses libnfc 1.7.1
debug    libnfc.chip.pn53x    Diagnose
debug    libnfc.chip.pn53x    Timeout value: 500
debug    libnfc.chip.pn53x    SAMConfiguration
debug    libnfc.chip.pn53x    Timeout value: 1000
debug    libnfc.bus.i2c    TX: 00 00 ff 03 fd d4 14 01 17 00 
debug    libnfc.bus.i2c    wrote 10 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.bus.i2c    TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug    libnfc.bus.i2c    wrote 16 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.chip.pn53x    GetFirmwareVersion
debug    libnfc.bus.i2c    TX: 00 00 ff 02 fe d4 02 2a 00 
debug    libnfc.bus.i2c    wrote 9 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.chip.pn53x    SetParameters
debug    libnfc.bus.i2c    TX: 00 00 ff 03 fd d4 12 14 06 00 
debug    libnfc.bus.i2c    wrote 10 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.general    "pn532_i2c:/dev/i2c-1" (pn532_i2c:/dev/i2c-1) has been claimed.
debug    libnfc.chip.pn53x    ReadRegister
debug    libnfc.bus.i2c    TX: 00 00 ff 0c f4 d4 06 63 02 63 03 63 0d 63 38 63 3d b0 00 
debug    libnfc.bus.i2c    wrote 19 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.chip.pn53x    PN53X_REG_CIU_TxMode (Defines the transmission data rate and framing during transmission)
debug    libnfc.chip.pn53x    PN53X_REG_CIU_RxMode (Defines the transmission data rate and framing during receiving)
debug    libnfc.chip.pn53x    WriteRegister
debug    libnfc.bus.i2c    TX: 00 00 ff 08 f8 d4 08 63 02 80 63 03 80 59 00 
debug    libnfc.bus.i2c    wrote 15 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.chip.pn53x    RFConfiguration
debug    libnfc.bus.i2c    TX: 00 00 ff 04 fc d4 32 01 00 f9 00 
debug    libnfc.bus.i2c    wrote 11 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.chip.pn53x    RFConfiguration
debug    libnfc.bus.i2c    TX: 00 00 ff 04 fc d4 32 01 01 f8 00 
debug    libnfc.bus.i2c    wrote 11 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.chip.pn53x    RFConfiguration
debug    libnfc.bus.i2c    TX: 00 00 ff 06 fa d4 32 05 ff ff ff f8 00 
debug    libnfc.bus.i2c    wrote 13 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
NFC reader: pn532_i2c:/dev/i2c-1 opened
Polling for target...
debug    libnfc.chip.pn53x    ReadRegister
debug    libnfc.bus.i2c    TX: 00 00 ff 0e f2 d4 06 63 02 63 03 63 05 63 38 63 3c 63 3d 19 00 
debug    libnfc.bus.i2c    wrote 21 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.chip.pn53x    PN53X_REG_CIU_TxAuto (Controls the settings of the antenna driver)
debug    libnfc.chip.pn53x    PN53X_REG_CIU_Control (Contains miscellaneous control bits)
debug    libnfc.chip.pn53x    WriteRegister
debug    libnfc.bus.i2c    TX: 00 00 ff 08 f8 d4 08 63 05 40 63 3c 10 cd 00 
debug    libnfc.bus.i2c    wrote 15 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
debug    libnfc.chip.pn53x    InListPassiveTarget
debug    libnfc.chip.pn53x    No timeout
debug    libnfc.bus.i2c    TX: 00 00 ff 04 fc d4 4a 01 00 e1 00 
debug    libnfc.bus.i2c    wrote 11 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
Target detected!
=> 00 a4 04 00 07 d2 76 00 00 85 01 00 
debug    libnfc.chip.pn53x    InDataExchange
debug    libnfc.chip.pn53x    Timeout value: 500
debug    libnfc.bus.i2c    TX: 00 00 ff 0f f1 d4 40 01 00 a4 04 00 07 d2 76 00 00 85 01 00 6e 00 
debug    libnfc.bus.i2c    wrote 22 bytes successfully.
debug    libnfc.chip.pn53x    PN53x ACKed
error    libnfc.driver.pn532_i2c    Application level error detected  (127)

So I can't test all the functionnality provided by the apdu_example.
I know my mifare card is not read only because I have writen on it from another device.

Can someone hint me the problem? I have no idea if it is a bug, or if I misuse the code.
Thanks in advance

Edit
after a little investigation, the example code expect a NFC Forum type 4, where I give it a NFC Forum type 2. So I'm not sure if it is related or not.