refactor(ulp): move ULP program Kconfig options to its components

The Kconfig options for the program running on the ULP coprocessor now live
with the components that build it, not with the ULP coprocessor driver on
the HP core. The driver sources them, so applications resolve them as
before.
This commit is contained in:
Sudeep Mohanty
2026-09-08 15:20:26 +02:00
parent 53ea9b200e
commit 8979950ebf
4 changed files with 88 additions and 68 deletions

View File

@@ -54,20 +54,8 @@ menu "Ultra Low Power (ULP) Co-processor"
menu "ULP RISC-V Settings"
depends on ULP_COPROC_TYPE_RISCV
config ULP_RISCV_INTERRUPT_ENABLE
bool
prompt "Enable ULP RISC-V interrupts"
default "n"
help
Turn on this setting to enabled interrupts on the ULP RISC-V core.
config ULP_RISCV_UART_BAUDRATE
int
prompt "Baudrate used by the bitbanged ULP RISC-V UART driver"
default 9600
help
The accuracy of the bitbanged UART driver is limited, it is not
recommend to increase the value above 19200.
# Declared by the component that builds the ULP RISC-V program.
rsource "subproject/components/ulp_riscv/Kconfig.ulp_riscv"
config ULP_RISCV_I2C_RW_TIMEOUT
int
@@ -117,28 +105,8 @@ menu "Ultra Low Power (ULP) Co-processor"
HP application.
endmenu
config ULP_ROM_PRINT_ENABLE
depends on ULP_COPROC_TYPE_LP_CORE && ESP_ROM_HAS_LP_ROM
bool
prompt "Enable print utilities from LP ROM"
default "y"
help
Set this option to enable printf functionality from LP ROM. This option
can help reduce the LP core binary size by not linking printf functionality
from RAM code.
Note: For LP ROM prints to work properly, make sure that the LP core boots
from the LP ROM.
config ULP_LP_CORE_MEMPROT
bool "Enable LP Core memory protection (PMP)"
depends on ULP_COPROC_TYPE_LP_CORE && SOC_LP_CORE_HAS_PMP && !ULP_COPROC_RUN_FROM_HP_MEM
default n
help
Configures the LP CPU's PMP entries to enforce memory protection.
LP RAM is split into executable (.text) and data (.data/.bss/stack)
regions. Regions not explicitly permitted are inaccessible.
Not available when "Run LP Core from HP memory" is enabled.
Disable this if you need full control over PMP configuration.
# Declared by the component that builds the LP core program.
rsource "subproject/components/lp_core/Kconfig.lp_core"
config ULP_TRAP_WAKEUP
depends on ULP_COPROC_TYPE_LP_CORE
@@ -150,38 +118,8 @@ menu "Ultra Low Power (ULP) Co-processor"
the LP-core encounters an exception.
menu "ULP Debugging Options"
config ULP_PANIC_OUTPUT_ENABLE
depends on ULP_COPROC_TYPE_LP_CORE && SOC_ULP_LP_UART_SUPPORTED
bool
prompt "Enable panic handler which outputs over LP UART"
default "n"
help
Set this option to enable panic handler functionality. If this option is
enabled then the LP Core will output a panic dump over LP UART,
similar to what the main core does. Output depends on LP UART already being
initialized and configured.
Disabling this option will reduce the LP core binary size by not
linking in panic handler functionality.
config ULP_HP_UART_CONSOLE_PRINT
depends on ULP_COPROC_TYPE_LP_CORE
bool
prompt "Route lp_core_printf to the console HP-UART"
help
Set this option to route lp_core_printf to the console HP-UART.
This allows you to easily view print outputs from the LP core, without
having to connect to the LP-UART. This option comes with the following
limitations:
1. There is no mutual exclusion between the HP-Core and the LP-Core accessing
the HP-UART, which means that if both cores are logging heavily the output
strings might get mangled together.
2. The HP-UART can only work while the HP-Core is running, which means that
if the HP-Core is in deep sleep, the LP-Core will not be able to print to the
console HP-UART.
Due to these limitations it is only recommended to use this option for easy debugging.
For more serious use-cases you should use the LP-UART.
# Declared by the component that builds the LP core program.
rsource "subproject/components/lp_core/Kconfig.lp_core_debug"
config ULP_NORESET_UNDER_DEBUG
bool "Avoid resetting LP core when debugger is attached"

View File

@@ -0,0 +1,26 @@
# Sourced by the ULP coprocessor driver on the HP core, in
# components/ulp/Kconfig. Not named Kconfig, which would also attach it to
# this component and define every option twice.
config ULP_ROM_PRINT_ENABLE
depends on ULP_COPROC_TYPE_LP_CORE && ESP_ROM_HAS_LP_ROM
bool
prompt "Enable print utilities from LP ROM"
default "y"
help
Set this option to enable printf functionality from LP ROM. This option
can help reduce the LP core binary size by not linking printf functionality
from RAM code.
Note: For LP ROM prints to work properly, make sure that the LP core boots
from the LP ROM.
config ULP_LP_CORE_MEMPROT
bool "Enable LP Core memory protection (PMP)"
depends on ULP_COPROC_TYPE_LP_CORE && SOC_LP_CORE_HAS_PMP && !ULP_COPROC_RUN_FROM_HP_MEM
default n
help
Configures the LP CPU's PMP entries to enforce memory protection.
LP RAM is split into executable (.text) and data (.data/.bss/stack)
regions. Regions not explicitly permitted are inaccessible.
Not available when "Run LP Core from HP memory" is enabled.
Disable this if you need full control over PMP configuration.

View File

@@ -0,0 +1,36 @@
# Sourced by the ULP coprocessor driver on the HP core, in
# components/ulp/Kconfig. Not named Kconfig, which would also attach it to
# this component and define every option twice.
config ULP_PANIC_OUTPUT_ENABLE
depends on ULP_COPROC_TYPE_LP_CORE && SOC_ULP_LP_UART_SUPPORTED
bool
prompt "Enable panic handler which outputs over LP UART"
default "n"
help
Set this option to enable panic handler functionality. If this option is
enabled then the LP Core will output a panic dump over LP UART,
similar to what the main core does. Output depends on LP UART already being
initialized and configured.
Disabling this option will reduce the LP core binary size by not
linking in panic handler functionality.
config ULP_HP_UART_CONSOLE_PRINT
depends on ULP_COPROC_TYPE_LP_CORE
bool
prompt "Route lp_core_printf to the console HP-UART"
help
Set this option to route lp_core_printf to the console HP-UART.
This allows you to easily view print outputs from the LP core, without
having to connect to the LP-UART. This option comes with the following
limitations:
1. There is no mutual exclusion between the HP-Core and the LP-Core accessing
the HP-UART, which means that if both cores are logging heavily the output
strings might get mangled together.
2. The HP-UART can only work while the HP-Core is running, which means that
if the HP-Core is in deep sleep, the LP-Core will not be able to print to the
console HP-UART.
Due to these limitations it is only recommended to use this option for easy debugging.
For more serious use-cases you should use the LP-UART.

View File

@@ -0,0 +1,20 @@
# Sourced by the ULP coprocessor driver on the HP core, in
# components/ulp/Kconfig. Not named Kconfig, which would also attach it to
# this component and define every option twice.
config ULP_RISCV_INTERRUPT_ENABLE
depends on ULP_COPROC_TYPE_RISCV
bool
prompt "Enable ULP RISC-V interrupts"
default "n"
help
Turn on this setting to enable interrupts on the ULP RISC-V core.
config ULP_RISCV_UART_BAUDRATE
depends on ULP_COPROC_TYPE_RISCV
int
prompt "Baudrate used by the bitbanged ULP RISC-V UART driver"
default 9600
help
The accuracy of the bitbanged UART driver is limited, it is not
recommended to increase the value above 19200.