{"action":"created","issue":{"url":"https://api.github.com/repos/NXPNFCLinux/linux_libnfc-nci/issues/44","repository_url":"https://api.github.com/repos/NXPNFCLinux/linux_libnfc-nci","labels_url":"https://api.github.com/repos/NXPNFCLinux/linux_libnfc-nci/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/NXPNFCLinux/linux_libnfc-nci/issues/44/comments","events_url":"https://api.github.com/repos/NXPNFCLinux/linux_libnfc-nci/issues/44/events","html_url":"https://github.com/NXPNFCLinux/linux_libnfc-nci/issues/44","id":229895852,"number":44,"title":"IRQ use in PN7150","user":{"login":"prattom","id":8249026,"avatar_url":"https://avatars0.githubusercontent.com/u/8249026?v=3","gravatar_id":"","url":"https://api.github.com/users/prattom","html_url":"https://github.com/prattom","followers_url":"https://api.github.com/users/prattom/followers","following_url":"https://api.github.com/users/prattom/following{/other_user}","gists_url":"https://api.github.com/users/prattom/gists{/gist_id}","starred_url":"https://api.github.com/users/prattom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prattom/subscriptions","organizations_url":"https://api.github.com/users/prattom/orgs","repos_url":"https://api.github.com/users/prattom/repos","events_url":"https://api.github.com/users/prattom/events{/privacy}","received_events_url":"https://api.github.com/users/prattom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-19T07:44:10Z","updated_at":"2017-05-23T09:29:00Z","closed_at":null,"body":"Based on reading document http://www.nxp.com/documents/application_note/AN11756.pdf and by studying driver code I assume IRQ gpio in PN7150 is used to detect tag reading. I wanted to use this IRQ to wake-up my board when tag comes near PN7150 controller and thus I register this IRQ gpio for board wake-up and used some other gpio for IRQ in dts(not connected to PN7150 and thus empty) just for some testing. But now whenever I call nfcDemoApp poll for reading tag the NFC doesn't work. It tries many times power up and power down but fails.\r\nThus my question is is IRQ being used for some other use other than tag detection? Can I avoid using IRQ in PN7150 just to perform tag read operation(I have some other method to detect tag and thus not relying on PN7150IRQ)?\r\n\r\nMy log after disabling IRQ\r\nnfcDemoApp poll\r\nNxpHal:     pn54x_dev_open : 10,57\r\nEntering phNxpNciHal_init_monitorpn54x_dev_ioctl, cmd=1074063617, arg=1\r\n\r\nNxpHal:     Returning with SUCCpn544_enable power on\r\nESS\r\nNxpTml:     Opening port=/dev/pn544\r\n\r\nNxpTml:     phTmlNfc_i2c_reset(), VEN level 1\r\nNxpTml:     pn54x_dev_ioctl, cmd=1074063617, arg=0\r\nphTmlNfc_i2c_reset(), VEN level 0pn544_disable power off\r\n\r\nNxpTml:     pn54x_dev_ioctl, cmd=1074063617, arg=1\r\nphTmlNfc_i2c_reset(), VEN level 1pn544_enable power on\r\n\r\nNxpTml:     PN54X - Tml Reader Thread Started................\r\nNxpTml:     PN54X - Read requested.....\r\nNxpTml:     PN54X - Invoking I2C Read.....\r\nNxpTml:     PN54X - Tml Writer Thread Started................\r\nNxpTml:     PN54X - Tml Writer Thread Running................\r\nNxpTml:     PN54X - Write requested.....\r\nNxpTml:     PN54X - Invoking I2C Write.....\r\nNxpHal:     thread started\r\nNxpTml:     PN54X - I2C Write successful.....\r\nNxpTml:     PN54X - Posting Fresh Write message.....\r\nNxpTml:     PN54X - Tml Writer Thread Running................\r\n\r\nNxpHal:     write successful status = 0x0\r\nNxpHal:     Response timer started\r\nNxpHal:     Waiting after ext cmd sent\r\nNxpHal:     pn54x_dev_ioctl, cmd=1074063617, arg=1\r\nhal_extns_write_rsp_timeout_cb - pn544_enable power on\r\nwrite timeout!!!\r\nNxpHal:     Response timer stopped\r\nNxpHal:     Callback Status is failed!! Timer Expired!! Couldn't read it! 0xff\r\nNxpHal:     NCI_CORE_RESET: Failed\r\nNxpHal:     Power Cycle\r\nNxpTml:     phTmlNfc_i2c_reset(), VEN level 1\r\nNxpTml:     pn54x_dev_ioctl, cmd=1074063617, arg=0\r\nphTmlNfc_i2c_reset(), VEN level 0pn544_disable power off\r\n\r\nNxpTml:     pn54x_dev_ioctl, cmd=1074063617, arg=1\r\nphTmlNfc_i2c_reset(), VEN level 1pn544_enable power on\r\n\r\nNxpHal:     PN54X Reset - SUCCESS\r\nNxpTml:     PN54X - Write requested.....\r\nNxpTml:     PN54X - Invoking I2C Write.....\r\nNxpTml:     PN54X - I2C Write successful.....\r\nNxpTml:     PN54X - Posting Fresh Write message.....\r\nNxpTml:     PN54X - Tml Writer Thread Running................\r\n\r\nNxpHal:     write successful status = 0x0\r\nNxpHal:     Response timer started\r\nNxpHal:     Waiting after ext cmd sent\r\nNxpHal:     pn54x_dev_ioctl, cmd=1074063617, arg=1\r\nhal_extns_write_rsp_timeout_cb - pn544_enable power on\r\nwrite timeout!!!\r\nNxpHal:     Response timer stopped\r\nNxpHal:     Callback Status is failed!! Timer Expired!! Couldn't read it! 0xff\r\nNxpHal:     NCI_CORE_RESET: Failed\r\nNxpHal:     Power Cycle\r\nNxpTml:     phTmlNfc_i2c_reset(), VEN level 1\r\nNxpTml:     pn54x_dev_ioctl, cmd=1074063617, arg=0\r\nphTmlNfc_i2c_reset(), VEN level 0pn544_disable power off\r\n\r\nNxpTml:     pn54x_dev_ioctl, cmd=1074063617, arg=1\r\nphTmlNfc_i2c_reset(), VEN level 1pn544_enable power on\r\n\r\nNxpHal:     PN54X Reset - SUCCESS\r\nNxpTml:     PN54X - Write requested.....\r\nNxpTml:     PN54X - Invoking I2C Write.....\r\nNxpTml:     PN54X - I2C Write successful.....\r\nNxpTml:     PN54X - Posting Fresh Write message.....\r\nNxpTml:     PN54X - Tml Writer Thread Running................\r\n\r\nNxpHal:     write successful status = 0x0\r\nNxpHal:     Response timer started\r\nNxpHal:     Waiting after ext cmd sent\r\nNxpHal:     pn54x_dev_ioctl, cmd=1074063617, arg=1\r\nhal_extns_write_rsp_timeout_cb - pn544_enable power on\r\nwrite timeout!!!\r\nNxpHal:     Response timer stopped\r\nNxpHal:     Callback Status is failed!! Timer Expired!! Couldn't read it! 0xff\r\nNxpHal:     NCI_CORE_RESET: Failed\r\nNxpHal:     Power Cycle\r\nNxpTml:     phTmlNfc_i2c_reset(), VEN level 1\r\nNxpTml:     pn54x_dev_ioctl, cmd=1074063617, arg=0\r\nphTmlNfc_i2c_reset(), VEN level 0pn544_disable power off\r\n\r\nNxpTml:     pn54x_dev_ioctl, cmd=1074063617, arg=1\r\nphTmlNfc_i2c_reset(), VEN level 1pn544_enable power on\r\n\r\nNxpHal:     PN54X Reset - SUCCESS\r\nNxpTml:     PN54X - Write requested.....\r\nNxpTml:     PN54X - Invoking I2C Write.....\r\nNxpTml:     PN54X - I2C Write successful.....\r\nNxpTml:     PN54X - Posting Fresh Write message.....\r\nNxpTml:     PN54X - Tml Writer Thread Running................\r\n\r\nNxpHal:     write successful status = 0x0\r\nNxpHal:     Response timer started\r\nNxpHal:     Waiting after ext cmd sent\r\nNxpHal:     hal_extns_write_rsp_timeout_cb - write timeout!!!\r\nNxpHal:     Response timer stopped\r\nNxpHal:     Callback Status is failed!! Timer Expired!! Couldn't read it! 0xff\r\nNxpHal:     NCI_CORE_RESET: Failed\r\nNxpTml:     PN54X - Write request NOT enabled\r\n  "},"comment":{"url":"https://api.github.com/repos/NXPNFCLinux/linux_libnfc-nci/issues/comments/303343316","html_url":"https://github.com/NXPNFCLinux/linux_libnfc-nci/issues/44#issuecomment-303343316","issue_url":"https://api.github.com/repos/NXPNFCLinux/linux_libnfc-nci/issues/44","id":303343316,"user":{"login":"jgeslin","id":11649902,"avatar_url":"https://avatars3.githubusercontent.com/u/11649902?v=3","gravatar_id":"","url":"https://api.github.com/users/jgeslin","html_url":"https://github.com/jgeslin","followers_url":"https://api.github.com/users/jgeslin/followers","following_url":"https://api.github.com/users/jgeslin/following{/other_user}","gists_url":"https://api.github.com/users/jgeslin/gists{/gist_id}","starred_url":"https://api.github.com/users/jgeslin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgeslin/subscriptions","organizations_url":"https://api.github.com/users/jgeslin/orgs","repos_url":"https://api.github.com/users/jgeslin/repos","events_url":"https://api.github.com/users/jgeslin/events{/privacy}","received_events_url":"https://api.github.com/users/jgeslin/received_events","type":"User","site_admin":false},"created_at":"2017-05-23T09:29:00Z","updated_at":"2017-05-23T09:29:00Z","body":"The IRQ pin is used by the PN7150 to signal to the host that data are pending on the I2C interface and that the host must initiate I2C read request to get the data from PN7150. It indeed indicates that a tag has been discovered, since it triggers an RF_DISCOVER_NTF NCI frame, but not only.\r\nHowever, in the nxp-pn5xx kernel module, you can avoid using the IRQ in the pn54x_dev_read by instead doing regular I2C read (polling) request (i2c_master_recv function call). The PN7150 will respond with wrong values (first byte will be either its I2C address or 0xFF) until it has something to send (valid NCI frame).\r\n\r\n"}}
{"actor":{"display_login":"jgeslin"}}