CAAM concurrent access on MIMXRT1176

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

CAAM concurrent access on MIMXRT1176

Jump to solution
1,245 Views
jacquessamoun
Contributor I

Hello,

my application is based on MIMXRT1176 and uses Bluetooth (external chip) thru the SDK Zephyr bluetooth library (SDK version 2.13.1). The BT library uses CAAM by default, and everything is working perfectly, as far as BT is concerned.

The problem is that, my own application code needs to use mbedtls for some encryption and CERT operations. As soon as i use the (for example)

mbedtls_ctr_drbg_seed()
 
it would hang on CAAM_wait in the underlying CAAM driver .... i am guessing that, both BT and my code want to use jobring0, so there is a conflict. Indeed, is that is the case, i even should not need to initialise CAAM in my code, as this is alreday done in BT
 
Is there a clean way to allow 2 entities (among them a library, that i cannot modify) to use the same CAAM concurrently thru a high level API, like mbedtls  ?
I must be missing something, as this sounds like a trivial and common use case, but I could not find any way of doing so far, neither some relevant instructions in the SDK doc.
Any help greatly appreciated,
Jacques
0 Kudos
Reply
1 Solution
1,213 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

It is suggested to use a second job ring, if CAAM was already initialized before then it should not be initialized again. Unfortunately, there not exist  a library, however you can make handles and variables extern so they can be used on different sides.

Best regards,
Omar

View solution in original post

0 Kudos
Reply
2 Replies
1,182 Views
jacquessamoun
Contributor I

Hi Omar, thanks for the support

actually i didn't plan to modify the mbedtls stuff and pull it in as is in my project.

Now it seems that this needs to be internalised into my project and modified. Is that what you

suggest ?

Thanks,

Jacques

0 Kudos
Reply
1,214 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

It is suggested to use a second job ring, if CAAM was already initialized before then it should not be initialized again. Unfortunately, there not exist  a library, however you can make handles and variables extern so they can be used on different sides.

Best regards,
Omar

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1931831%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECAAM%20concurrent%20access%20on%20MIMXRT1176%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1931831%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3Emy%20application%20is%20based%20on%20MIMXRT1176%20and%20uses%20Bluetooth%20(external%20chip)%20thru%20the%20SDK%20Zephyr%20bluetooth%20library%20(SDK%20version%202.13.1).%20The%20BT%20library%20uses%20CAAM%20by%20default%2C%20and%20everything%20is%20working%20perfectly%2C%20as%20far%20as%20BT%20is%20concerned.%3C%2FP%3E%3CP%3EThe%20problem%20is%20that%2C%20my%20own%20application%20code%20needs%20to%20use%20mbedtls%20for%20some%20encryption%20and%20CERT%20operations.%20As%20soon%20as%20i%20use%20the%20(for%20example)%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3Embedtls_ctr_drbg_seed()%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eit%20would%20hang%20on%20CAAM_wait%20in%20the%20underlying%20CAAM%20driver%20....%20i%20am%20guessing%20that%2C%20both%20BT%20and%20my%20code%20want%20to%20use%20jobring0%2C%20so%20there%20is%20a%20conflict.%20Indeed%2C%20is%20that%20is%20the%20case%2C%20i%20even%20should%20not%20need%20to%20initialise%20CAAM%20in%20my%20code%2C%20as%20this%20is%20alreday%20done%20in%20BT%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIs%20there%20a%20clean%20way%20to%20allow%202%20entities%20(among%20them%20a%20library%2C%20that%20i%20cannot%20modify)%20to%20use%20the%20same%20CAAM%20concurrently%20thru%20a%20high%20level%20API%2C%20like%20mbedtls%26nbsp%3B%20%3F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EI%20must%20be%20missing%20something%2C%20as%20this%20sounds%20like%20a%20trivial%20and%20common%20use%20case%2C%20but%20I%20could%20not%20find%20any%20way%20of%20doing%20so%20far%2C%20neither%20some%20relevant%20instructions%20in%20the%20SDK%20doc.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EAny%20help%20greatly%20appreciated%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EJacques%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1934225%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20CAAM%20concurrent%20access%20on%20MIMXRT1176%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1934225%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Omar%2C%20thanks%20for%20the%20support%3C%2FP%3E%3CP%3Eactually%20i%20didn't%20plan%20to%20modify%20the%20mbedtls%20stuff%20and%20pull%20it%20in%20as%20is%20in%20my%20project.%3C%2FP%3E%3CP%3ENow%20it%20seems%20that%20this%20needs%20to%20be%20internalised%20into%20my%20project%20and%20modified.%20Is%20that%20what%20you%3C%2FP%3E%3CP%3Esuggest%20%3F%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EJacques%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1933274%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20CAAM%20concurrent%20access%20on%20MIMXRT1176%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1933274%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIt%20is%20suggested%20to%20use%20a%20second%20job%20ring%2C%20if%20CAAM%20was%20already%20initialized%20before%20then%20it%20should%20not%20be%20initialized%20again.%20Unfortunately%2C%20there%20not%20exist%26nbsp%3B%20a%20library%2C%20however%20you%20can%20make%20handles%20and%20variables%20extern%20so%20they%20can%20be%20used%20on%20different%20sides.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EOmar%3C%2FP%3E%3C%2FLINGO-BODY%3E