149 __asm__
volatile(
"wfi");
212 c6_hosted_puts(
"c6_hosted_init: port down -- side-band cannot be read\r\n");
242 c6_hosted_puts(
"c6_hosted_init: FAIL port init failed -- no transaction attempted\r\n");
270 (void)first_unused_memory;
273 c6_hosted_puts(
"c6_hosted_init: event handler registration refused\r\n");
294 c6_hosted_puts(
"c6_hosted_init: worker thread creation failed\r\n");
315 c6_hosted_puts(
"c6_hosted_init: entering ThreadX; port init runs from "
316 "tx_application_define\r\n");
void main(void)
Secure fallback main entry point.
Shared contract for the esp-hosted port bring-up application.
void c6_hosted_print_banner(uint32_t cpuclk_hz, uint32_t pclka_hz)
Print the port identity, the clocks and the SPI parameters.
void c6_hosted_report_sideband(void)
Sample both side-band lines through the vtable and report them.
void c6_hosted_run_transaction(void)
Clock one full-duplex transaction and report the verdict.
uint32_t c6_hosted_event_count(void)
Report how many events c6_hosted_on_event has seen.
void c6_hosted_puts(const char *text)
Write a NUL-terminated string to the board console.
void c6_hosted_put_u32(uint32_t value)
Emit an unsigned 32-bit value in decimal.
void c6_hosted_print_pin_map(void)
Print the resolved pin map, bus pins and side-band alike.
@ k_c6_hosted_worker_stack
Worker-thread stack, in bytes.
@ k_c6_hosted_worker_prio
Worker priority and preemption threshold.
@ k_c6_hosted_sck_hz
SPI bit rate: the 5 MHz upstream recommends for first light, an order above the probe's 1 MHz.
@ k_c6_hosted_uart_baud
Console rate, 8N1, over the J-Link OB VCOM.
@ k_c6_hosted_edge_poll_ms
Poll period for a side-band pin with no ICU channel.
@ k_c6_hosted_boot_wait_ms
Settling delay before the first vtable read.
@ k_c6_hosted_heartbeat_ms
Heartbeat gap; the ThreadX tick is 1 ms, so this is also the sleep expressed in ticks.
void c6_hosted_on_event(void *ctx, const char *base, int32_t event_id, const void *data, size_t data_len)
Report an event the port delivered from the vendored core.
void tx_application_define(void *first_unused_memory)
ThreadX system-define hook: build worker thread + byte pool.
static ra8_err_t s_c6_hosted_init_err
Exact result of ra8_esp_hosted_port_init.
static void c6_hosted_setup_or_halt(void)
Bring clocks, module-stop state, SysTick and the console up.
static void c6_hosted_panic_halt(void)
Park the CPU forever after an unrecoverable bring-up failure.
static uint32_t s_c6_hosted_cpuclk_hz
Cached CPUCLK0 rate, used to programme SysTick.
static CHAR s_c6_hosted_worker_name[]
Thread name handed to ThreadX.
static UCHAR s_c6_hosted_worker_stack[k_c6_hosted_worker_stack]
Stack backing s_c6_hosted_worker.
static void c6_hosted_heartbeat(void)
Print heartbeat lines forever, never returning.
static void c6_hosted_worker_entry(ULONG thread_input)
Worker thread: report the init, exercise the link, then heartbeat.
static uint32_t s_c6_hosted_pclka_hz
Cached PCLKA rate, the SCI baud-clock source the port divides.
static TX_THREAD s_c6_hosted_worker
Control block of the single application thread.
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_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.
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.
Public entry point of the RA8D2 + ThreadX port of esp-hosted.
bool ra8_esp_hosted_port_is_ready(void)
Report whether the port is currently initialised.
struct ra8_esp_hosted_port_cfg ra8_esp_hosted_port_cfg_t
ra8_err_t ra8_esp_hosted_port_set_event_cb(ra8_esp_hosted_event_cb_t cb, void *ctx)
Register the handler the port calls when the core posts an event.
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.
void ra8_esp_hosted_mem_dump(const char *label)
Report transport pool occupancy at a named point.
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.
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.