|
| 1 | +menu "Ultra Low Power (ULP) Co-processor" |
| 2 | + depends on (SOC_ULP_SUPPORTED || SOC_RISCV_COPROC_SUPPORTED || SOC_LP_CORE_SUPPORTED) |
| 3 | + |
| 4 | + config ULP_COPROC_ENABLED |
| 5 | + bool "Enable Ultra Low Power (ULP) Co-processor" |
| 6 | + default "n" |
| 7 | + help |
| 8 | + Enable this feature if you plan to use the ULP Co-processor. |
| 9 | + Once this option is enabled, further ULP co-processor configuration will appear in the menu. |
| 10 | + |
| 11 | + choice ULP_COPROC_TYPE |
| 12 | + prompt "ULP Co-processor type" |
| 13 | + depends on ULP_COPROC_ENABLED |
| 14 | + default ULP_COPROC_TYPE_RISCV if (IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3) |
| 15 | + help |
| 16 | + Choose the ULP Coprocessor type: ULP FSM (Finite State Machine) or ULP RISC-V. |
| 17 | + |
| 18 | + config ULP_COPROC_TYPE_FSM |
| 19 | + bool "ULP FSM (Finite State Machine)" |
| 20 | + depends on SOC_ULP_FSM_SUPPORTED |
| 21 | + config ULP_COPROC_TYPE_RISCV |
| 22 | + bool "ULP RISC-V" |
| 23 | + depends on SOC_RISCV_COPROC_SUPPORTED |
| 24 | + config ULP_COPROC_TYPE_LP_CORE |
| 25 | + bool "LP core RISC-V" |
| 26 | + depends on SOC_LP_CORE_SUPPORTED |
| 27 | + endchoice |
| 28 | + |
| 29 | + config ULP_COPROC_RESERVE_MEM |
| 30 | + int |
| 31 | + prompt "RTC slow memory reserved for coprocessor" |
| 32 | + depends on ULP_COPROC_ENABLED |
| 33 | + default 512 if IDF_TARGET_ESP32 |
| 34 | + default 4096 if !IDF_TARGET_ESP32 |
| 35 | + range 32 8176 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 |
| 36 | + range 32 16352 if IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C6 |
| 37 | + range 32 31088 if IDF_TARGET_ESP32P4 # Some memory are reserved for ROM/RTC reserved |
| 38 | + help |
| 39 | + Bytes of memory to reserve for ULP Co-processor firmware & data. |
| 40 | + Data is reserved at the beginning of RTC slow memory. |
| 41 | + |
| 42 | + |
| 43 | + menu "ULP RISC-V Settings" |
| 44 | + depends on ULP_COPROC_TYPE_RISCV |
| 45 | + |
| 46 | + config ULP_RISCV_INTERRUPT_ENABLE |
| 47 | + bool |
| 48 | + prompt "Enable ULP RISC-V interrupts" |
| 49 | + default "n" |
| 50 | + help |
| 51 | + Turn on this setting to enabled interrupts on the ULP RISC-V core. |
| 52 | + |
| 53 | + config ULP_RISCV_UART_BAUDRATE |
| 54 | + int |
| 55 | + prompt "Baudrate used by the bitbanged ULP RISC-V UART driver" |
| 56 | + default 9600 |
| 57 | + help |
| 58 | + The accuracy of the bitbanged UART driver is limited, it is not |
| 59 | + recommend to increase the value above 19200. |
| 60 | + |
| 61 | + config ULP_RISCV_I2C_RW_TIMEOUT |
| 62 | + int |
| 63 | + prompt "Set timeout for ULP RISC-V I2C transaction timeout in ticks." |
| 64 | + default 500 |
| 65 | + range -1 4294967295 |
| 66 | + help |
| 67 | + Set the ULP RISC-V I2C read/write timeout. Set this value to -1 |
| 68 | + if the ULP RISC-V I2C read and write APIs should wait forever. |
| 69 | + Please note that the tick rate of the ULP co-processor would be |
| 70 | + different than the OS tick rate of the main core and therefore |
| 71 | + can have different timeout value depending on which core the API |
| 72 | + is invoked on. |
| 73 | + endmenu |
| 74 | + |
| 75 | + config ULP_SHARED_MEM |
| 76 | + depends on ULP_COPROC_TYPE_LP_CORE |
| 77 | + hex |
| 78 | + default 0x10 |
| 79 | + help |
| 80 | + Size of the shared memory defined in ulp_lp_core_memory_shared.c. |
| 81 | + Size should be kept in-sync with the size of the struct defined there. |
| 82 | + |
| 83 | + config ULP_ROM_PRINT_ENABLE |
| 84 | + depends on ULP_COPROC_TYPE_LP_CORE && ESP_ROM_HAS_LP_ROM |
| 85 | + bool |
| 86 | + prompt "Enable print utilities from LP ROM" |
| 87 | + default "y" |
| 88 | + help |
| 89 | + Set this option to enable printf functionality from LP ROM. This option |
| 90 | + can help reduce the LP core binary size by not linking printf functionality |
| 91 | + from RAM code. |
| 92 | + Note: For LP ROM prints to work properly, make sure that the LP core boots |
| 93 | + from the LP ROM. |
| 94 | + |
| 95 | + menu "ULP Debugging Options" |
| 96 | + config ULP_PANIC_OUTPUT_ENABLE |
| 97 | + depends on ULP_COPROC_TYPE_LP_CORE && SOC_ULP_LP_UART_SUPPORTED |
| 98 | + bool |
| 99 | + prompt "Enable panic handler which outputs over LP UART" |
| 100 | + default "y" if IDF_TARGET_ESP32P4 |
| 101 | + help |
| 102 | + Set this option to enable panic handler functionality. If this option is |
| 103 | + enabled then the LP Core will output a panic dump over LP UART, |
| 104 | + similar to what the main core does. Output depends on LP UART already being |
| 105 | + initialized and configured. |
| 106 | + Disabling this option will reduce the LP core binary size by not |
| 107 | + linking in panic handler functionality. |
| 108 | + |
| 109 | + config ULP_HP_UART_CONSOLE_PRINT |
| 110 | + depends on ULP_COPROC_TYPE_LP_CORE |
| 111 | + bool |
| 112 | + prompt "Route lp_core_printf to the console HP-UART" |
| 113 | + help |
| 114 | + Set this option to route lp_core_printf to the console HP-UART. |
| 115 | + This allows you to easily view print outputs from the LP core, without |
| 116 | + having to connect to the LP-UART. This option comes with the following |
| 117 | + limitations: |
| 118 | + |
| 119 | + 1. There is no mutual exclusion between the HP-Core and the LP-Core accessing |
| 120 | + the HP-UART, which means that if both cores are logging heavily the output |
| 121 | + strings might get mangled together. |
| 122 | + 2. The HP-UART can only work while the HP-Core is running, which means that |
| 123 | + if the HP-Core is in deep sleep, the LP-Core will not be able to print to the |
| 124 | + console HP-UART. |
| 125 | + |
| 126 | + Due to these limitations it is only recommended to use this option for easy debugging. |
| 127 | + For more serious use-cases you should use the LP-UART. |
| 128 | + |
| 129 | + config ULP_NORESET_UNDER_DEBUG |
| 130 | + bool "Avoid resetting LP core when debugger is attached" |
| 131 | + depends on ULP_COPROC_TYPE_LP_CORE |
| 132 | + default "y" |
| 133 | + help |
| 134 | + Enable this feature to avoid resetting LP core in sleep mode when debugger is attached, |
| 135 | + otherwise configured HW breakpoints and dcsr.ebreak* bits will be missed. |
| 136 | + This is a workaround until it will be fixed in HW. |
| 137 | + |
| 138 | + endmenu |
| 139 | + |
| 140 | +endmenu # Ultra Low Power (ULP) Co-processor |
0 commit comments