|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
First raw SPI link probe against the ESP32-C6 wireless co-processor. More...
#include <stdint.h>#include "c6_probe.h"#include "ra8_board_ek_ra8d2.h"#include "ra8_boot_entry.h"#include "ra8_cgc.h"#include "ra8_err.h"#include "ra8_isr.h"#include "ra8_mstp.h"#include "ra8_spi.h"#include "ra8_time.h"Go to the source code of this file.
Functions | |
| static void | c6_probe_panic_halt (void) |
| Park forever after a fatal initialisation failure. | |
| static void | c6_probe_clocks_or_halt (void) |
| Bring CGC, MSTP and SysTick up, caching PCLKA. | |
| static void | c6_probe_setup_or_halt (void) |
| Bring clocks, console, LEDs and side-band inputs up. | |
| static void | c6_probe_print_map (const c6_probe_stats_t *st, uint8_t hs_idx, uint8_t dr_idx) |
| Print the resolved DATA_READY / HANDSHAKE side-band map. | |
| static void | c6_probe_print_verdict (const c6_probe_stats_t *st, ra8_spi_mode_t mode, bool link_live) |
| Print the single-line PASS / FAIL verdict. | |
| static void | c6_probe_run (void) |
| Sweep the SPI modes, resolve the side-band map, report the outcome. | |
| void | main (void) |
| Application entry: probe the ESP32-C6 esp-hosted SPI link. | |
Variables | |
| static c6_probe_stats_t | s_c6_stats |
| Accumulated probe evidence for the final verdict and pin map. | |
| static uint32_t | s_c6_pclka_hz |
| Cached PCLKA rate, the SCI baud-clock source. | |
| static const ra8_spi_mode_t | k_c6_mode_order [k_c6_probe_mode_count] |
| SPI modes tried, most likely first. | |
First raw SPI link probe against the ESP32-C6 wireless co-processor.
Stand-alone EK-RA8D2 application that opens the physical esp-hosted SPI full-duplex link to the ESP32-C6 soldered to Pmod1 (J26) and proves it end-to-end: it clocks the fixed-size transport buffer, hand-decodes the esp-hosted payload header out of the received bytes, and prints a PASS/FAIL verdict on the board console.
The app also resolves the two facts that are not recorded anywhere in the tree:
Flow:
Definition in file main.c.
|
static |
Bring CGC, MSTP and SysTick up, caching PCLKA.
Definition at line 133 of file main.c.
References c6_probe_panic_halt(), k_ra8_clock_id_cpuclk0, k_ra8_clock_id_pclka, k_ra8_ok, ra8_cgc_get_clock_hz(), ra8_cgc_init(), ra8_mstp_init(), ra8_time_init(), and s_c6_pclka_hz.
Referenced by c6_probe_setup_or_halt().
|
static |
Park forever after a fatal initialisation failure.
Definition at line 115 of file main.c.
Referenced by c6_probe_clocks_or_halt(), c6_probe_setup_or_halt(), and main().
|
static |
Print the resolved DATA_READY / HANDSHAKE side-band map.
| [in] | st | Accumulated evidence. |
| [in] | hs_idx | Resolved handshake index, or k_c6_sb_count. |
| [in] | dr_idx | Resolved data-ready index, or k_c6_sb_count. |
Definition at line 202 of file main.c.
References c6_probe_put_u32(), c6_probe_puts(), c6_probe_sideband_name(), c6_probe_stats_t::dr_vote, c6_probe_stats_t::ever_high, c6_probe_stats_t::ever_low, c6_probe_stats_t::hs_vote, k_c6_sb_count, c6_probe_stats_t::pull_low, and c6_probe_stats_t::pull_samples.
Referenced by c6_probe_run().
|
static |
Print the single-line PASS / FAIL verdict.
| [in] | st | Accumulated evidence. |
| [in] | mode | Mode that decoded, or the last mode tried. |
| [in] | link_live | Whether any recognisable frame was decoded. |
Definition at line 247 of file main.c.
References c6_probe_stats_t::attempts, c6_probe_stats_t::bad_csum_frames, c6_probe_put_u32(), c6_probe_puts(), c6_probe_stats_t::data_frames, c6_probe_stats_t::idle_frames, and k_c6_probe_sck_hz.
Referenced by c6_probe_run().
|
static |
Sweep the SPI modes, resolve the side-band map, report the outcome.
Ordering is load-bearing: the pull-up contest runs after the sweep so it measures DATA_READY's idle state rather than the boot event the C6 has queued, and c6_probe_resolve_map runs after both so it sees every kind of evidence the run produced.
Definition at line 285 of file main.c.
References c6_probe_best(), c6_probe_print_map(), c6_probe_print_verdict(), c6_probe_pull_contest(), c6_probe_puts(), c6_probe_resolve_map(), c6_probe_sweep_mode(), k_c6_mode_order, k_c6_probe_min_votes, k_c6_probe_mode_count, k_c6_sb_count, k_ra8_board_led2, k_ra8_ok, ra8_board_led_on(), s_c6_pclka_hz, and s_c6_stats.
Referenced by main().
|
static |
Bring clocks, console, LEDs and side-band inputs up.
Deliberately stops short of routing the Pmod1 SPI pins: the wire test and the chip-select hunt run next and need those nets unclaimed so they can drive and release them.
Definition at line 169 of file main.c.
References c6_probe_clocks_or_halt(), c6_probe_panic_halt(), c6_probe_puts(), c6_probe_sideband_init(), k_c6_probe_uart_baud, k_ra8_board_led1, k_ra8_board_led2, k_ra8_ok, ra8_board_led_init(), and ra8_board_uart_console_init().
Referenced by main().
| void main | ( | void | ) |
Application entry: probe the ESP32-C6 esp-hosted SPI link.
The application entry point Reset_Handler hands control to.
Definition at line 325 of file main.c.
References c6_probe_cs_hunt(), c6_probe_panic_halt(), c6_probe_print_sideband(), c6_probe_puts(), c6_probe_run(), c6_probe_sample_sideband(), c6_probe_setup_or_halt(), c6_probe_spi_pins_init(), c6_probe_wire_test(), k_c6_probe_boot_wait_ms, k_c6_probe_idle_ms, k_ra8_board_led1, k_ra8_ok, ra8_board_led_toggle(), ra8_delay_ms(), ra8_isr_globals_enable(), and s_c6_stats.
|
static |
SPI modes tried, most likely first.
The C6 image in coprocessor/esp32c6/ is built with CONFIG_ESP_SPI_MODE=3, so mode 3 leads; the rest are a bring-up fallback reached only if mode 3 decodes nothing.
Definition at line 99 of file main.c.
Referenced by c6_probe_run().
|
static |
Cached PCLKA rate, the SCI baud-clock source.
Read once during bring-up and handed to every SPI mode opened.
Definition at line 86 of file main.c.
Referenced by c6_probe_clocks_or_halt(), and c6_probe_run().
|
static |
Accumulated probe evidence for the final verdict and pin map.
Deliberately not reset between SPI modes: the side-band map is built from the whole run, including the chip-select hunt that precedes any clocking.
Definition at line 76 of file main.c.
Referenced by c6_probe_run(), and main().