Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add correctly the mbedtls project as submodule #8

Open
mhanuel26 opened this issue Jan 17, 2025 · 1 comment
Open

How to add correctly the mbedtls project as submodule #8

mhanuel26 opened this issue Jan 17, 2025 · 1 comment

Comments

@mhanuel26
Copy link

Hi @wiznet-grace ,

I am looking for guidance to understand how to properly add the mbedtls as submodule,

I am basically doing the following (without the mbedtls folder inside libraries)

git submodule add https://github.com/ARMmbed/mbedtls.git libraries/mbedtls

but when CMake tries to configure it has some missing files. After trying to do update a few times inside the mbedtls folders I cannot fixed.

Do you know how to add it correctly ?

Thank you,
Manuel

@wiznet-grace
Copy link
Contributor

wiznet-grace commented Jan 20, 2025

Hi @mhanuel26

  • If you want to change the path of the mbedtls library,
    you need to update the following line in the WIZnet-PICO-C/CMakeLists.txt file (line 80):
    set(MBEDTLS_DIR ${CMAKE_SOURCE_DIR}/libraries/mbedtls)
    Replace it with your desired path.

  • Additionally, if you wish to download a new version of mbedtls from https://github.com/Mbed-TLS/mbedtls and use it as a submodule,
    instead of using the command (git submodule add https://github.com/ARMmbed/mbedtls.git libraries/mbedtls)
    Follow these steps instead:

  1. Clone the specific version you need (replace 3.6.2 with your desired version):
    git clone --branch mbedtls-3.6.2 --depth 1 https://github.com/Mbed-TLS/mbedtls.git libraries/mbedtls
  2. Navigate to the directory:
    cd libraries/mbedtls
  3. Initialize and update the submodules: (all submodules referenced within the mbedtls repository are also downloaded.)
    git submodule update --init --recursive

If you encounter the following warning:
#warning "Do not include mbedtls/check_config.h manually!"
please comment out the following line in the WIZnet-PICO-C/port/mbedtls/inc/ssl_config.h file at line 32:
#include "mbedtls/check_config.h"
In the 3.6.2 version that I tested, the check_config.h file is automatically referenced. Therefore, I commented out the manual inclusion.

Please try running it, and if you have further questions, kindly let me know along with the complete execution log.

Thank you,
Grace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants