← index #14491Issue #14217
Off-topic · high · value 0.161
QUERY · ISSUE

changes from menuconfig are only applied after cleaning

openby wohltatopened 2024-05-15updated 2026-03-24
bugport-esp32

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

esp32

MicroPython version

MicroPython v1.23.0-preview.375.ga0d4fdcce.dirty on 2024-05-15; Generic ESP32 module with ESP32

Reproduction

want to test some settings of the ESP32 IDF. For this i use the idf.py menuconfig but the changes have no effect when i recompile with make BOARD=ESP32_MYBOARD. Only after a make BOARD=ESP32_MYBOARD clean and a recompile the changes are applied.

Before i created folder for my custom board in micropython/ports/esp32/boards/ESP32_MYBOARD according to the documentation (micropython/ports/esp32/README.md: Defining a custom ESP32 board), i.e. i made i copy of ESP32_GENERIC.

I adapted the file mpconfigboard.cmake in that folder to:

set(SDKCONFIG_DEFAULTS
    boards/sdkconfig.base
    ${SDKCONFIG_IDF_VERSION_SPECIFIC}
    boards/sdkconfig.ble
)

set(SDKCONFIG_DEFAULTS
    ${SDKCONFIG_DEFAULTS}
    boards/ESP32_RFID/sdkconfig
)

then and after every idf.py menuconfig i do
make BOARD=ESP32_MYBOARD submodules
make BOARD=ESP32_MYBOARD
make BOARD=ESP32_MYBOARD deploy

Expected behaviour

  • make detects changes to the source (including configuration).
  • the whole project does not have to be recompiled for every little changy in configuration and to wait several minutes just try one setting.
  • sdkconfig file save location in menuconfig is the location from where the file is used. Not needing to manually copy config files.
  • It should be enough to just specify the board/folder once with make BOARD=... ...

Observed behaviour

  • Only after a make BOARD=ESP32_MYBOARD clean and a recompile the changes are applied.
  • approx 4min to get a change in the settings to the board
  • The menuconfig always tries to read and save the file 'micropython/ports/esp32/build/sdkconfig' and i cannot change the sdkconfig in my custom folder without changing the CMakeLists.txt. Seems strange that the default location is in a build folder and not a configuration folder. Ofcourse i can manually set the config file location for saving every time, but that is neither comfortable nor seems intended.
  • although the config is saved to 'micropython/ports/esp32/build/sdkconfig' by default, only the one from 'micropython/ports/esp32/boards/ESP32_RFID/sdkconfig' is used.
  • two different build directories automatically generated 'micropython/ports/esp32/build/' and 'micropython/ports/esp32/build-ESP32_MYBOARD'

Additional Information

No, I've provided everything above.

CANDIDATE · ISSUE

ESP32-S3 forcing use of USB OTG

closedby kdschlosseropened 2024-03-30updated 2025-05-22
bugport-esp32

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

ESP32-S3

MicroPython version

MicroPython: 1.22.2
board: ESP32_GENERIC_S3
board_variant: SPIRAM_OCT

Reproduction

compile for the ESP32-S3 and try and use the pins for I2C. Using them results in a timeout or if doing a scan it takes the scan more than a minute to complete and returns an empty list.

Expected behaviour

for I2C to work using pins 19 and 20

Observed behaviour

I2C attached to pins 19 and 20 does not work I believe this issue is caused by the forced use of USB OTG. I have tried to turn it off by setting CONFIG_USB_OTG_SUPPORTED=n in the ports/esp32/boards/ESP32_GENERIC_S3/sdkconfig.board file and also removing boards/sdkconfig.usb from the ports/esp32/boards/ESP32_GENERIC_S3/mpconfigboard.cmake file. For whatever reason CONFIG_USB_OTG_SUPPORTED still gets set to y when being compiled.

Normally this wouldn't be an issue but because of this code in MicroPython

void mp_task(void *pvParameter) {
    volatile uint32_t sp = (uint32_t)esp_cpu_get_sp();
    #if MICROPY_PY_THREAD
    mp_thread_init(pxTaskGetStackStart(NULL), MICROPY_TASK_STACK_SIZE / sizeof(uintptr_t));
    #endif
    #if CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
    usb_serial_jtag_init();
    #elif CONFIG_USB_OTG_SUPPORTED
    usb_init();
    #endif
    #if MICROPY_HW_ENABLE_UART_REPL
    uart_stdout_init();
    #endif
    machine_init();

Pin 19 and 20 get forced into use for OTG instead of being something that user is able to selectively turn on. I believe that the ESP-IDF is overriding the setting CONFIG_USB_OTG_SUPPORTED=n which is why I am not able to turn it off and because MicroPython is coded in a manner that forces those pins into being used for USB OTG at runtime results in my inability to use those pins for anything else.

I believe that this kind of a thing should be able to be turned on or off at the users discretion and it should be able to be done at runtime and not compile time. The CONFIG_USB_OTG_SUPPORTED is simply a setting that should be used to have code compiled and not be used to determine if it should run code. That macro as it implies if whether or not a board supports OTG not that it should be used.

Additional Information

I have not managed to grasp why the OTG is having repl data sent to it.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied