ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
sdkconfig.h File Reference

The CONFIG_* answers the vendored esp-hosted core asks for. More...

Go to the source code of this file.

Macros

#define CONFIG_ESP_HOSTED_ENABLED   (1)
 This firmware is an esp-hosted host.
#define CONFIG_ESP_HOSTED_USE_MEMPOOL   (0)
 Transport buffers come from esp-hosted's own block pool.
#define CONFIG_ESP_HOSTED_DFLT_TASK_STACK   (4096)
 Default stack, in bytes, for a transport worker thread.
#define CONFIG_H_LOWER_MEMCOPY   (0)
 Do not trade a pooled buffer for a per-packet heap allocation.
#define CONFIG_ESP_HOSTED_WIFI_AUTO_CONNECT_ON_STA_START   (0)
 The application decides when to associate, not the event handler.
#define CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS   (0)
 No transmit-side Wi-Fi driver statistics are collected.
#define CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS   (0)
 No receive-side Wi-Fi driver statistics are collected.

Detailed Description

The CONFIG_* answers the vendored esp-hosted core asks for.

Tag
[Ring 4 / PORT] {World: NS}

On an ESP-IDF host this file does not exist in source control at all: menuconfig writes it into the build directory from the Kconfig tree, and every CONFIG_* symbol in it is a rendering of a choice made in that menu. There is no Kconfig tree here and no menuconfig to run, so the file is authored, and the authority for every value below is this project's own build – the transport that is actually wired, the RTOS that is actually linked, the allocator policy this firmware actually obeys. Nothing in this file may be justified by "that is what menuconfig defaults to"; it must be justified by what the RA8D2 build does.

Five vendored translation units include sdkconfig.h by name (esp_hosted_cli.{c,h}, mempool.h, mempool.c), and a further eighteen reach CONFIG_* symbols through other headers.

The two test forms are not interchangeable
This is the trap the whole file is arranged around. A symbol tested with #ifdef is ON whenever it exists, whatever its value – so defining one to 0 to mean "off" switches the feature on. A symbol tested with a bare #if must exist, or -Wundef (which this project builds with, see cmake/ra8_warnings.cmake) reports it. So:
  • #ifdef-tested symbols that should be off are left undefined;
  • #if-tested symbols are always defined, to (0) or (1);
  • symbols guarded by #if defined(X) && X are safe either way, and are left undefined so the file lists only decisions that matter. Every entry below says which form applies to it and where.
Symbols the vendored tree names but never tests
CONFIG_IDF_FIRMWARE_CHIP_ID and CONFIG_WIFI_BSS_MAX_IDLE_SUPPORT appear only inside comments and inside the generated protobuf schema, where they document what a co-processor-side field was derived from. Neither is ever reached by the preprocessor on this side of the link, so neither is defined here.
Since
0.1.0

Definition in file sdkconfig.h.

Macro Definition Documentation

◆ CONFIG_ESP_HOSTED_DFLT_TASK_STACK

#define CONFIG_ESP_HOSTED_DFLT_TASK_STACK   (4096)

Default stack, in bytes, for a transport worker thread.

Not a flag: sdio/sdio_drv.c expands it directly as the value of its four *_TASK_STACK_SIZE macros, so an undefined symbol here is a syntax error rather than a silent zero. 4096 matches DFLT_TASK_STACK_SIZE in port_esp_hosted_host_os.h, which is what the SPI driver – the transport this board actually uses – passes to _h_thread_create. Keeping the two equal means the SDIO driver, if it is ever built, gets the stack this port has already sized for a transport worker rather than a second, unrelated number.

Note
Read-only build configuration. Bytes, not words: the port's _h_thread_create passes the value to ThreadX as a byte count.
Warning
Must stay at or above ThreadX's TX_MINIMUM_STACK (512) or thread creation fails at run time, not at build time.
Example:
#define RX_TASK_STACK_SIZE CONFIG_ESP_HOSTED_DFLT_TASK_STACK
Since
0.1.0

Definition at line 132 of file sdkconfig.h.

◆ CONFIG_ESP_HOSTED_ENABLED

#define CONFIG_ESP_HOSTED_ENABLED   (1)

This firmware is an esp-hosted host.

Tested with #ifdef in common/utils/esp_hosted_cli.{c,h}, where it gates the includes of port_esp_hosted_host_config.h and the power-save driver – the host-side headers, as opposed to the co-processor ones. Defined because the statement is simply true: the RA8D2 drives an ESP32-C6 over SPI and this port supplies the host half of that link. The value is 1 for readability only; the #ifdef never inspects it.

Note
Read-only build configuration.
Warning
Never defined at the same time as CONFIG_ESP_HOSTED_COPROCESSOR. The two select opposite ends of the same link and the vendored CLI header includes a different, non-existent set of headers for each.
Example:
#ifdef CONFIG_ESP_HOSTED_ENABLED
#endif
esp-hosted port header: transport selection, side-band pin map, link polarity.
Since
0.1.0

Definition at line 74 of file sdkconfig.h.

◆ CONFIG_ESP_HOSTED_USE_MEMPOOL

#define CONFIG_ESP_HOSTED_USE_MEMPOOL   (0)

Transport buffers come from esp-hosted's own block pool.

Zero. Its companion H_USE_MEMPOOL in port_esp_hosted_host_config.h is left undefined rather than defined to zero, because the vendored vtable header guards four of its rows with #ifdef – defining that symbol at all, even to zero, would grow hosted_osi_funcs_t. This one is tested with a bare #if, so here zero is the spelling that means off. The two say the same thing in the two different dialects their consumers use. The reason for off is structural. common/mempool/mempool_ll.h includes freertos/FreeRTOS.h, portmacro.h, task.h and semphr.h unconditionally – upstream's pool is a FreeRTOS data structure, and this image runs ThreadX.

Switching it off costs nothing this project wanted. With it off every transport buffer goes through the port's _h_malloc_align, which serves from a fixed ThreadX byte pool carved once during initialisation, so the allocation profile stays bounded and NASA Power of 10 Rule 3 clean – which is the property the pool existed to provide.

Note
Read-only build configuration. Tested with a bare #if, so it must be defined rather than left absent.
Warning
Changing this without changing H_USE_MEMPOOL in the port config header splits one decision across two files that then disagree – and note that turning that one on means DEFINING it, not setting it to one.
Example:
#if CONFIG_ESP_HOSTED_USE_MEMPOOL
struct os_mempool pool;
#endif
Since
0.1.0

Definition at line 109 of file sdkconfig.h.

◆ CONFIG_ESP_HOSTED_WIFI_AUTO_CONNECT_ON_STA_START

#define CONFIG_ESP_HOSTED_WIFI_AUTO_CONNECT_ON_STA_START   (0)

The application decides when to associate, not the event handler.

Tested with a bare #if in three places in rpc/wrap/rpc_wrap.c: it guards a forward declaration, the definition of rpc_wifi_connect_async(), and the call to it from inside the WIFI_EVENT_STA_START case. Zero, so the station-started event is reported and nothing else happens. Two reasons. It matches ESP-IDF's own contract, in which an application calls esp_wifi_connect() itself once it has credentials – code written against ESP-IDF and moved onto this port behaves the same. And it keeps association policy in the application rather than firing an asynchronous RPC from inside the Wi-Fi event dispatch, where a failure has no caller to return to.

Note
Read-only build configuration.
Warning
Setting this to 1 makes the host issue a connect RPC before the application has necessarily supplied an SSID, and the result is delivered to a callback rather than to the caller.
Example:
#if CONFIG_ESP_HOSTED_WIFI_AUTO_CONNECT_ON_STA_START
rpc_wifi_connect_async();
#endif
Since
0.1.0

Definition at line 191 of file sdkconfig.h.

◆ CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS

#define CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS   (0)

No receive-side Wi-Fi driver statistics are collected.

The receive-side twin of CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS, tested with a bare #if in the same three CLI command tables and zero for the same reason.

Note
Read-only build configuration.
Warning
See CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS; the two are enabled and disabled together in practice.
Example:
#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS
register_rx_stats_command();
#endif
Since
0.1.0

Definition at line 232 of file sdkconfig.h.

◆ CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS

#define CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS   (0)

No transmit-side Wi-Fi driver statistics are collected.

Tested with a bare #if in common/utils/esp_hosted_cli.c, which gates CLI commands that dump the co-processor's Wi-Fi driver counters. Zero: the counters live in the Wi-Fi driver on the ESP32-C6, and the only thing that reads them is the CLI, which this build does not have (see CONFIG_ESP_HOSTED_CLI_ENABLED in the undefined section below).

Note
Read-only build configuration.
Warning
Turning this on without also enabling the CLI defines a symbol that nothing consults; the counters are surfaced only through CLI commands.
Example:
#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS
register_tx_stats_command();
#endif
Since
0.1.0

Definition at line 213 of file sdkconfig.h.

◆ CONFIG_H_LOWER_MEMCOPY

#define CONFIG_H_LOWER_MEMCOPY   (0)

Do not trade a pooled buffer for a per-packet heap allocation.

Tested with a bare #if in host/utils/stats.c and in spi/spi_drv.c – in the SPI driver inside an outer #if 0, so only the statistics path is live. Upstream's "lower memcopy" variant saves one copy by calling _h_calloc for every raw-throughput packet and freeing it again afterwards. Zero, because that is a per-packet heap allocation on a hot path: NASA Power of 10 Rule 3 rules it out, and it would also contradict CONFIG_ESP_HOSTED_USE_MEMPOOL, which says transport buffers come from the pool.

Note
Read-only build configuration.
Warning
Do not set this to 1 to chase throughput without first removing the Rule 3 obligation; the win is one memcpy per frame and the cost is unbounded allocation during steady-state operation.
Example:
#if CONFIG_H_LOWER_MEMCOPY
buf = g_h.funcs->_h_calloc(1, MAX_TRANSPORT_BUFFER_SIZE);
#endif
#define MAX_TRANSPORT_BUFFER_SIZE
Bytes moved in one SDIO block transfer.
struct hosted_config_t g_h
The handle the vendored core dereferences to reach the vtable.
Since
0.1.0

Definition at line 164 of file sdkconfig.h.