Eror in esp-cryptoauthlib atecc608b

oedzee
Posts: 5
Joined: Mon Oct 30, 2023 10:19 am

Eror in esp-cryptoauthlib atecc608b

Postby oedzee » Thu Nov 09, 2023 2:56 pm

I am trying to use the ATECC608B with the ESP32S3 using ESP-IDF 5.1

I have found the Crytpoauth utility https://github.com/espressif/esp-crypto ... ity#readme

Which seams to flash a program on the ESP32S3 that can configure the ATECC608B.

When i run the program with the following command:

Code: Select all

python secure_cert_mfg.py --i2c-sda-pin 12 --i2c-scl-pin 11 --port COM33 --target_chip esp32s3
the output is as follows:

Code: Select all

Connecting...
Detecting chip type... ESP32-S3
Chip detected
RAM boot...
Downloading 69944 bytes at 3fcb1400... done!
Downloading 496 bytes at 3fcc3bb0... done!
Downloading 185124 bytes at 40374000... done!
Downloading 20 bytes at 403a1324... done!
All segments done, executing at 4037687c
Time required to load the app into the RAM = 3.5408384799957275s
Traceback (most recent call last):
  File "<firmware-folder-path>\components\esp-cryptoauthlib\esp_cryptoauth_utility\secure_cert_mfg.py", line 243, in <module>
    main()
  File "<firmware-folder-path>\components\esp-cryptoauthlib\esp_cryptoauth_utility\secure_cert_mfg.py", line 123, in main
    init_mfg = hs.serial.cmd_interpreter(port=args.port)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File <firmware-folder-path>\components\esp-cryptoauthlib\esp_cryptoauth_utility\helper_scripts\serial.py", line 43, in __init__
    self.port.open()
  File "<userpath>\.espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\serial\serialwin32.py", line 64, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'COM33': PermissionError(13, 'Toegang geweigerd.', None, 5)
The error on the last is a PermissionError with the title "Toegang geweigerd", which is dutch for "Access Denied"

So, For some reason it can download a few parts of the ram. But fails after the line: `Time required to load the app into the ram....`

I have check that no other program is using port COM33.

I have cleaned the old firmware on the ESP32S3 with the `idf.py erase-flash --port COM33`

When i run the `idf.py monitor --port COM33` i get the following result.

Code: Select all

--- WARNING: GDB cannot open serial ports accessed as COMx
--- Using \\.\COM33 instead...
--- esp-idf-monitor 1.3.3 on \\.\COM33 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
invalid header: 0xffffffff
invalid header: 0xESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x29 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048836
0x40048836: uart_tx_one_char_uart in ROM

invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
What could cause this behaviour?

ESP_flying_raijin
Posts: 25
Joined: Tue Aug 13, 2019 2:03 pm

Re: Eror in esp-cryptoauthlib atecc608b

Postby ESP_flying_raijin » Mon Nov 20, 2023 7:44 am

Hi oedzee,

It looks like this issue is related to the Serial Port.
The script esp_cryptoauth_utility internally uses esptool.
Below are some requirements for serial connection with esptool related to Serial Port.
https://docs.espressif.com/projects/esp ... erial-port

Please make sure you have satisfied that.
I think if the script esp_cryptoauth_utility is executed in the esp-idf environment and Serial Port is provided in appropriate format.
Then the issue should get resolved.

Thanks,
Aditya

oedzee
Posts: 5
Joined: Mon Oct 30, 2023 10:19 am

Re: Eror in esp-cryptoauthlib atecc608b

Postby oedzee » Fri Jan 12, 2024 1:26 pm

Thanks for your answer,

It's been a while for me, but i got time to work on it again.

I did use the ESP-IDF command line. So that's not the issue. I can't see anything wrong with the serial connections as well, because the steps before the crash, like checking the chip, work.

I also had te chance to test it on a ESP32 now. I got the same error using that.
I tested this with a ESP 5.1 CMD with admin privilges, i still get the same error.
I also tested this on ESP 4.4 CMD and i still got the same error.

Are there any other thing that i can try?

oedzee
Posts: 5
Joined: Mon Oct 30, 2023 10:19 am

Re: Eror in esp-cryptoauthlib atecc608b

Postby oedzee » Thu Feb 08, 2024 12:13 pm

As a follow up:

I have got it working now, i switched to a Raspberry Pi to flash the program and setup the certificates.

This however is a workarround. My problem persists on a Windows pc.

Who is online

Users browsing this forum: Google [Bot] and 383 guests