esp_crc16_be not available in 4.0, what can I use instead?

matthew798
Posts: 16
Joined: Mon Jun 01, 2020 2:31 am

esp_crc16_be not available in 4.0, what can I use instead?

Postby matthew798 » Sun Oct 25, 2020 3:48 am

I am using platformio with IDF v4.0, and the appropriate arduino libraries as a component.

I am hacking and slashing away at the Blufi demo, and have finally gotten my phone to communicate with the esp. I did, however have to do this:

Code: Select all

uint16_t blufi_crc_checksum(uint8_t iv8, uint8_t *data, int len)
{
    /* This iv8 ignore, not used */
    return 1; //esp_crc16_be(0, data, len);
}
Obviously this will prevent the blufi flow from working, I did it to get around this error temporarily:
esp_crc.h: No such file or directory
From what I gather, esp_crc16_be is not available in IDF v4.0. What can I use instead? I think that this function uses the internal crypto hardware (???) so rolling my own crc function is not a nice solution.

I did find one in rom/crc.h but this causes a whole bunch of weird problems when included. We can get into that if this is my only option.

ESP-Marius
Posts: 74
Joined: Wed Oct 23, 2019 1:49 am

Re: esp_crc16_be not available in 4.0, what can I use instead?

Postby ESP-Marius » Mon Oct 26, 2020 1:51 am

esp_crc16_be is simply a wrapper function around the rom function crc16_be, so you can safely use this rom function directly.

Which Blufi demo are you actually looking/hacking at? The blufi example in 4.0 has the correct crc function for that release:

Code: Select all

uint16_t blufi_crc_checksum(uint8_t iv8, uint8_t *data, int len)
{
    /* This iv8 ignore, not used */
    return crc16_be(0, data, len);
}
Note that there is no CRC hardware accelerators on the ESP32, so the rom function still calculates the crc sum in software.

Who is online

Users browsing this forum: No registered users and 130 guests