95 __asm
volatile(
"wfi");
338 c6_join_puts(
"c6_join: FAIL association did not complete (reason=");
384 return (lease.
ip != 0U);
403 c6_join_puts(passed ?
"c6_join: alive PASS\r\n" :
"c6_join: alive FAIL\r\n");
430 c6_join_puts(
"c6_join: FAIL port init failed -- no transaction attempted\r\n");
442 c6_join_puts(
"c6_join: FAIL runtime provisioning err=");
461 c6_join_puts(
"c6_join: PASS ra8_c6link joined the bench Wi-Fi and DHCP leased an "
464 c6_join_puts(
"c6_join: FAIL Wi-Fi join to a DHCP lease did not complete\r\n");
484 (void)first_unused_memory;
504 c6_join_puts(
"c6_join: worker thread creation failed\r\n");
524 c6_join_puts(
"c6_join: entering ThreadX; port init runs from tx_application_define\r\n");
void main(void)
Secure fallback main entry point.
static volatile uint8_t s_disconnected
static uint32_t s_cpuclk_hz
static volatile uint8_t s_connected
static ra8_c6link_t s_link
static volatile uint32_t s_events
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
Shared contract for the C6 Wi-Fi join + DHCP + reachability app.
@ k_c6_join_assoc_gap_ms
Gap between association polls, milliseconds.
@ k_c6_join_assoc_tries
Association poll attempts before giving up.
void c6_join_print_banner(uint32_t cpuclk_hz, uint32_t pclka_hz)
Print the banner: identity, clocks and link parameters.
@ k_c6_join_worker_stack
Worker-thread stack, in bytes.
@ k_c6_join_uart_baud
Console rate, 8N1, over the J-Link OB VCOM.
@ k_c6_join_heartbeat_ms
Heartbeat gap after the verdict, in milliseconds and therefore in ThreadX ticks.
@ k_c6_join_worker_prio
Worker priority and preemption threshold.
@ k_c6_join_edge_poll_ms
Poll period for a side-band pin with no ICU channel.
@ k_c6_join_boot_wait_ms
Settling delay before the first transaction.
@ k_c6_join_arena_bytes
Decode arena handed to the facade.
@ k_c6_join_sck_hz
SPI bit rate; the rate silicon ran at.
ra8_err_t c6_join_net_up(ra8_c6link_t *link, const ra8_c6link_mac_t *mac, c6_join_lease_t *out)
Bring the IP layer up over the associated C6 link and prove traffic.
struct c6_join_lease c6_join_lease_t
void c6_join_put_hex(uint32_t value, uint8_t digits)
Emit a value as a fixed-width lower-case hexadecimal field.
void c6_join_put_ip(uint32_t ip)
Emit a packed IPv4 address as a dotted quad.
void c6_join_put_u32(uint32_t value)
Emit an unsigned 32-bit value in decimal.
void c6_join_put_mac(const ra8_c6link_mac_t *mac)
Emit an IEEE 802 address as six colon-separated hexadecimal octets.
void c6_join_puts(const char *text)
Write a NUL-terminated string to the board console.
@ k_c6_join_hex_byte
Hex digits printed for a byte-wide field.
void tx_application_define(void *first_unused_memory)
ThreadX system-define hook: build worker thread + byte pool.
static bool c6_join_wait_connected(void)
Poll until station association succeeds, fails, or times out.
static ra8_err_t s_init_err
Port-init result from tx_application_define.
static void c6_join_heartbeat(bool passed)
Preserve the terminal verdict as a periodic console heartbeat.
static void c6_join_on_event(void *ctx, const ra8_c6link_event_t *ev)
Record one C6 announcement and update association latches.
static void c6_join_setup_or_halt(void)
Initialize platform services required by the join application.
static void c6_join_worker_entry(ULONG thread_input)
Run provisioning, C6 readiness, association, DHCP, and heartbeat.
static void c6_join_report_fault(const char *what, ra8_err_t err)
Report one failed C6 join stage without revealing credentials.
static void c6_join_panic_halt(void)
Halt the processor after an unrecoverable start-up failure.
static ra8_err_t c6_join_open_link(void)
Bind ESP-hosted transport and open the application C6 link.
static bool c6_join_phase_ready(ra8_c6link_fw_version_t *out)
Open the C6 link and establish co-processor readiness.
static bool c6_join_phase_ip(const ra8_c6link_mac_t *mac)
Bring up NetX, print the lease, and judge address acquisition.
static bool c6_join_phase_associate(ra8_c6link_mac_t *mac_out, const ra8_net_credentials_t *credentials)
Start Wi-Fi and associate using one runtime credential record.
static volatile uint16_t s_reason
Last 802.11 disconnect reason code.
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_fault ra8_c6link_fault_t
@ k_ra8_c6link_announce_transfers
Transactions ra8_c6link_await_ready spends on the announcement before it probes.
struct ra8_c6link_mac ra8_c6link_mac_t
ra8_err_t ra8_c6link_last_fault(const ra8_c6link_t *link, ra8_c6link_fault_t *out)
Report the last request that failed on this link.
@ k_ra8_c6link_event_sta_connected
Event_StaConnected: the station has associated with an AP.
@ k_ra8_c6link_event_sta_disconnected
Event_StaDisconnected: the station has lost or left its AP.
ra8_err_t ra8_c6link_open(ra8_c6link_t *link, const ra8_c6link_cfg_t *cfg)
Bind a transport to a link handle and make it usable.
ra8_err_t ra8_c6link_await_ready(ra8_c6link_t *link, uint16_t max_transactions, ra8_c6link_fw_version_t *out)
Announce this host and prove the co-processor is answering.
struct ra8_c6link_cfg ra8_c6link_cfg_t
ra8_err_t ra8_c6link_poll(ra8_c6link_t *link, uint16_t max_transactions, ra8_c6link_stats_t *stats)
Clock transactions, delivering whatever the co-processor sends.
struct ra8_c6link_stats ra8_c6link_stats_t
struct ra8_c6link_event ra8_c6link_event_t
struct ra8_c6link_fw_version ra8_c6link_fw_version_t
struct ra8_c6link ra8_c6link_t
Wi-Fi station bring-up and association over the C6 link.
struct ra8_c6link_sta_cfg ra8_c6link_sta_cfg_t
ra8_err_t ra8_c6link_wifi_mac(ra8_c6link_t *link, ra8_c6link_mac_t *out)
Read the station interface's MAC address.
ra8_err_t ra8_c6link_sta_cfg_set(ra8_c6link_sta_cfg_t *cfg, const char *ssid, const char *pass)
Fill a station configuration from an SSID and a passphrase.
ra8_err_t ra8_c6link_wifi_start(ra8_c6link_t *link)
Start the co-processor's Wi-Fi radio in station mode.
ra8_err_t ra8_c6link_wifi_join(ra8_c6link_t *link, const ra8_c6link_sta_cfg_t *cfg)
Ask the station to associate with the configured network.
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.
Secure-comparison primitives for the crypto / secure-boot paths.
void ra8_secure_memzero(void *ptr, size_t len)
Securely zero a buffer such that the write cannot be optimised away.
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).
Opaque thread stand-in for the host build.
uint32_t gateway
Default gateway from the lease; the ping target.
uint32_t mask
Subnet mask from the lease.
uint32_t dhcp_server
Address of the DHCP server that answered.
bool ping_ok
A gateway ICMP echo reply was received.
uint32_t ip
Leased station address, or zero on failure.
ra8_c6link_transport_t transport
The hardware seam; every row required.
uint32_t arena_bytes
Bytes available at arena.
uint8_t * arena
Protobuf decode arena.
void * cb_ctx
Context handed to both callbacks.
ra8_c6link_rx_cb_t rx_cb
802.3 receive sink, or null to count.
ra8_c6link_event_cb_t event_cb
Announcement sink, or null to count.
uint16_t reason
802.11 reason code, sta_disconnected.
ra8_c6link_event_kind_t kind
Which announcement this is.
uint32_t major
Firmware major version.
uint32_t patch
Firmware patch version.
uint32_t chip_id
Co-processor chip identifier.
uint32_t minor
Firmware minor version.
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.