SE050 heap issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SE050 heap issue

573 Views
pranavitraj
Contributor I

Hey there,

I’m trying to integrate the Se050 with the LPC55S.

The physical connections are as follows:

- Host MCU -> Se050 -> Sensor (on I2C)

When the bus communications intervene between the Host MCU and Se050, i2c comms hangs.

 

The following sequence is applied to recover it 

 

- I2C recovery using GPIOs

- Reinitialize the Se050 by executing the following sequence:

  - sss_close_session()

  - open_boot_session()

 

During the open session, I encountered an error indicating that the open session failed. With a retry mechanism and a 100ms wait period between each retry, if the first attempt fails, I’m able to communicate again with the Se050. However, to simulate this condition, we manually caused the I2C hang multiple times and discovered that the heap memory leakage when the reinit and open session fails with timeout error and or write nack error 

 

Is this a known issue?
please provide any workarounds. 

Labels (1)
0 Kudos
Reply
3 Replies

549 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @pranavitraj ,

 

Did you test it based on the plug&trust MW ? It has already supported LPC55S69 , please kindly refer to https://www.nxp.com/docs/en/application-note/AN12542.pdf 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.
-------------------------------------------------------------------------------

0 Kudos
Reply

388 Views
pranavitraj
Contributor I

 

Hi Kan,

 

I tried the newer version of the middleware which resolved the heap issue.

 

Thank you so much for your support and time.

 

Just one more small observation: during the same test, the se_reinit sometimes got stuck waiting for an ACK. This happened specifically when we received continuous NACKs from the SE device because there was no termination. Please suggest a solution for this as well.

 

0 Kudos
Reply

178 Views
pranavitraj
Contributor I

Hi Kan,

Any suggetion for above.

here is specific call stack for no termination

systick_delay() at timer_kinetis_bm.c
sm_sleep() at timer_kinetis_bm.c
BackOffDelay_Wait() at i2c_lpc55sxx.c
kinetisI2cStatusToAxStatus() at i2c_lpc55sxx.c
axI2CRead() at i2c_lpc55sxx.c 
phPalEse_i2c_read() at phNxpEsePal_i2c.c 
phNxpEse_readPacket() at phNxpEse_Api.c
phNxpEse_read() at phNxpEse_Api.c 
phNxpEseProto7816_GetRawFrame() at phNxpEseProto7816_3.c 
phNxpEseProto7816_ProcessResponse() at phNxpEseProto7816_3.c
TransceiveProcess() at phNxpEseProto7816_3.c

there is no termination for the number of times nack it waits forever 


also we see one problem related to the 
deinit and reinit of se050 sequence 

after deinit which is a END_OF_APDU command SE did not reply for 5 seconds 
can you please suggest for this also or is it known time ???

Regards
Pranav

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2315786%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ESE050%20heap%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2315786%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHey%20there%2C%3C%2FP%3E%3CP%3E%3CSPAN%3EI%E2%80%99m%20trying%20to%20integrate%20the%20Se050%20with%20the%20LPC55S.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20physical%20connections%20are%20as%20follows%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E-%20Host%20MCU%20-%26gt%3B%20Se050%20-%26gt%3B%20Sensor%20(on%20I2C)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EWhen%20the%20bus%20communications%20intervene%20between%20the%20Host%20MCU%20and%20Se050%2C%20i2c%20comms%20hangs.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20following%20sequence%20is%20applied%20to%20recover%20it%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E-%20I2C%20recovery%20using%20GPIOs%3C%2FP%3E%3CP%3E-%20Reinitialize%20the%20Se050%20by%20executing%20the%20following%20sequence%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%20-%20sss_close_session()%3C%2FP%3E%3CP%3E%26nbsp%3B%20-%20open_boot_session()%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EDuring%20the%20open%20session%2C%20I%20encountered%20an%20error%20indicating%20that%20the%20open%20session%20failed.%20With%20a%20retry%20mechanism%20and%20a%20100ms%20wait%20period%20between%20each%20retry%2C%20if%20the%20first%20attempt%20fails%2C%20I%E2%80%99m%20able%20to%20communicate%20again%20with%20the%20Se050.%20However%2C%20to%20simulate%20this%20condition%2C%20we%20manually%20caused%20the%20I2C%20hang%20multiple%20times%20and%20discovered%20that%20the%20heap%20memory%20leakage%20when%20the%20reinit%20and%20open%20session%20fails%20with%20timeout%20error%20and%20or%20write%20nack%20error%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIs%20this%20a%20known%20issue%3F%3CBR%20%2F%3Eplease%20provide%20any%20workarounds.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2315786%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ESE050%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2315963%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20SE050%20heap%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2315963%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F147246%22%20target%3D%22_blank%22%3E%40pranavitraj%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EDid%20you%20test%20it%20based%20on%20the%20plug%26amp%3Btrust%20MW%20%3F%20It%20has%20already%20supported%20LPC55S69%20%2C%20please%20kindly%20refer%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12542.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12542.pdf%3C%2FA%3E%26nbsp%3Bfor%20details.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHave%20a%20great%20day%2C%3CBR%20%2F%3EKan%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3CBR%20%2F%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2332097%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20SE050%20heap%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2332097%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EHi%20Kan%2C%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EI%20tried%20the%20newer%20version%20of%20the%20middleware%20which%20resolved%20the%20heap%20issue.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EThank%20you%20so%20much%20for%20your%20support%20and%20time.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EJust%20one%20more%20small%20observation%3A%20during%20the%20same%20test%2C%20the%20se_reinit%20sometimes%20got%20stuck%20waiting%20for%20an%20ACK.%20This%20happened%20specifically%20when%20we%20received%20continuous%20NACKs%20from%20the%20SE%20device%20because%20there%20was%20no%20termination.%20Please%20suggest%20a%20solution%20for%20this%20as%20well.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2345599%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20SE050%20heap%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2345599%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Kan%2C%3CBR%20%2F%3E%3CBR%20%2F%3EAny%20suggetion%20for%20above.%3CBR%20%2F%3E%3CBR%20%2F%3Ehere%20is%20specific%20call%20stack%20for%20no%20termination%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Esystick_delay()%20at%20timer_kinetis_bm.c%3CBR%20%2F%3Esm_sleep()%20at%20timer_kinetis_bm.c%3CBR%20%2F%3EBackOffDelay_Wait()%20at%20i2c_lpc55sxx.c%3CBR%20%2F%3EkinetisI2cStatusToAxStatus()%20at%20i2c_lpc55sxx.c%3CBR%20%2F%3EaxI2CRead()%20at%20i2c_lpc55sxx.c%E2%80%83%3CBR%20%2F%3EphPalEse_i2c_read()%20at%20phNxpEsePal_i2c.c%E2%80%83%3CBR%20%2F%3EphNxpEse_readPacket()%20at%20phNxpEse_Api.c%3CBR%20%2F%3EphNxpEse_read()%20at%20phNxpEse_Api.c%E2%80%83%3CBR%20%2F%3EphNxpEseProto7816_GetRawFrame()%20at%20phNxpEseProto7816_3.c%E2%80%83%3CBR%20%2F%3EphNxpEseProto7816_ProcessResponse()%20at%20phNxpEseProto7816_3.c%3CBR%20%2F%3ETransceiveProcess()%20at%20phNxpEseProto7816_3.c%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3Ethere%20is%20no%20termination%20for%20the%20number%20of%20times%20nack%20it%20waits%20forever%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3Ealso%20we%20see%20one%20problem%20related%20to%20the%26nbsp%3B%3CBR%20%2F%3Edeinit%20and%20reinit%20of%20se050%20sequence%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3Eafter%20deinit%20which%20is%20a%20END_OF_APDU%20command%20SE%20did%20not%20reply%20for%205%20seconds%26nbsp%3B%3CBR%20%2F%3Ecan%20you%20please%20suggest%20for%20this%20also%20or%20is%20it%20known%20time%20%3F%3F%3F%3CBR%20%2F%3E%3CBR%20%2F%3ERegards%3CBR%20%2F%3EPranav%3C%2FP%3E%3C%2FLINGO-BODY%3E