---
title: "[WIZnet-PICO-C example] How to add correctly the mbedtls project as submodule"
url: "https://maker.wiznet.io/forum/15748"
markdown_url: "https://maker.wiznet.io/forum/15748/md"
type: "Forum topic"
category: "General"
author: "Aimee0"
created: "2025-06-05T13:20:06+09:00"
last_activity: "2025-06-05T13:22:48+09:00"
language: "en"
views: 2
replies: 0
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# [WIZnet-PICO-C example] How to add correctly the mbedtls project as submodule

## Question

Asked by Aimee0 on 2025-06-05 in General.

### **🔧 How to add correctly the mbedtls project as submodule**

<https://github.com/aimee0000/TSG_maker/blob/main/WIZnet_PICO_C_Troubleshooting.md#-how-to-add-correctly-the-mbedtls-project-as-submodule>

Problem Phenomenon (The issue):

- The user is trying to add the mbedtls library as a submodule using a Git command. However, when configuring with CMake, some files are missing, and the user is unable to resolve the issue by updating within the mbedtls folder.

Cause (The cause of the issue):

- The issue arises because the user is not correctly adding the mbedtls library as a submodule and is possibly not configuring the path correctly in the CMakeLists.txt file. Additionally, there might be a manual inclusion of a configuration file that is not needed in the specific version being used.

Solution (Concrete code changes, configuration changes, step-by-step actions, etc., that actually solved the problem):

- Update the path of the mbedtls library in the **WIZnet-PICO-C/CMakeLists.txt** file (line 80) by setting the correct directory:

```plaintext
set(MBEDTLS_DIR ${CMAKE_SOURCE_DIR}/libraries/mbedtls)
```

- To add a new version of mbedtls as a submodule, follow these steps:
  1. Clone the specific version needed (replace 3.6.2 with the desired version):

```plaintext
git clone --branch mbedtls-3.6.2 --depth 1 https://github.com/Mbed-TLS/mbedtls.git libraries/mbedtls
```

1. Navigate to the mbedtls directory:

```plaintext
cd libraries/mbedtls
```

1. Initialize and update the submodules:

```plaintext
git submodule update --init --recursive
```

- If the warning `#warning "Do not include mbedtls/check_config.h manually!"` is encountered, comment out the following line in the **WIZnet-PICO-C/port/mbedtls/inc/ssl_config.h** file at line 32:

```plaintext
// #include "mbedtls/check_config.h"
```

- These steps ensure that the correct version of mbedtls is used and configured properly, and unnecessary warnings are avoided. If further issues arise, provide the complete execution log for additional assistance.

[View GitHub Issue](https://github.com/WIZnet-ioNIC/WIZnet-PICO-C/issues/8)

---

Source: https://maker.wiznet.io/forum/15748
