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

Fix python3 and arduino2x and esp32sdk2x #92

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mhier
Copy link

@mhier mhier commented Mar 11, 2024

No description provided.

@derrickoswald
Copy link

derrickoswald commented Sep 22, 2024

The define constant CONFIG_ULP_COPROC_RESERVE_MEM probably needs to be changed to CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM and also also in src/include/ulptool/ulptool.h lines 29-35:


  if (load_addr_bytes > CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM) {
    return ESP_ERR_INVALID_ARG;
  }

  if (load_addr_bytes + program_size_bytes > CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM) {
    return ESP_ERR_INVALID_SIZE;
  }

@mhier
Copy link
Author

mhier commented Sep 23, 2024

A constant with "ESP32S3" in its name seems to be device specific. What points you in the direction that this needs to be changed? Do you face an error message?

@derrickoswald
Copy link

@mhier
In my (linux) Arduino IDE installation, with the Arduino Nano ESP32 board,
I see only these constants (except for the ulptool directory):

~/.arduino15 $ grep --recursive _COPROC_RESERVE_MEM *
packages/arduino/hardware/esp32/2.0.17/tools/sdk/esp32s3/sdkconfig:CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=1024
packages/arduino/hardware/esp32/2.0.17/tools/sdk/esp32s3/qio_opi/include/sdkconfig.h:#define CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM 0
packages/arduino/hardware/esp32/2.0.17/tools/sdk/esp32s3/qio_qspi/include/sdkconfig.h:#define CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM 0
packages/arduino/hardware/esp32/2.0.17/tools/sdk/esp32s3/dio_qspi/include/sdkconfig.h:#define CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM 0
packages/arduino/hardware/esp32/2.0.17/tools/sdk/esp32s3/opi_qspi/include/sdkconfig.h:#define CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM 0
packages/arduino/hardware/esp32/2.0.17/tools/sdk/esp32s3/dio_opi/include/sdkconfig.h:#define CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM 0
packages/arduino/hardware/esp32/2.0.17/tools/sdk/esp32s3/opi_opi/include/sdkconfig.h:#define CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM 0

So, it doesn't match what is encoded in the ulptool unless the constant is changed.

@mhier
Copy link
Author

mhier commented Sep 23, 2024

Ok, thanks. We need to find a way to use the right constant depending on the variant of the ESP32. I don't have an ESP32S3, hence changing the constant to CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM would make it fail for me...

@derrickoswald
Copy link

derrickoswald commented Sep 28, 2024

@mhier
When I manually install the Espressif Arduino ESP32 development environment for linux from docs.espressif.com, the esp32s3 configuration uses the expected constant, but the esp32s2 configuration has the extended name syntax:

~/Arduino$ grep --recursive ULP_COPROC_RESERVE_MEM
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s3/sdkconfig:CONFIG_ULP_COPROC_RESERVE_MEM=512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s3/qio_opi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s3/qio_qspi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s3/dio_qspi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s3/opi_qspi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s3/dio_opi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s3/opi_opi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s2/sdkconfig:CONFIG_ULP_COPROC_RESERVE_MEM=512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s2/sdkconfig:CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM=512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s2/qio_qspi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s2/qio_qspi/include/sdkconfig.h:#define CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM CONFIG_ULP_COPROC_RESERVE_MEM
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s2/dio_qspi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32s2/dio_qspi/include/sdkconfig.h:#define CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM CONFIG_ULP_COPROC_RESERVE_MEM
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32/sdkconfig:CONFIG_ULP_COPROC_RESERVE_MEM=512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32/sdkconfig:CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32/qio_qspi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32/qio_qspi/include/sdkconfig.h:#define CONFIG_ESP32_ULP_COPROC_RESERVE_MEM CONFIG_ULP_COPROC_RESERVE_MEM
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32/dio_qspi/include/sdkconfig.h:#define CONFIG_ULP_COPROC_RESERVE_MEM 512
hardware/espressif/esp32/tools/esp32-arduino-libs/esp32/dio_qspi/include/sdkconfig.h:#define CONFIG_ESP32_ULP_COPROC_RESERVE_MEM CONFIG_ULP_COPROC_RESERVE_MEM

So, I think the errant naming scheme is old (version 2.0.17) and Espressif have reconsidered how much that broke everybody's scripts. I assume the esp32s2 tree will revert (eventually) to the original constant names.

@mhier
Copy link
Author

mhier commented Sep 30, 2024

Sice we do merely pattern matching here, we could make our script more flexible. Can you try using this?

 mem = re.findall(r'#define CONFIG_.*ULP_COPROC_RESERVE_MEM (.*?)\n', text)[0]

It should match any of the names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants