Hi,
I am using PN7462 in my current project. I have two thread in system where in one thread PN7462 is looking for card using "phacDiscLoop_Run" and another thread is performing I2C write operation of 64bytes. Now sometimes some of the bytes gets corrupted in write operation and has been overwritten by previous byte e.g. instead of 0x09,0x0A value changes to 0x09,0x09. This value does not corrupted in EEPROM as below screen shot suggest there has been two write operation has been done by PN7462. I am comment out phacDiscLoop_Run in second thread this issue does not occur
Now question I have is listed below.
1. Does discloop and I2CM uses any shared resources?
2. If yes, do we need to use mutex between this operation?
Hi @jayesh_joshi ,
There should be no shared resource between discloop and I2CM, would that be some kind of stack leakage issue? How many bytes of stack did you set up for each thread?
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi @Kan_Li
Thanks for the response.
Please find below the detail of the stack size in firmware.
1. Thread which has I2C operation: 530
2. Thread which has Discloop operation: 438
I will try to increase the size of the I2C thread and share the result. Let me know if you have any suggestions.
I have tried increasing the stack size of both threads but the issue still persists.
One interesting thing we have found is that if we write 32bytes then occasional corruption occurs at the 30th byte. Please note corruption occurs very rarely so we are not looking into logical error. If we write 16bytes issue does not occur. Please find some of the addresses which are corrupted in very long testing.
ADDRESS | NUMBER | 32 BYTE OFFSET |
1E | 30 | 30 |
3E | 62 | 30 |
5E | 94 | 30 |
7E | 126 | 30 |
9E | 158 | 30 |
BE | 190 | 30 |
Could it be possible I2CM is unable to handle 32byte in a single transaction?
Hi @jayesh_joshi ,
No, there is no limitation regarding length, but the buffer has to be word aligned , please kindly refer to the following for details.
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------