Hello,
i'm using the NHS3152 as a smart sensor. The device is meant to be placed on such a tiny substrate that I have no room to connect the require pins for programming.
Hence I would like to flash it using NFC (providing external DC voltage to the NHS3152 while flashing, I have room for that. That supply is then removed to deploy the sensor). There is an app available NHS31xx NFC Program Loader – Apps on Google Play
Is there another way to do it? For instance using an NFC reader chip such the PN7642 which I'm also using to power the sensor and exchange data.
If yes can you explain how to do it?
Thanks
Cyril
已解决! 转到解答。
Hello CyrilBZH,
I would start from the Python "nfcloader" application in the "tools" folder of the NHS3152 SDK.
This application is designed to work with a USB connected NFC reader but can be easily extended to other readers.
1) If you can run the CCID demo on the PN7642, I expect you can directly interface with it using the --pyscard option on nfcloader.py (*UNTESTED*, I don't have the PN7642 devkit available)
2) If you control the PN7642 using Python in some other way, you can extend nfcloader.py to use that interface. The connection between the programming logic and the actual reader is done via the "TagHandler" class, the definition is in "modules/taghandler.py".
Besides the constructor which stores the connection info, only 2 functions need to be provided namely read and write an ndef message
def read(self):
"""
This function reads the first record in the tag (NDEF message)
@return string containing the record payload
"""
def write(self, packet):
"""
This function writes a single MimeType record NDEF message including the packet
@param packet : The packet to be send to the tag
"""
Two subclasses of TagHandler are included and can serve as example:
Depending on the level of the PN7642 api, select the best matching subclass as a starting point for your implementation.
Another option is to translate the Python code in "modules/protocol.py" to C and run it on the PN7642 devkit or on your NFC reader host.
Kind regards,
Patrick
Hello CyrilBZH,
I would start from the Python "nfcloader" application in the "tools" folder of the NHS3152 SDK.
This application is designed to work with a USB connected NFC reader but can be easily extended to other readers.
1) If you can run the CCID demo on the PN7642, I expect you can directly interface with it using the --pyscard option on nfcloader.py (*UNTESTED*, I don't have the PN7642 devkit available)
2) If you control the PN7642 using Python in some other way, you can extend nfcloader.py to use that interface. The connection between the programming logic and the actual reader is done via the "TagHandler" class, the definition is in "modules/taghandler.py".
Besides the constructor which stores the connection info, only 2 functions need to be provided namely read and write an ndef message
def read(self):
"""
This function reads the first record in the tag (NDEF message)
@return string containing the record payload
"""
def write(self, packet):
"""
This function writes a single MimeType record NDEF message including the packet
@param packet : The packet to be send to the tag
"""
Two subclasses of TagHandler are included and can serve as example:
Depending on the level of the PN7642 api, select the best matching subclass as a starting point for your implementation.
Another option is to translate the Python code in "modules/protocol.py" to C and run it on the PN7642 devkit or on your NFC reader host.
Kind regards,
Patrick