89 __asm
volatile(
"wfi");
219 .ssid = credentials->
ssid,
220 .psk = credentials->
psk,
254 wifi_hal_puts(
"wifi_hal: FAIL association did not complete connect=");
273 wifi_hal_puts(
"wifi_hal: FAIL join_run failed with every stage reported ok\r\n");
294 wifi_hal_puts(passed ?
"wifi_hal: alive PASS\r\n" :
"wifi_hal: alive FAIL\r\n");
320 wifi_hal_puts(
"wifi_hal: FAIL port init failed -- no transaction attempted\r\n");
362 (void)first_unused_memory;
382 wifi_hal_puts(
"wifi_hal: worker thread creation failed\r\n");
402 wifi_hal_puts(
"wifi_hal: entering ThreadX; port init runs from tx_application_define\r\n");
void main(void)
Secure fallback main entry point.
static uint32_t s_cpuclk_hz
static ra8_c6link_t s_link
static TX_THREAD s_worker
static const ra8_net_provision_uart_t s_provision_uart
Board-console binding for the shared runtime provisioner.
static CHAR s_worker_name[]
static UCHAR s_worker_stack[k_c6_cam_worker_stack]
static uint8_t s_arena[k_c6_cam_arena_bytes]
static uint32_t s_pclka_hz
void tx_application_define(void *first_unused_memory)
ThreadX system-define hook: build worker thread + byte pool.
static ra8_err_t s_init_err
Port-init result from tx_application_define.
static ra8_wifi_c6link_t s_c6
The ESP32-C6 ra8_wifi backend context.
static bool wifi_hal_run(const ra8_net_credentials_t *credentials)
Execute the HAL network journey with runtime credentials.
static ra8_err_t wifi_hal_make_cfg(ra8_wifi_cfg_t *out)
Build the C6-backed Wi-Fi and NetX DHCP configuration.
static void wifi_hal_heartbeat(bool passed)
Preserve the terminal verdict as a periodic console heartbeat.
static void wifi_hal_setup_or_halt(void)
Initialize platform services required by the HAL join application.
static void wifi_hal_print_lease(const ra8_wifi_lease_t *lease)
Print the non-secret fields of one DHCP lease.
static bool wifi_hal_report(const wifi_hal_result_t *res, bool joined)
Report one completed HAL journey and derive its terminal verdict.
static void wifi_hal_worker_entry(ULONG thread_input)
Run runtime provisioning, the HAL journey, erasure, and heartbeat.
static ra8_wifi_t s_wifi
The Wi-Fi handle every operation goes through.
static void wifi_hal_panic_halt(void)
Halt the processor after an unrecoverable start-up failure.
NetX Duo network driver shim that bridges onto the ESP32-C6 link.
void nx_ether_driver_c6_rx(void *ctx, const uint8_t *frame, uint16_t len)
Receive callback the application registers with ra8_c6link_open.
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
@ k_ra8_board_pmod1_sci_channel
Pmod1 (J26) Simple-SPI is SCI2.
ra8_err_t ra8_board_uart_console_read(uint8_t *out, size_t cap, size_t *out_len)
Polled non-blocking read from the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
Boot entry points shared between a vector table and its startup code.
The single integration boundary between this firmware and the ESP32-C6.
struct ra8_c6link ra8_c6link_t
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
@ k_ra8_clock_id_cpuclk0
Cortex-M85 CPUCLK0.
@ k_ra8_clock_id_pclka
PCLKA.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_not_initialized
Module not initialized – _init() not yet called successfully.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
const char * ra8_err_to_str(ra8_err_t err)
Human-readable string for an error code.
Binds the ra8_c6link transport seam to this port's OS vtable.
ra8_err_t ra8_esp_hosted_c6link_bind(ra8_c6link_transport_t *out)
Fill a ra8_c6link transport seam with this port's implementations.
Public entry point of the RA8D2 + ThreadX port of esp-hosted.
struct ra8_esp_hosted_port_cfg ra8_esp_hosted_port_cfg_t
ra8_err_t ra8_esp_hosted_port_init(const ra8_esp_hosted_port_cfg_t *cfg)
Bring the esp-hosted port up and publish the OS-abstraction vtable.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_init(void)
Re-establish the ra8_mstp ref-count table from current hardware state.
Runtime network provisioning contract for EK-RA8D2 applications.
struct ra8_net_credentials ra8_net_credentials_t
struct ra8_net_provision_uart ra8_net_provision_uart_t
@ k_ra8_net_provision_timeout_ms
Standard application RX timeout.
ra8_err_t ra8_net_provision_receive(const ra8_net_provision_uart_t *uart, uint32_t timeout_ms, ra8_net_credentials_t *out)
Prompt once and receive one provisioning line within a fixed timeout.
void ra8_net_provision_clear(ra8_net_credentials_t *credentials)
Explicitly erase one decoded credential record.
SysTick-based tick counter, delay and timestamp helpers.
ra8_err_t ra8_time_init(uint32_t cpu_hz)
Initialise SysTick for a 1 kHz tick interrupt.
void ra8_delay_ms(uint32_t ms)
Busy-wait for at least ms milliseconds.
unsigned int UINT
ThreadX-compatible unsigned int (host stub).
char CHAR
ThreadX-compatible CHAR (host stub).
unsigned long ULONG
ThreadX-compatible unsigned long (host stub).
A small, uniform Wi-Fi facade: init, connect, get an IP, disconnect.
struct ra8_wifi_lease ra8_wifi_lease_t
struct ra8_wifi ra8_wifi_t
struct ra8_wifi_cfg ra8_wifi_cfg_t
The ESP32-C6 backend for the ra8_wifi facade, over ra8_c6link.
struct ra8_wifi_c6link_cfg ra8_wifi_c6link_cfg_t
ra8_err_t ra8_wifi_c6link_setup(ra8_wifi_c6link_t *self, const ra8_wifi_c6link_cfg_t *cfg, ra8_wifi_cfg_t *out_wcfg)
Wire this backend into the backend half of an ra8_wifi_cfg_t.
struct ra8_wifi_c6link ra8_wifi_c6link_t
Opaque thread stand-in for the host build.
char psk[k_ra8_net_provision_psk_bytes_max+1U]
NUL-terminated PSK storage.
char ssid[k_ra8_net_provision_ssid_bytes_max+1U]
NUL-terminated SSID storage.
uint8_t channel
Primary channel in use.
ra8_c6link_rx_cb_t rx_cb
IP-stack L2 receive sink, or null.
uint32_t arena_bytes
Bytes available at arena.
ra8_c6link_transport_t transport
Bound hardware (or model) seam.
ra8_c6link_t * link
Caller-allocated link, opened by the backend.
uint8_t * arena
Protobuf decode arena for the link.
ra8_wifi_ip_bind_fn ip_bind
IP-stack hook for ra8_wifi_wait_ip.
void * ip_ctx
Opaque context handed to ip_bind.
uint32_t dhcp_server
Address of the DHCP server that answered.
uint32_t gateway
Default gateway from the lease.
uint32_t mask
Subnet mask from the lease.
uint32_t ip
Leased station address, or zero if unbound.
ra8_wifi_lease_t lease
The DHCP lease, once bound.
ra8_wifi_ap_t ap
AP record, once associated.
ra8_err_t init_err
What ra8_wifi_init returned.
bool associated
The station joined the network.
bool ip_bound
A DHCP lease was obtained.
ra8_wifi_mac_t mac
Station MAC, once associated.
ra8_err_t ip_err
What ra8_wifi_wait_ip returned.
ra8_err_t connect_err
What ra8_wifi_connect returned.
bool init_ok
The facade initialised.
Constants, console formatters and the DHCP provider for the HAL join.
const char k_wifi_hal_pass_line[]
The exact PASS line the run prints; the HIL gate keys on it.
void wifi_hal_put_ip(uint32_t ip)
Write a packed IPv4 address as a dotted quad.
void wifi_hal_puts(const char *text)
Write a NUL-terminated string to the console, bounded.
void wifi_hal_print_banner(uint32_t cpuclk_hz, uint32_t pclka_hz)
Print the start-up banner naming the clocks and the link geometry.
void wifi_hal_put_mac(const ra8_wifi_mac_t *mac)
Write a station MAC as colon-separated hex octets.
struct wifi_hal_run_cfg wifi_hal_run_cfg_t
@ k_wifi_hal_worker_prio
Worker priority and preemption cap.
@ k_wifi_hal_boot_wait_ms
Settling delay before the first frame.
@ k_wifi_hal_worker_stack
Worker-thread stack, in bytes.
@ k_wifi_hal_sck_hz
SPI bit rate; the rate silicon ran at.
@ k_wifi_hal_uart_baud
Console rate over the J-Link OB VCOM.
@ k_wifi_hal_heartbeat_ms
Heartbeat gap after the verdict.
@ k_wifi_hal_arena_bytes
Decode arena handed to the facade.
@ k_wifi_hal_edge_poll_ms
Poll period for a side-band pin.
bool wifi_hal_join_run(const wifi_hal_run_cfg_t *cfg, wifi_hal_result_t *out)
The example's whole network journey, hardware-free: init, join, DHCP.
void wifi_hal_put_u32(uint32_t value)
Write an unsigned 32-bit value in decimal.
ra8_err_t wifi_hal_ip_bind(void *ip_ctx, const ra8_wifi_mac_t *mac, ra8_wifi_lease_t *out)
The application's IP provider: a NetX Duo DHCP client to a lease.
@ k_wifi_hal_assoc_polls
Extra association polls after connect.
struct wifi_hal_result wifi_hal_result_t
const char k_wifi_hal_fail_line[]
The summary FAIL line the run prints when it did not reach an IP.