47#include "esp_hosted_header.h"
70typedef enum : uint32_t {
103typedef enum : uint16_t {
138typedef enum : uint16_t {
239 const uint8_t* payload,
422 const uint8_t* payload,
423 uint16_t payload_len,
424 uint16_t max_transfers,
539bool c6_fwver_rpc_consume(uint8_t if_type, uint8_t if_num,
const uint8_t* payload, uint16_t len);
578bool c6_fwver_dispatch(uint8_t if_type, uint8_t if_num,
const uint8_t* payload, uint16_t len);
ra8_err_t c6_fwver_link_pump(uint8_t if_type, uint8_t if_num, const uint8_t *payload, uint16_t payload_len, uint16_t max_transfers, c6_fwver_sink_t sink, c6_fwver_pump_stats_t *stats)
Clock full-duplex transactions until the sink is satisfied.
c6_fwver_cfg_t
Link, thread and pacing parameters this application chooses.
@ k_c6_fwver_worker_prio
Worker priority and preemption threshold.
@ k_c6_fwver_edge_poll_ms
Poll period for a side-band pin with no ICU channel.
@ k_c6_fwver_heartbeat_ms
Heartbeat gap after the verdict, in milliseconds and therefore in ThreadX ticks.
@ k_c6_fwver_boot_wait_ms
Settling delay before the first transaction.
@ k_c6_fwver_uart_baud
Console rate, 8N1, over the J-Link OB VCOM.
@ k_c6_fwver_rpc_uid
UID stamped on the request; the response must carry it back unchanged.
@ k_c6_fwver_worker_stack
Worker-thread stack, in bytes.
@ k_c6_fwver_sck_hz
SPI bit rate; the rate the port ran at on silicon in the c6_hosted_init bring-up.
@ k_c6_fwver_dma_align
Transaction-buffer alignment, in bytes.
bool(* c6_fwver_sink_t)(uint8_t if_type, uint8_t if_num, const uint8_t *payload, uint16_t len)
Receiver for one well-formed frame the co-processor sent.
bool c6_fwver_rpc_consume(uint8_t if_type, uint8_t if_num, const uint8_t *payload, uint16_t len)
Decode an ESP_SERIAL_IF frame as the awaited RPC response.
bool c6_fwver_dispatch(uint8_t if_type, uint8_t if_num, const uint8_t *payload, uint16_t len)
Route a received frame to the module that understands it.
void c6_fwver_print_banner(uint32_t cpuclk_hz, uint32_t pclka_hz)
Print the banner: identity, clocks and SPI parameters.
void c6_fwver_put_i32(int32_t value)
Emit a signed 32-bit value in decimal.
ra8_err_t c6_fwver_priv_host_caps(uint8_t *out, uint16_t cap, uint16_t *out_len)
Build the host-capabilities frame the reference host sends first.
void c6_fwver_print_pump(const char *label, const c6_fwver_pump_stats_t *stats)
Print what one pump did, as one console line.
void c6_fwver_put_hex(uint32_t value, uint8_t digits)
Emit a value as a fixed-width lower-case hexadecimal field.
c6_fwver_link_t
Frame geometry and pump budgets the transaction layer works to.
@ k_c6_fwver_gap_ms
Settling gap between consecutive transactions.
@ k_c6_fwver_hs_poll_ms
Sampling period while waiting for HANDSHAKE.
@ k_c6_fwver_max_transfers
Transactions one pump may clock before giving up.
@ k_c6_fwver_hs_giveup
Consecutive HANDSHAKE timeouts after which the pump stops.
@ k_c6_fwver_frame_bytes
Bytes clocked in one full-duplex transaction.
@ k_c6_fwver_hs_wait_ms
Milliseconds to wait for HANDSHAKE before abandoning a transaction.
@ k_c6_fwver_tx_max
Bound on any payload this application transmits: the packed RPC request and its TLV envelope are two ...
union c6_fwver_frame c6_fwver_frame_t
struct c6_fwver_pump_stats c6_fwver_pump_stats_t
ra8_err_t c6_fwver_rpc_request(uint8_t *out, uint16_t cap, uint16_t *out_len)
Build the TLV-wrapped RPC firmware-version request.
bool c6_fwver_priv_consume(uint8_t if_type, uint8_t if_num, const uint8_t *payload, uint16_t len)
Decode an ESP_PRIV_IF frame and report what it announced.
c6_fwver_fmt_t
Bounds for the console formatters in src/c6_fwver_console.c.
@ k_c6_fwver_hex_word
Hex digits printed for a 16-bit field.
@ k_c6_fwver_hex_byte
Hex digits printed for a byte-wide field.
@ k_c6_fwver_hex_alpha
First nibble value spelled with a letter.
@ k_c6_fwver_str_max
Longest string the console helper emits.
@ k_c6_fwver_dec_digits
Digits in the widest 32-bit decimal value.
@ k_c6_fwver_dec_radix
Decimal radix.
@ k_c6_fwver_hex_mask
Nibble mask.
@ k_c6_fwver_hex_digits
Digits in the widest 32-bit hex value.
@ k_c6_fwver_text_max
Longest co-processor-supplied string echoed to the console; anything longer is truncated rather than ...
@ k_c6_fwver_hex_bits
Bits per hexadecimal digit.
void c6_fwver_put_text(const uint8_t *text, size_t len)
Emit a length-counted byte range as printable text.
bool c6_fwver_rpc_report(void)
Print the recorded response and decide the run's verdict.
uint32_t c6_fwver_priv_init_version(void)
Report the version the boot INIT event announced, if one arrived.
void c6_fwver_put_u32(uint32_t value)
Emit an unsigned 32-bit value in decimal.
void c6_fwver_puts(const char *text)
Write a NUL-terminated string to the board console.
#define MAX_TRANSPORT_BUFFER_SIZE
Bytes moved in one SDIO block transfer.
esp-hosted port header: full-duplex SPI transport buffer size.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
What one call to c6_fwver_link_pump actually did on the wire.
uint16_t malformed
Frames whose offset or length could not be believed.
uint16_t idle
Filler frames the co-processor returned (len zero).
bool bus_error
A bus transfer did not return RET_OK.
uint16_t transfers
Full-duplex transactions clocked.
bool sink_stopped
The sink asked the pump to stop early.
uint16_t bad_checksum
Frames whose recomputed checksum disagreed.
uint16_t frames
Well-formed payload frames handed to the sink.
uint16_t ifnum_defect
Bad-checksum frames explained by the co-processor's if_num accounting; see the app README.
uint16_t hs_timeouts
Transactions abandoned waiting for HANDSHAKE.
One esp-hosted transaction buffer, addressable either way.
uint8_t bytes[k_c6_fwver_frame_bytes]
The transaction as the transport sees it: flat bytes.
struct esp_payload_header header
The same storage as the protocol sees it: a payload header.