-
Notifications
You must be signed in to change notification settings - Fork 48
Adds ATECC608 secure element support for Espressif esp32 #173
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
43a6073
Adds ATECC608 secure element support for esp32 - DPS registration wor…
sckulkarni246 31b21c4
Added a comment about the treatment of client cert when not using an …
sckulkarni246 c405422
Corrected the comments about the treatment of device certs when using…
sckulkarni246 1f32e26
Custom certs generated using esp_cryptoauth_utility don't use "sn" at…
sckulkarni246 1a5d701
This commit:
sckulkarni246 7d8738e
This commit:
sckulkarni246 ab2b01c
Merge branch 'main' into main
CIPop 0a0ccf4
Uncrustify code formatter changes.
1e75252
Running uncrustify-0.67
e959cec
Removing cached submodule
73e1865
Addressing PR comments.
7f09074
Apply suggestions from code review
CIPop 3d3e73f
Addressing PR comments.
01a1ec6
Enabling ATECC CI Build.
a9bef7e
CI script fix.
bdc8181
Adding GH Action
ff82cc2
Adding more logs to CI for ATECC.
7f87ce2
Adding git clean to the CI build.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[submodule "libs/azure-iot-middleware-freertos"] | ||
path = libs/azure-iot-middleware-freertos | ||
url = https://github.com/Azure/azure-iot-middleware-freertos.git | ||
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "ESP32-Debug", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "${command:espIdf.getXtensaGdb}", | ||
"program": "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf", | ||
"windows": { | ||
"program": "${workspaceFolder}\\build\\${command:espIdf.getProjectName}.elf" | ||
}, | ||
"cwd": "${workspaceFolder}", | ||
"environment": [{ "name": "PATH", "value": "${config:idf.customExtraPaths}" }], | ||
"setupCommands": [ | ||
{ "text": "target remote :3333" }, | ||
{ "text": "set remote hardware-watchpoint-limit 2"}, | ||
{ "text": "mon reset halt" }, | ||
{ "text": "thb app_main" }, | ||
{ "text": "flushregs" } | ||
], | ||
"externalConsole": false, | ||
"logging": { | ||
"engineLogging": false | ||
} | ||
}, | ||
{ | ||
"name": "ESP32-Attach", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "${command:espIdf.getXtensaGdb}", | ||
"program": "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf", | ||
"windows": { | ||
"program": "${workspaceFolder}\\build\\${command:espIdf.getProjectName}.elf" | ||
}, | ||
"cwd": "${workspaceFolder}", | ||
"environment": [{ "name": "PATH", "value": "${config:idf.customExtraPaths}" }], | ||
"setupCommands": [ | ||
{ "text": "target remote :3333" }, | ||
{ "text": "set remote hardware-watchpoint-limit 2"}, | ||
{ "text": "flushregs" } | ||
], | ||
"externalConsole": false, | ||
"logging": { | ||
"engineLogging": false | ||
} | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Support for Microchip ATECC608 Secure Element For ESP32 Plaforms | ||
CIPop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Pre-conditions | ||
|
||
- Ensure that the project is clean. Use `rm -rf build/` to ensure a clean slate. | ||
- Ensure that you are using the default sdkconfig. Use `rm sdkconfig` just to be sure. | ||
- Ensure internet connectivity to enable successful download of `esp-cryptoauthlib` component | ||
CIPop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Steps to add Microchip ATECC608 Secure Element support | ||
|
||
Perform the below steps **before doing any application level configuration like Wi-Fi settings, Azure Samples configuration, etc.** | ||
CIPop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Step 1 - Kconfig configuration | ||
|
||
- Open kconfig menu using `idf.py menuconfig` | ||
- Navigate: `Component Config` --> `ESP-TLS` | ||
- Enable: `Use Secure Element (ATECC608A) with ESP-TLS` | ||
 | ||
|
||
- Navigate: `Component Config` --> `mbedTLS` | ||
- Enable: `Enable hardware ECDSA Sign acceleration when using ATECC608A` | ||
- Enable: `Enable hardware ECDSA Verify acceleration when using ATECC608A` | ||
 | ||
|
||
- Save configuration and exit | ||
|
||
### Step 2 - Run menuconfig again | ||
|
||
- Open kconfig menu again using `idf.py menuconfig` - observe the output, esp-cryptoauthlib should be downloaded this time since secure element support is now enabled. | ||
 | ||
|
||
- Exit the kconfig menu - we are ready to try a build now | ||
- Observe that `esp-cryptoauthlib` is located inside `components/` folder and should be picked up by Ninja during the test build | ||
 | ||
|
||
### Step 3 - Try a build | ||
|
||
- Try a build using `idf.py build` - observe the output, esp-cryptoauthlib should be built along with relevant mbedTLS support | ||
|
||
**If build is successful**, you are now ready to make application level configurations like Wi-Fi settings, Azure Samples settings, ATECC608 pin settings, etc. | ||
CIPop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**If build fails**, ensure that above steps are followed correctly. Before re-attempting the process, | ||
- delete the build directory using `rm -rf build/` | ||
- delete the sdkconfig file by using `rm sdkconfig`. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: we need more information and steps how to provision the ATECC as well as how to configure the application. I think we can move forward with this PR and add more documentation later. |
||
## FAQ | ||
|
||
**Q:** Why do I need to open the menuconfig a second time after enabling secure element support? | ||
|
||
**A:** If this step is not done, although the esp-cryptoauthlib gets downloaded correctly during the build attempt, the build fails due to the way mbedTLS component is configured at build time. Running the menuconfig command immediately after enabling secure element support does the necessary linkages that can be picked up at the first build attempt. | ||
<br /> | ||
|
||
**Q:** What is the right way to remove ATECC608 support? | ||
|
||
**A:** To completely remove ATECC608 support, it is best to start with a clean slate to avoid any dependency issues. Ddelete the build folder (`rm -rf build/`), delete the sdkconfig (`rm sdkconfig`) and delete the esp-cryptoauthlib from components/ folder. | ||
CIPop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<br /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.