<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to Actually Use the Core2 AWS ATECC608 with AWS IoT]]></title><description><![CDATA[<p dir="auto"><strong>TL;DR:</strong> The factory certificate in slot 10 is in a compressed format that AWS IoT rejects. You need to generate a new properly-formatted certificate. Full working example here: <a href="https://github.com/scarolan/grafana-core2aws-iot" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/scarolan/grafana-core2aws-iot</a></p>
<hr />
<h2>The Problem Everyone Hits</h2>
<p dir="auto">If you've tried to use the Core2 for AWS with its built-in ATECC608 secure element, you've probably hit this error when registering the certificate:</p>
<pre><code>CertificateValidationException: The certificate could not be parsed
</code></pre>
<p dir="auto"><strong>You're not crazy.</strong> The factory certificate in slot 10 is stored in Microchip's compressed format with:</p>
<ul>
<li>Empty issuer/subject fields</li>
<li>Invalid dates (Aug 28, 2005)</li>
<li>Missing X.509 structure</li>
</ul>
<p dir="auto">AWS IoT's <code>register-certificate-without-ca</code> API rejects it outright.</p>
<h2>The Solution</h2>
<p dir="auto">Generate a new properly-formatted certificate that <strong>still uses the locked private key in slot 0</strong> (so you maintain hardware security):</p>
<h3>1. Clone the Working Example</h3>
<pre><code class="language-bash">git clone https://github.com/scarolan/grafana-core2aws-iot
cd grafana-core2aws-iot/extras/generate_cert
</code></pre>
<h3>2. Flash the Certificate Generator</h3>
<pre><code class="language-bash">pio run -t upload --upload-port COM3
pio device monitor --port COM3 --baud 115200
</code></pre>
<h3>3. Save the Certificate</h3>
<p dir="auto">Copy the certificate output (including <code>-----BEGIN CERTIFICATE-----</code> lines) to a file.</p>
<h3>4. Register with AWS IoT</h3>
<pre><code class="language-bash">aws iot register-certificate-without-ca \
  --certificate-pem file://device_new.pem \
  --status ACTIVE \
  --region us-east-1
</code></pre>
<p dir="auto">Then attach your policy and thing as usual.</p>
<h3>5. Use in Your Firmware</h3>
<p dir="auto">Update <code>secrets.h</code> with the new certificate and you're done!</p>
<h2>Why This Works</h2>
<p dir="auto">The certificate generator:</p>
<ul>
<li>Reads the <strong>public key</strong> from slot 0 (the private key never leaves the chip)</li>
<li>Creates a proper X.509 certificate with valid dates and subject fields</li>
<li><strong>Signs it using the locked private key</strong> (signing happens inside the ATECC608)</li>
<li>Returns a properly-formatted certificate AWS IoT accepts</li>
</ul>
<p dir="auto"><strong>Hardware security is maintained</strong> - the private key in slot 0 is never exposed, it's just used differently.</p>
<h2>Complete Documentation</h2>
<p dir="auto">I've documented the full solution with explanations of what's happening:</p>
<ul>
<li><strong><a href="https://github.com/scarolan/grafana-core2aws-iot/blob/master/docs/ATECC608_ARCHITECTURE.md" target="_blank" rel="noopener noreferrer nofollow ugc">ATECC608 Architecture</a></strong> - How the secure element works, slot configuration, lock mechanism</li>
<li><strong><a href="https://github.com/scarolan/grafana-core2aws-iot/blob/master/docs/ATECC608_CERTIFICATE_SOLUTION.md" target="_blank" rel="noopener noreferrer nofollow ugc">Certificate Solution</a></strong> - Why the factory cert fails and how to fix it</li>
<li><strong><a href="https://github.com/scarolan/grafana-core2aws-iot" target="_blank" rel="noopener noreferrer nofollow ugc">Full Working Example</a></strong> - Complete vibration monitoring IoT demo with AWS IoT Core + Timestream</li>
</ul>
<h2>Why M5Stack Doesn't Document This</h2>
<p dir="auto">The compressed certificate format is a Microchip design decision (saves space on the chip). It's meant to work with:</p>
<ul>
<li>Microchip's Trust Platform provisioning tools</li>
<li>Their specific certificate reconstruction libraries</li>
<li>Microchip-managed certificate authorities</li>
</ul>
<p dir="auto">It was never designed to work directly with third-party services like AWS IoT without special handling.</p>
<p dir="auto">M5Stack provides a complex registration helper (<code>registration_helper.py</code>) that reconstructs the certificate with special manifest-based APIs, but it's <strong>800+ lines of Python with tons of dependencies</strong>.</p>
<p dir="auto">The approach above is <strong>much simpler</strong> - just generate a new cert and register it normally.</p>
<h2>Tested and Working</h2>
<p dir="auto">This solution is running in production on my demo device:</p>
<ul>
<li>MQTTS publishing to AWS IoT Core every 5 seconds</li>
<li>Data flowing to Amazon Timestream</li>
<li>Hardware-backed authentication with ATECC608</li>
<li>Zero issues with certificate validation</li>
</ul>
<h2>Hope This Saves Someone's Week</h2>
<p dir="auto">I fought with this for a week a couple years ago and gave up in frustration. Revisited it recently and finally cracked it. Hopefully this saves others the same pain!</p>
<p dir="auto">Questions/issues? Comment here or open an issue on GitHub.</p>
<hr />
<p dir="auto"><strong>Repository:</strong> <a href="https://github.com/scarolan/grafana-core2aws-iot" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/scarolan/grafana-core2aws-iot</a><br />
<strong>Hardware:</strong> M5Stack Core2 for AWS<br />
<strong>Libraries:</strong> ArduinoECCX08, ArduinoBearSSL, M5Unified<br />
<strong>Tested:</strong> PlatformIO, Arduino framework on ESP32</p>
]]></description><link>https://community.m5stack.com/topic/8058/how-to-actually-use-the-core2-aws-atecc608-with-aws-iot</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 21:00:34 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/8058.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 Feb 2026 13:58:12 GMT</pubDate><ttl>60</ttl></channel></rss>