config: Simplify WiFi & Bluetooth config options

Removes redundant menu options, splits WiFi configuration out from
generic ESP32 configuration.
This commit is contained in:
Angus Gratton 2017-01-10 16:04:04 +11:00
parent a54791846b
commit 2e78b397bc
8 changed files with 150 additions and 216 deletions

View File

@ -1,41 +1,26 @@
menu "BT config" menu "Bluetooth"
visible if MEMMAP_BT
config BT_ENABLED config BT_ENABLED
bool bool "Enable Bluetooth stack"
depends on ESP32_ENABLE_STACK_BT
help
This compiles in the low-level BT stack.
config BTC_TASK_STACK_SIZE config BTC_TASK_STACK_SIZE
int "BT event (callback to application) task stack size" int "Bluetooth event (callback to application) task stack size"
depends on BT_ENABLED
default 3072 default 3072
help help
This select btc task stack size This select btc task stack size
config BLUEDROID_MEM_DEBUG config BLUEDROID_MEM_DEBUG
bool "Bluedroid memory debug" bool "Bluedroid memory debug"
default no depends on BT_ENABLED
default n
help help
Bluedroid memory debug Bluedroid memory debug
#config BT_BTLE
# bool "Enable BTLE"
# depends on BT_ENABLED
# help
# This compiles BTLE support
#
#config BT_BT
# bool "Enable classic BT"
# depends on BT_ENABLED
# help
# This enables classic BT support
endmenu endmenu
# Memory reserved at start of DRAM for Bluetooth stack # Memory reserved at start of DRAM for Bluetooth stack
config BT_RESERVE_DRAM config BT_RESERVE_DRAM
hex hex
default 0x10000 if MEMMAP_BT default 0x10000 if BT_ENABLED
default 0 default 0

View File

@ -1,6 +1,7 @@
# #
# Component Makefile # Component Makefile
# #
ifdef CONFIG_BT_ENABLED
COMPONENT_ADD_INCLUDEDIRS := bluedroid/bta/include \ COMPONENT_ADD_INCLUDEDIRS := bluedroid/bta/include \
bluedroid/bta/sys/include \ bluedroid/bta/sys/include \
@ -71,3 +72,5 @@ COMPONENT_SRCDIRS := bluedroid/bta/dm \
. .
COMPONENT_SUBMODULES += lib COMPONENT_SUBMODULES += lib
endif

View File

@ -20,42 +20,6 @@ config ESP32_DEFAULT_CPU_FREQ_MHZ
default 160 if ESP32_DEFAULT_CPU_FREQ_160 default 160 if ESP32_DEFAULT_CPU_FREQ_160
default 240 if ESP32_DEFAULT_CPU_FREQ_240 default 240 if ESP32_DEFAULT_CPU_FREQ_240
#choice ESP32_WIFI_OR_BT
# prompt "Select stack to enable (WiFi or BT)"
# default ESP32_ENABLE_WIFI
# help
# Temporarily, WiFi and BT stacks can not be used at the same time.
# Select which stack to enable.
config ESP32_ENABLE_STACK_WIFI
bool "WiFi"
select WIFI_ENABLED if ESP32_ENABLE_STACK_WIFI
config ESP32_ENABLE_STACK_BT
bool "BT"
select MEMMAP_BT if ESP32_ENABLE_STACK_BT
select BT_ENABLED if ESP32_ENABLE_STACK_BT
#config ESP32_ENABLE_STACK_NONE
# bool "None"
#endchoice
config SW_COEXIST_ENABLE
bool "Software controls WiFi/BT coexistence"
depends on ESP32_ENABLE_STACK_BT && ESP32_ENABLE_STACK_WIFI
default "n"
help
If enabled, WiFi & BT coexistence is controlled by software rather than hardware.
Recommended for heavy traffic scenarios. Both coexistence configuration options are
automatically managed, no user intervention is required.
config MEMMAP_BT
bool
depends on ESP32_ENABLE_STACK_BT
help
The Bluetooth stack uses memory that cannot be used as generic memory anymore. This
reserves the space for that within the memory map of the compiled binary.
This option is required to enable BT stack.
Temporarily, this option is not compatible with WiFi stack.
config MEMMAP_SMP config MEMMAP_SMP
bool "Reserve memory for two cores" bool "Reserve memory for two cores"
default "y" default "y"
@ -100,15 +64,6 @@ config MEMMAP_SPISRAM
main memory map. Enable this if you have this hardware and want to use it in the same main memory map. Enable this if you have this hardware and want to use it in the same
way as on-chip RAM. way as on-chip RAM.
config WIFI_ENABLED
bool
default "y"
depends on ESP32_ENABLE_STACK_WIFI
help
This compiles in the low-level WiFi stack.
Temporarily, this option is not compatible with BT stack.
config SYSTEM_EVENT_QUEUE_SIZE config SYSTEM_EVENT_QUEUE_SIZE
int "System event queue size" int "System event queue size"
default 32 default 32
@ -181,42 +136,42 @@ config CONSOLE_UART_NONE
endchoice endchoice
choice CONSOLE_UART_NUM choice CONSOLE_UART_NUM
prompt "UART peripheral to use for console output (0-1)" prompt "UART peripheral to use for console output (0-1)"
depends on CONSOLE_UART_CUSTOM depends on CONSOLE_UART_CUSTOM
default CONSOLE_UART_CUSTOM_NUM_0 default CONSOLE_UART_CUSTOM_NUM_0
help help
Due of a ROM bug, UART2 is not supported for console output Due of a ROM bug, UART2 is not supported for console output
via ets_printf. via ets_printf.
config CONSOLE_UART_CUSTOM_NUM_0 config CONSOLE_UART_CUSTOM_NUM_0
bool "UART0" bool "UART0"
config CONSOLE_UART_CUSTOM_NUM_1 config CONSOLE_UART_CUSTOM_NUM_1
bool "UART1" bool "UART1"
endchoice endchoice
config CONSOLE_UART_NUM config CONSOLE_UART_NUM
int int
default 0 if CONSOLE_UART_DEFAULT || CONSOLE_UART_NONE default 0 if CONSOLE_UART_DEFAULT || CONSOLE_UART_NONE
default 0 if CONSOLE_UART_CUSTOM_NUM_0 default 0 if CONSOLE_UART_CUSTOM_NUM_0
default 1 if CONSOLE_UART_CUSTOM_NUM_1 default 1 if CONSOLE_UART_CUSTOM_NUM_1
config CONSOLE_UART_TX_GPIO config CONSOLE_UART_TX_GPIO
int "UART TX on GPIO#" int "UART TX on GPIO#"
depends on CONSOLE_UART_CUSTOM depends on CONSOLE_UART_CUSTOM
range 0 33 range 0 33
default 19 default 19
config CONSOLE_UART_RX_GPIO config CONSOLE_UART_RX_GPIO
int "UART RX on GPIO#" int "UART RX on GPIO#"
depends on CONSOLE_UART_CUSTOM depends on CONSOLE_UART_CUSTOM
range 0 39 range 0 39
default 21 default 21
config CONSOLE_UART_BAUDRATE config CONSOLE_UART_BAUDRATE
int "UART console baud rate" int "UART console baud rate"
depends on !CONSOLE_UART_NONE depends on !CONSOLE_UART_NONE
default 115200 default 115200
range 1200 4000000 range 1200 4000000
config ULP_COPROC_ENABLED config ULP_COPROC_ENABLED
bool "Enable Ultra Low Power (ULP) Coprocessor" bool "Enable Ultra Low Power (ULP) Coprocessor"
@ -408,24 +363,24 @@ config BROWNOUT_DET_RESETDELAY
choice ESP32_TIME_SYSCALL choice ESP32_TIME_SYSCALL
prompt "Timers used for gettimeofday function" prompt "Timers used for gettimeofday function"
default ESP32_TIME_SYSCALL_USE_RTC_FRC1 default ESP32_TIME_SYSCALL_USE_RTC_FRC1
help help
This setting defines which hardware timers are used to This setting defines which hardware timers are used to
implement 'gettimeofday' and 'time' functions in C library. implement 'gettimeofday' and 'time' functions in C library.
- If only FRC1 timer is used, gettimeofday will provide time at - If only FRC1 timer is used, gettimeofday will provide time at
microsecond resolution. Time will not be preserved when going microsecond resolution. Time will not be preserved when going
into deep sleep mode. into deep sleep mode.
- If both FRC1 and RTC timers are used, timekeeping will - If both FRC1 and RTC timers are used, timekeeping will
continue in deep sleep. Time will be reported at 1 microsecond continue in deep sleep. Time will be reported at 1 microsecond
resolution. resolution.
- If only RTC timer is used, timekeeping will continue in - If only RTC timer is used, timekeeping will continue in
deep sleep, but time will be measured at 6.(6) microsecond deep sleep, but time will be measured at 6.(6) microsecond
resolution. Also the gettimeofday function itself may take resolution. Also the gettimeofday function itself may take
longer to run. longer to run.
- If no timers are used, gettimeofday and time functions - If no timers are used, gettimeofday and time functions
return -1 and set errno to ENOSYS. return -1 and set errno to ENOSYS.
config ESP32_TIME_SYSCALL_USE_RTC config ESP32_TIME_SYSCALL_USE_RTC
bool "RTC" bool "RTC"
@ -438,85 +393,104 @@ config ESP32_TIME_SYSCALL_USE_NONE
endchoice endchoice
choice ESP32_RTC_CLOCK_SOURCE choice ESP32_RTC_CLOCK_SOURCE
prompt "RTC clock source" prompt "RTC clock source"
default ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC default ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC
help help
Choose which clock is used as RTC clock source. Choose which clock is used as RTC clock source.
The only available option for now is to use internal The only available option for now is to use internal
150kHz RC oscillator. 150kHz RC oscillator.
config ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC config ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC
bool "Internal RC" bool "Internal RC"
config ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL config ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL
bool "External 32kHz crystal" bool "External 32kHz crystal"
depends on DOCUMENTATION_FOR_RTC_CNTL depends on DOCUMENTATION_FOR_RTC_CNTL
endchoice endchoice
config ESP32_DEEP_SLEEP_WAKEUP_DELAY config ESP32_DEEP_SLEEP_WAKEUP_DELAY
int "Extra delay in deep sleep wake stub (in us)" int "Extra delay in deep sleep wake stub (in us)"
default 0 default 0
range 0 5000 range 0 5000
help help
When ESP32 exits deep sleep, the CPU and the flash chip are powered on When ESP32 exits deep sleep, the CPU and the flash chip are powered on
at the same time. CPU will run deep sleep stub first, and then at the same time. CPU will run deep sleep stub first, and then
proceed to load code from flash. Some flash chips need sufficient proceed to load code from flash. Some flash chips need sufficient
time to pass between power on and first read operation. By default, time to pass between power on and first read operation. By default,
without any extra delay, this time is approximately 900us. without any extra delay, this time is approximately 900us.
If you are using a flash chip which needs more than 900us to become If you are using a flash chip which needs more than 900us to become
ready after power on, set this parameter to add extra delay ready after power on, set this parameter to add extra delay
to the default deep sleep stub. to the default deep sleep stub.
If you are seeing "flash read err, 1000" message printed to the If you are seeing "flash read err, 1000" message printed to the
console after deep sleep reset, try increasing this value. console after deep sleep reset, try increasing this value.
endmenu
config ESP32_PHY_AUTO_INIT
bool "Initialize PHY in startup code" menu "WiFi"
default y
help config WIFI_ENABLED
If enabled, PHY will be initialized in startup code, before bool "Enable WiFi stack"
app_main function runs. default y
If this is undesired, disable this option and call esp_phy_init
from the application before enabling WiFi or BT. config SW_COEXIST_ENABLE
bool "Software controls WiFi/Bluetooth coexistence"
If this option is enabled, startup code will also initialize depends on WIFI_ENABLED && BT_ENABLED
NVS prior to initializing PHY. default n
help
If unsure, choose 'y'. If enabled, WiFi & Bluetooth coexistence is controlled by software rather than hardware.
Recommended for heavy traffic scenarios. Both coexistence configuration options are
config ESP32_PHY_INIT_DATA_IN_PARTITION automatically managed, no user intervention is required.
bool "Use a partition to store PHY init data"
default n config ESP32_PHY_AUTO_INIT
help bool "Initialize PHY in startup code"
If enabled, PHY init data will be loaded from a partition. depends on WIFI_ENABLED
When using a custom partition table, make sure that PHY data default y
partition is included (type: 'data', subtype: 'phy'). help
With default partition tables, this is done automatically. If enabled, PHY will be initialized in startup code, before
If PHY init data is stored in a partition, it has to be flashed there, app_main function runs.
otherwise runtime error will occur. If this is undesired, disable this option and call esp_phy_init
from the application before enabling WiFi or BT.
If this option is not enabled, PHY init data will be embedded
into the application binary. If this option is enabled, startup code will also initialize
NVS prior to initializing PHY.
If unsure, choose 'n'.
If unsure, choose 'y'.
config ESP32_PHY_MAX_TX_POWER
int "Max TX power (dBm)" config ESP32_PHY_INIT_DATA_IN_PARTITION
range 0 20 bool "Use a partition to store PHY init data"
default 20 depends on WIFI_ENABLED
help default n
Set maximum transmit power. Actual transmit power for high help
data rates may be lower than this setting. If enabled, PHY init data will be loaded from a partition.
When using a custom partition table, make sure that PHY data
config ESP32_WIFI_RX_BUFFER_NUM partition is included (type: 'data', subtype: 'phy').
int "Max number of WiFi RX buffers" With default partition tables, this is done automatically.
range 2 25 If PHY init data is stored in a partition, it has to be flashed there,
default 25 otherwise runtime error will occur.
help
Set the number of WiFi rx buffers. Each buffer takes approximately 1.6KB of RAM. If this option is not enabled, PHY init data will be embedded
Larger number for higher throughput but more memory. Smaller number for lower into the application binary.
throughput but less memory.
If unsure, choose 'n'.
config ESP32_PHY_MAX_TX_POWER
int "Max TX power (dBm)"
range 0 20
default 20
depends on WIFI_ENABLED
help
Set maximum transmit power. Actual transmit power for high
data rates may be lower than this setting.
config ESP32_WIFI_RX_BUFFER_NUM
int "Max number of WiFi RX buffers"
depends on WIFI_ENABLED
range 2 25
default 25
help
Set the number of WiFi rx buffers. Each buffer takes approximately 1.6KB of RAM.
Larger number for higher throughput but more memory. Smaller number for lower
throughput but less memory.
endmenu endmenu

View File

@ -192,7 +192,7 @@ void heap_alloc_caps_init() {
// TODO: this region should be checked, since we don't need to knock out all region finally // TODO: this region should be checked, since we don't need to knock out all region finally
disable_mem_region((void*)0x3ffe0000, (void*)0x3ffe8000); //knock out ROM data region disable_mem_region((void*)0x3ffe0000, (void*)0x3ffe8000); //knock out ROM data region
#if CONFIG_MEMMAP_BT #if CONFIG_BT_ENABLED
disable_mem_region((void*)0x3ffb0000, (void*)0x3ffc0000); //knock out BT data region disable_mem_region((void*)0x3ffb0000, (void*)0x3ffc0000); //knock out BT data region
#endif #endif

View File

@ -5,10 +5,3 @@
# BT config # BT config
# #
CONFIG_BT_ENABLED=y CONFIG_BT_ENABLED=y
#
# ESP32-specific config
#
CONFIG_ESP32_ENABLE_STACK_BT=y
# CONFIG_ESP32_ENABLE_STACK_NONE is not set
CONFIG_MEMMAP_BT=y

View File

@ -5,10 +5,3 @@
# BT config # BT config
# #
CONFIG_BT_ENABLED=y CONFIG_BT_ENABLED=y
#
# ESP32-specific config
#
CONFIG_ESP32_ENABLE_STACK_BT=y
# CONFIG_ESP32_ENABLE_STACK_NONE is not set
CONFIG_MEMMAP_BT=y

View File

@ -5,10 +5,3 @@
# BT config # BT config
# #
CONFIG_BT_ENABLED=y CONFIG_BT_ENABLED=y
#
# ESP32-specific config
#
CONFIG_ESP32_ENABLE_STACK_BT=y
# CONFIG_ESP32_ENABLE_STACK_NONE is not set
CONFIG_MEMMAP_BT=y

View File

@ -5,10 +5,3 @@
# BT config # BT config
# #
CONFIG_BT_ENABLED=y CONFIG_BT_ENABLED=y
#
# ESP32-specific config
#
CONFIG_ESP32_ENABLE_STACK_BT=y
# CONFIG_ESP32_ENABLE_STACK_NONE is not set
CONFIG_MEMMAP_BT=y