2024-03-07 02:31 AM
I'm working on a project with an STM32U5 device (NUCLEO-U5A5ZJ-Q) and I need to integrate cJSON, mbedTLS, lwIP, and FatFS to load and flash a configuration file cacert.pemonto the STM32 device. However, when I searched for mbedtls and lwip in the middleware and software packages, I couldn't find them.
Can anyone provide suggestions or guidance on how to integrate mbedtls, lwIP, and FatFS into my STM32 project? Additionally, I'm curious if there's a cJSON library available for STM32.
https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/NUCLEO-U5A5ZJ-Q
https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Middlewares/Third_Party
https://github.com/STMicroelectronics/STM32CubeH7
https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Middlewares/Third_Party
I've noticed that the STM32H7 series has middleware third-party tools like lwIP and mbedTLS available, but these are not included in the STM32U5 series. Is there a specific reason why these middleware components are absent in the STM32U5 series compared to the H7 series?
Thank you in advance for your help!
Solved! Go to Solution.
2024-03-16 02:49 AM
@srikanthpalvai did you not see what @STea wrote:
@STea wrote:Hello @srikanthpalvai ,
Can you please input your new queries in a new thread for better visibility and we can proceed by closing this one .
BR
2024-03-07 03:44 AM
Hello @srikanthpalvai ,
In fact MbedTLS is well supported in the STM32U5 series and it's part of the TFM solution implementation as you can find in the TFM project under TFM_SBSFU_Boot alt_xx.c files which leverage the wrapper layer of MbedTLS to be HW accelerated which are part of The PSA cryptography API that provides access to a set of cryptographic primitives .MbedTLS can be found under STM32CubeU5/Middlewares/Third_Party/mbed-crypto at main · STMicroelectronics/STM32CubeU5 (github.com).
Regarding the support for lwIP it is not supported for the U5 series instead you can replace it by the NetXduo from AzureRTOS you can find some examples of Netxduo Under STM32CubeU5/Projects/B-U585I-IOT02A/Applications/NetXDuo at main · STMicroelectronics/STM32CubeU5 (github.com)
FatFS is replaced by Azure FileX you can find a n example on it's implementation under STM32CubeU5/Projects/B-U585I-IOT02A/Applications/FileX at main · STMicroelectronics/STM32CubeU5 (github.com).
in the U5 series the Middleware Package is centered on the Azure middleware ecosystem you can read more about it in the Azure official documentation .
BR
2024-03-07 05:18 AM - edited 2024-03-07 02:43 PM
Thanks for the quick response @STea
STM32CubeU5/Middlewares/Third_Party/mbed-crypto at main · STMicroelectronics/STM32CubeU5 (github.com).
Would it be sufficient to copy the mbed-crypto directory directly into my project, or are there additional steps I need to follow for proper integration?
STM32CubeU5/Projects/B-U585I-IOT02A/Applications/NetXDuo at main · STMicroelectronics/STM32CubeU5 (github.com)
https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Middlewares/ST/netxduo
How can I integrate the NetXDuo TCP/IP stack into my project after establishing a PPP communication link with the SIM7600 module?
STM32CubeU5/Projects/B-U585I-IOT02A/Applications/FileX at main · STMicroelectronics/STM32CubeU5 (github.com).
Here the example is to create the STM.TXT in the run-time
/* Create a file called STM32.TXT in the root directory. */
nor_ospi_status = fx_file_create(&nor_ospi_flash_disk, "STM32.TXT");
But I have my pre-configured config.ini file and cacert.pem files for mbedlts communication.
How can inject them into the stm32 target? Could you please share an example of it?
Is there any cJSON library available for STM32?
2024-03-07 05:44 AM
@srikanthpalvai wrote:Is there any cJSON library available for STM32?
Why would it be in any way specific to STM32 ?
Surely, it's just about parsing text - which isn't going to rely on anything STM32-specific?
You can simply dump the source into your project:
2024-03-07 05:47 AM
Thanks @Andrew Neil
2024-03-07 02:43 PM - edited 2024-03-07 03:53 PM
After enabling the core, Netxduo is getting enabled bu why do I enable threadX first?
I found crypto here but it's not the mbed-crypto
@STea Could you please give me some inputs to my reply's
2024-03-11 06:17 AM
@STea Kindly Remainder
2024-03-11 06:58 AM
Hello @srikanthpalvai ,
First of all sorry for the delay.
answering your requests now :
NetX Duo assumes the existence of ThreadX and depends on its thread execution, suspension, periodic timers, and mutual exclusion facilities. you can get more indepth details on this in this link .
NetX Duo Crypto Module is a lightweight cryptographic library that is designed specifically for use with NetX Duo TCP/IP networking stack. It provides a set of cryptographic functions that are optimized for use in embedded systems with limited resources. The NetX Duo Crypto Module supports a range of cryptographic algorithms, including AES, DES, SHA-1, SHA-256, and HMAC.
MbedTLS is not integrated by default in CubeMX so you need to add it to your project manually .
this can be done by adding the source file needed to your project as well as the necessary includes or you can build a static version of the Mbedtls library and use it with static link.
see the following link for more details
Porting Mbed TLS to a new environment or OS — Mbed TLS documentation (mbed-tls.readthedocs.io)
this can be quite challenging so i recommend you stick with the Crytpo module for Netxduo which offer a very similar functionality to the MbedTLS library .
BR
2024-03-11 04:29 PM
@STea
Thank you so much for the information.
Could you please give me some more context below queries as well
STM32CubeU5/Projects/B-U585I-IOT02A/Applications/FileX at main · STMicroelectronics/STM32CubeU5 (github.com).
Here the example is to create the STM.TXT in the run-time
/* Create a file called STM32.TXT in the root directory. */
nor_ospi_status = fx_file_create(&nor_ospi_flash_disk, "STM32.TXT");
But I have my pre-configured config.ini file and cacert.pem files for mbedlts communication.
How can inject them into the stm32 target? Could you please share an example of it?
How can I integrate the NetXDuo TCP/IP stack into my project after establishing a PPP communication link with the SIM7600 module?
2024-03-13 05:09 PM
Hello @srikanthpalvai ,
Can you please input your new queries in a new thread for better visibility and we can proceed by closing this one .
BR