Dear NXP:
Test Demo: NXP-NCI2.0_LPC55S6x_examples - "CE_scenario2"
Refer to AN13861 add "Configure_NFCEE_NDEF_and_Open_Logical_connection()" in "NFCEE_NDEF_Configuration()" of NxpNci20.c
This document said:"After the communication channel is open, there is read and write-access".
However, it is can not to use TagInfo for read NDEF and TagWrite for write NDEF to PN7160 emulation card.
Attached is my code, please help to check it.
void Configure_NFCEE_NDEF_and_Open_Logical_connection(){
uint8_t NFCEE_DISCOVER_CMD[] = {0x22, 0x00, 0x00};
uint8_t NFCEE_MODE_SET_CMD[] = {0x22, 0x01, 0x02, 0x10, 0x01};
uint8_t CORE_CONN_CREATE_CMD[] = {0x20, 0x04, 0x06, 0x03, 0x01, 0x01, 0x02, 0x10, 0x00};
uint8_t Answer[MAX_NCI_FRAME_SIZE];
uint16_t AnswerSize;
NxpNci_HostTransceive(NFCEE_DISCOVER_CMD, sizeof(NFCEE_DISCOVER_CMD), Answer,
sizeof(Answer), &AnswerSize);
NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_INFINITE);
NxpNci_HostTransceive(NFCEE_MODE_SET_CMD, sizeof(NFCEE_MODE_SET_CMD), Answer,
sizeof(Answer), &AnswerSize);
NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_INFINITE);
NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_INFINITE);
NxpNci_HostTransceive(CORE_CONN_CREATE_CMD, sizeof(CORE_CONN_CREATE_CMD), Answer,
sizeof(Answer), &AnswerSize);
NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_INFINITE);
}
Thanks for your support!
Solved! Go to Solution.
Hello join_ren,
I talked with a responsible SW Engineer and for this example (CE_scenario2), the "Write" function is not supported at this moment.
But there is a workaround you can do:
1. Run RWandCE example + activate the CE mode 2 with the help of the dedicated NCI command as shown below:
2. Go to the source file and disable Poll modes (just comment them) and keep only the Listen modes as shown in the picture:
Then the example should work and you should be able read/write the NDEF message.
Please confirm
We are also very sorry for that inconvenience our SW team will update the example as soon as possible.
Thanks !
BR
Tomas
Hello join_ren,
I talked with a responsible SW Engineer and for this example (CE_scenario2), the "Write" function is not supported at this moment.
But there is a workaround you can do:
1. Run RWandCE example + activate the CE mode 2 with the help of the dedicated NCI command as shown below:
2. Go to the source file and disable Poll modes (just comment them) and keep only the Listen modes as shown in the picture:
Then the example should work and you should be able read/write the NDEF message.
Please confirm
We are also very sorry for that inconvenience our SW team will update the example as soon as possible.
Thanks !
BR
Tomas
Hi Tomas:
Thanks for your quick reply.
I tried to modify the ”RWandCE“ code, but the message "Error: cannot configure NXPNCI settings"
1、Nfc_setting.h
uint8_t NxpNci_CORE_CONF[]={0x20, 0x02, 0x05, 0x01, /* CORE_SET_CONFIG_CMD */
0x00, 0x02, 0xFE, 0x01, /* TOTAL_DURATION */
0xA0, 0x95, 0x01, 0x01, /* CE - Scenario 2*/
0xA0, 0xAF, 0x0C, 0x03, 0xC0, 0x80, 0xA0, 0x00, 0x03, 0xC0, 0x80, 0xA0, 0x00, 0x00, 0x08, /*DLMA- Disable */
};
2、nfc_example_RWandCE.c
/* Discovery loop configuration according to the targeted modes of operation */
unsigned char DiscoveryTechnologies[] = {
/* MODE_POLL | TECH_PASSIVE_NFCA,
MODE_POLL | TECH_PASSIVE_NFCF,
MODE_POLL | TECH_PASSIVE_NFCB,
MODE_POLL | TECH_PASSIVE_15693,*/
MODE_LISTEN | TECH_PASSIVE_NFCA,
MODE_LISTEN | TECH_PASSIVE_NFCB,
};
log:
Running the NXP-NCI2.0 example (I2C interface)
NCI >> 20 00 01 01
NCI << 40 00 01 00
NCI << 60 00 09 02 01 20 04 04 71 12 50 0a
NCI >> 20 01 02 00 00
NCI << 40 01 1e 00 1a 7e 06 03 01 d0 02 ff ff 01 ff 00 08 00 00 01 00 02 00 03 00 80 00 82 00 83 ...
NCI >> 2f 00 01 00
NCI << 4f 00 01 00
NCI >> 20 02 05 01 00 02 fe 01 a0 95 01 01 a0 af 0c 03 c0 80 a0 00 03 c0 80 a0 00 00 08
NCI << 40 02 01 05
Error: cannot configure NXPNCI settings
(Attached is the RWandCE project)
Hello join_ren,
The issue is Nfc_setting.h
Use e.g. this one:
#if NXP_CORE_CONF
/* NCI standard dedicated settings
* Refer to NFC Forum NCI standard for more details
*/
uint8_t NxpNci_CORE_CONF[]={0x20, 0x02, 0x18, 0x03, /* CORE_SET_CONFIG_CMD */
0x00, 0x02, 0xFE, 0x01, /* TOTAL_DURATION */
0xA0, 0x95, 0x01, 0x01, /* CE - Scenario 2*/
0xA0, 0xAF, 0x0C, 0x03, 0xC0, 0x80, 0xA0, 0x00, 0x03, 0xC0, 0x80, 0xA0, 0x00, 0x00, 0x08, /* DLMA- Disable */
};
#endifin the nfc example file,
In the nfc_example_RWandCE.c, the following needs to be commented:
/* Discovery loop configuration according to the targeted modes of operation */
unsigned char DiscoveryTechnologies[] = {
/*MODE_POLL | TECH_PASSIVE_NFCA,
MODE_POLL | TECH_PASSIVE_NFCF,
MODE_POLL | TECH_PASSIVE_NFCB,
MODE_POLL | TECH_PASSIVE_15693,*/
MODE_LISTEN | TECH_PASSIVE_NFCA,
MODE_LISTEN | TECH_PASSIVE_NFCB,
};
BR
Tomas
Hello join_ren,
Thanks for your reply!
I tried your code + an Android phone + NXP TagWriter app and it seems to be working:
Are you using Android or iPhone?
BR
Tomas
Dear Tomas:
Thanks for your quick reply.
I use code + iphone + NXP Tagwriter.
1、Colud you provide NXP Tagwrite apk on Android? I'll try it on an android phone.
2、What is the FW version of your PN7160?
Thanks for your support.
Hello join_ren,
1. The app is available here ->https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter&hl=en_US
I also put the apk in the attachment.
2. The FW is 12.50.05
BR
Tomas
Dear Tomas:
Great. Thanks for your strong support.
The problem has been solved, please refer to the screenshot below "thanks tomas parizek"
Hello join_ren,
That's good to hear!
Do not hesitate to contact me if you need more assistance.
PS: I like the print screen from TagInfo
BR
Tomas
Dear Tomas:
Got it. Thanks for your support.
Join Ren
Hello join_ren,
If you run the NXP-NCI2.0_LPC55S6x_examples - "CE_scenario2" you should see "NXP2023" NDEF message.
This should also be possible without the Tag Info app, only the NFC must be enabled on your phone.
Is that working on your side?
BR
Tomas
Hi Tomas:
Thanks for your reply.
"NXP 2023" --> "Taikang" This is modified by me, please refer to the following code in NxpNci20.c. (Attached is Taginfo NDEF log)
//Write NDEF message
//We will store "NXP 2023" into NFCEE_NDEF : "NXP 2023" = "0x4E 0x58 0x50 0x20 0x32 0x30 0x32 0x33"
//uint8_t secondWrite[] = {0x05, 0x00, 0x17, 0x00, 0xD6, 0x00, 0x02, 0x12, 0xD1, 0x01, 0x0E, 0x54, 0x05,0x65, 0x6E, 0x2D, 0x75,0x73, 0x4E, 0x58, 0x50, 0x20, 0x32, 0x30, 0x32, 0x33};
//modify Write "Taikang" = "0x54 0x61 0x69 0x20 0x4b 0x61 0x6e 0x67"
uint8_t secondWrite[] = {0x05, 0x00, 0x17, 0x00, 0xD6, 0x00, 0x02, 0x12, 0xD1, 0x01, 0x0E, 0x54, 0x05,0x65, 0x6E, 0x2D, 0x75,0x73, 0x54,0x61, 0x69,0x20, 0x4b, 0x61, 0x6e, 0x67};
I want to know how to write an NDEF message using Tagwrite and then read the NDEF message using the Taginfo tool on the "CE_scenario2" demo.
Thanks for your support.