Topic: WolfSSL with ATECC508A on STM32F0

I'm trying to use WolfSSL on the STM32F0 using the acceleration from ATECC508A. The stm32f0discovery  dev board I am using is very memory limited, (64kb flash, 8kb RAM) and it seems it' not even within the default WolfSSL STM32 possible configurations (the lowest is STM32F1).

Anyways, I added some headers for it, I build it and wrote a HAL for the cryptauthlib on STM32.

My questions now are:

1) Would WolfSSL be able to fit in such a small footprint device? I intend to use it for DTLS.

2) I'm having some issues with the initialization for the ATECC508A, I have communication with the chip for sure, I see message-response flying through the bus lines that make sense, but in the call to atmel_init_enc_key(), the write request happens (I get ack on the bus) but the response is negative, with WC_HW_E (getting translated from atcab layer error ATCA_EXECUTION_ERROR)  - it seems that the chip us unable to write the key that comes from WolfSSL. Anybody have any experience with this?

Share

Re: WolfSSL with ATECC508A on STM32F0

After grabbing a SAMD21  I wanted to build your ATECC508A using atmel studio, but the build fails, using the latest AtmelStudio. I just opened the project and tried building. Is there any catch to this?

Share

Re: WolfSSL with ATECC508A on STM32F0

Hi vladr,

Thank you for reaching out to wolfSSL. Just to confirm, you are working with the Microchip_ATECC_Demos.zip from our more downloads page at the following link correct? https://www.wolfssl.com/download/downloadMoreForm.php

As noted in the README for the tls_demo the following Atmel Studio versions are supported:

## Prerequisites for this demo

Software:

  - Atmel Studio 6.2 or
  - Atmel Studio 7
  
Hardware:

  - Atmel SAMD21 Xplained Pro(2 pcs)
  - Atmel CryptoAuth Xplained Pro extension board(2 pcs)
  - Atmel WINC1500 extension board(2 pcs)

Does your setup match the pre-reqs for the demo? Also if you can share exactly what it is you are seeing that would be helpful for us to assist in diagnosing the issue, thanks!

- K

Re: WolfSSL with ATECC508A on STM32F0

Hello Kaleb,

In my attempts to build the ATECC508 demo I had used Atmel Studio v7.0.1931. The project zip I had was called Atmel_ATECC508_Demos so I guess there was a rename at some point in time. Regardless, I downloaded the zip you pointed me to and it was bit for bit identical with what I had, only the name was different.

Just opening the project with Atmel Studio and running a project build, I got a unch of errors. The first one I got was here:

C:\ToolsLibsKits\Microchip_ATECC_Demos\Microchip_ATECC_Demos\ASF\sam0\drivers\rtc\rtc_count_interrupt.h(80,8): warning: 'enum rtc_count_callback' declared inside parameter list will not be visible outside of this definition or declaration
           enum rtc_count_callback callback_type);
                ^~~~~~~~~~~~~~~~~~
C:\ToolsLibsKits\Microchip_ATECC_Demos\Microchip_ATECC_Demos\ASF\sam0\drivers\rtc\rtc_sam_d_r_h\rtc_count_interrupt.c(69,3): error: unknown type name 'rtc_count_callback_t'
           rtc_count_callback_t callback,

It seems these errors come from the ASF, NOT from WolfSSL, I think some configuration options don't get propagated properly, since the types it's complaining about are found in the project headers, only just don't get included somehow. I don't think this is on WolfSSL itself but on the demo project configuration.

Share

Re: WolfSSL with ATECC508A on STM32F0

So I managed to build the demo project, I had to add the following define in the compile options:

RTC_COUNT_ASYNC=true

I don't know where it's supposed to come from normally, but with it compilation worked.

After that, I got errors on build because the binary didn't fit on target, so I disabled a couple of options, and _then_ I was able to debug.

Share