69 __asm
volatile(
"wfi");
121 if (event ==
nullptr) {
366 const uint8_t* startup_jpeg =
nullptr;
367 uint32_t startup_jpeg_bytes = 0U;
378 c6_cam_puts(
"c6_cam: camera selftest=PASS jpeg_bytes=");
417 c6_cam_puts(
"c6_cam: audio=PASS mic=MIC1 fs=16000Hz pcm=20bit\r\n");
436 c6_cam_puts(
"c6_cam: FAIL esp-hosted port init err=");
476 (void)first_unused_memory;
static volatile uint8_t s_disconnected
static uint32_t s_cpuclk_hz
static volatile uint8_t s_connected
static bool internal_c6_cam_join(c6_cam_lease_t *lease, const ra8_net_credentials_t *credentials)
Join configured Wi-Fi and acquire a DHCP lease.
static void internal_c6_cam_setup_or_halt(void)
Initialize shared clocks, services, and the diagnostic console.
static ra8_c6link_t s_link
static bool internal_c6_cam_prepare_camera(void)
Initialize the camera backend and prove one startup JPEG capture.
static bool internal_c6_cam_prepare_link(void)
Open the C6 link and await firmware readiness.
static void internal_c6_cam_on_event(void *ctx, const ra8_c6link_event_t *event)
Latch station connection events from the C6 link.
static volatile uint32_t s_events
static TX_THREAD s_worker
static bool internal_c6_cam_wait_connected(void)
Poll for a station association result.
static bool internal_c6_cam_associate(ra8_c6link_mac_t *mac, const ra8_net_credentials_t *credentials)
Start station mode and associate with the configured AP.
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 bool internal_c6_cam_prepare_media(void)
Initialize and self-test the audio and camera backends.
static volatile uint16_t s_disconnect_reason
int32_t c6_cam_app_run(void)
Run the shared runtime-provisioned C6, DHCP, and HTTP application flow.
static void internal_c6_cam_report_fault(const char *stage, ra8_err_t err)
Emit one standardized application failure line.
static uint32_t s_pclka_hz
static ra8_err_t s_port_err
static ra8_err_t internal_c6_cam_open_link(void)
Bind and open the raw ESP-hosted C6 link.
void tx_application_define(void *first_unused_memory)
static void internal_c6_cam_halt(void)
Park the application after a terminal failure.
static void internal_c6_cam_worker_entry(ULONG input)
Run the network, audio, camera, and HTTP worker workflow.
Shared contracts for ESP32-C6 browser camera servers.
void c6_cam_http_serve(void)
Serve the browser UI and fresh JPEG frames forever.
void c6_cam_put_u32(uint32_t value)
Write one unsigned decimal value to SCI8.
ra8_err_t c6_cam_camera_init(void)
Camera image and board-switch initialization, then one CEU capture.
@ k_c6_cam_arena_bytes
C6-link caller-owned arena size.
@ k_c6_cam_worker_prio
ThreadX worker priority.
@ k_c6_cam_uart_baud
Diagnostic console baud rate.
@ k_c6_cam_edge_poll_ms
C6 interrupt-edge poll period.
@ k_c6_cam_sck_hz
Camera-stream ESP-hosted SPI rate.
@ k_c6_cam_assoc_polls
Maximum association status polls.
@ k_c6_cam_assoc_gap_ms
Delay between association polls.
@ k_c6_cam_worker_stack
Worker thread stack bytes.
@ k_c6_cam_boot_wait_ms
C6 boot stabilization delay.
ra8_err_t c6_cam_audio_start(void)
Start continuous MIC1 capture into the SDRAM audio ring.
void c6_cam_put_ip(uint32_t ip)
Write one IPv4 address to SCI8.
ra8_err_t c6_cam_camera_capture_jpeg(const uint8_t **out_jpeg, uint32_t *out_bytes, c6_cam_frame_timing_t *out_timing)
ra8_err_t c6_cam_net_up(ra8_c6link_t *link, const ra8_c6link_mac_t *mac, c6_cam_lease_t *out)
Bind NetX to an associated raw C6 link and obtain a DHCP lease.
void c6_cam_puts(const char *text)
Write a bounded NUL-terminated string to SCI8.
void c6_cam_camera_report_last_error(void)
Emit backend-specific diagnostics for the last capture failure.
const char * c6_cam_camera_description(void)
Human-readable description of the selected camera backend.
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.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
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_clocks_init(ra8_board_clock_rates_t *out_rates)
Initialize the standard EK-RA8D2 clock tree and return its rates.
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.
The single integration boundary between this firmware and the ESP32-C6.
@ 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
@ 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_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.
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.
ra8_err_t ra8_isr_init(void)
Initialise the ra8_isr table.
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.
External SDRAM controller driver (framework).
ra8_err_t ra8_sdramc_init(void)
Initialise the external SDRAM at k_ra8_sdram_base_addr.
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.
Per-frame pipeline latency exposed in HTTP Server-Timing headers.
uint32_t capture_ms
Camera capture latency.
DHCP lease returned by the raw, bench-validated C6/NetX path.
bool bound
True after a lease is bound.
uint32_t ip
Assigned IPv4 address.
Clock rates published by the standard EK-RA8D2 bring-up.
uint32_t pclka_hz
Peripheral clock A rate in hertz.
uint32_t cpuclk0_hz
Main Cortex-M85 clock rate in hertz.
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.
ra8_c6link_event_kind_t kind
Which announcement this is.
uint32_t major
Firmware major version.
uint32_t patch
Firmware patch version.
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.