Shared resources between Discloop and I2CM in PN7462

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared resources between Discloop and I2CM in PN7462

719 Views
jayesh_joshi
Contributor IV

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? 

 

Tags (3)
0 Kudos
4 Replies

659 Views
Kan_Li
NXP TechSupport
NXP TechSupport

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.
-------------------------------------------------------------------------------

0 Kudos

649 Views
jayesh_joshi
Contributor IV

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. 

0 Kudos

575 Views
jayesh_joshi
Contributor IV

@Kan_Li 

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.

ADDRESSNUMBER32 BYTE OFFSET
1E3030
3E6230
5E9430
7E12630
9E15830
BE19030

 

Could it be possible I2CM is unable to handle 32byte in a single transaction? 

0 Kudos

557 Views
Kan_Li
NXP TechSupport
NXP TechSupport

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.

Kan_Li_0-1638543155732.png

 

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.
-------------------------------------------------------------------------------

 

0 Kudos