Skip to content
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

mz_crc32 becomes undefined in esp32c2 (IDFGH-8737) #10177

Closed
3 tasks done
nopnop2002 opened this issue Nov 14, 2022 · 1 comment
Closed
3 tasks done

mz_crc32 becomes undefined in esp32c2 (IDFGH-8737) #10177

nopnop2002 opened this issue Nov 14, 2022 · 1 comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@nopnop2002
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

The following code builds correctly on any of esp32/esp32s2/esp32s3/esp32c3.
But esp32c2 gives an error.

#include <stdio.h>
#include <string.h>
#include "esp32/rom/miniz.h"

void app_main()
{
    uint8_t buf[64];
    memset(buf, 0, sizeof(buf));
    mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)(buf), 4);
}
$ idf.py --version
ESP-IDF v5.0-beta1-824-ga8ef7570ca

$ idf.py set-target esp32c2

$ idf.py build


/home/nop/rtos/miniz/build/../main/main.c:14: undefined reference to `mz_crc32'
$ grep -rn mz_crc32 esp-idf/components/esp_rom/*
esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld:185:PROVIDE ( mz_crc32 = 0x4005ee88 );
esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.ld:69:mz_crc32 = 0x400000c4;
esp-idf/components/esp_rom/esp32h2/ld/rev1/esp32h2.rom.ld:74:mz_crc32 = 0x400000c0;
esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.ld:428:PROVIDE ( mz_crc32 = 0x40002f58 );
esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.ld:71:mz_crc32 = 0x40000798;
esp-idf/components/esp_rom/include/esp32s3/rom/miniz.h:88:// mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL.
esp-idf/components/esp_rom/include/esp32s3/rom/miniz.h:89:mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
esp-idf/components/esp_rom/include/esp32s3/rom/miniz.h:298:#define crc32                 mz_crc32
esp-idf/components/esp_rom/include/esp32h2/rom/miniz.h:89:// mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL.
esp-idf/components/esp_rom/include/esp32h2/rom/miniz.h:90:mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
esp-idf/components/esp_rom/include/esp32h2/rom/miniz.h:299:#define crc32                 mz_crc32
esp-idf/components/esp_rom/include/esp32/rom/miniz.h:89:// mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL.
esp-idf/components/esp_rom/include/esp32/rom/miniz.h:90:mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
esp-idf/components/esp_rom/include/esp32/rom/miniz.h:300:  #define crc32                 mz_crc32
esp-idf/components/esp_rom/include/esp32s2/rom/miniz.h:89:// mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL.
esp-idf/components/esp_rom/include/esp32s2/rom/miniz.h:90:mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
esp-idf/components/esp_rom/include/esp32s2/rom/miniz.h:300:  #define crc32                 mz_crc32
esp-idf/components/esp_rom/include/esp32c3/rom/miniz.h:89:// mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL.
esp-idf/components/esp_rom/include/esp32c3/rom/miniz.h:90:mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
esp-idf/components/esp_rom/include/esp32c3/rom/miniz.h:299:#define crc32                 mz_crc32
esp-idf/components/esp_rom/include/esp32c2/rom/miniz.h:94:// mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL.
esp-idf/components/esp_rom/include/esp32c2/rom/miniz.h:95:mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
esp-idf/components/esp_rom/include/esp32c2/rom/miniz.h:304:#define crc32                 mz_crc32
@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 14, 2022
@github-actions github-actions bot changed the title mz_crc32 becomes undefined in esp32c2 mz_crc32 becomes undefined in esp32c2 (IDFGH-8737) Nov 14, 2022
@suda-morris
Copy link
Collaborator

Good catch, I checked the ROM code and found that the mz_crc32 now equals to crc32_le. We will update the rom/include/esp32c2/rom/miniz.h to reflect that change.

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Resolution: NA Issue resolution is unavailable labels Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants