65typedef enum : uint16_t {
72typedef enum : uint8_t {
79typedef enum : uint32_t {
86typedef enum : uint16_t {
93typedef enum : uint8_t {
101typedef enum : uint8_t {
111typedef enum : uint16_t {
119#ifndef RA8_OFF_TARGET
175 return (
char)(
'0' + (char)n);
198 for (uint8_t i = 0U; i < len; i++) {
199 const uint8_t b = in[i];
228 while (s[len] !=
'\0') {
317 (void)first_unused_memory;
327 __asm__
volatile(
"wfi");
343 __asm__
volatile(
"wfi");
374 __asm__
volatile(
"wfi");
379 __asm__
volatile(
"wfi");
384 __asm__
volatile(
"wfi");
387#ifndef RA8_OFF_TARGET
390 __asm__
volatile(
"wfi");
398 __asm__
volatile(
"wfi");
void main(void)
Secure fallback main entry point.
void tx_application_define(void *first_unused_memory)
ThreadX system-define hook: build worker thread + byte pool.
sdcard_priority_t
Thread priority for the SD card thread.
@ k_sdcard_thread_priority
Sdcard thread priority.
static void internal_sdcard_one_pass(void)
Read sector 0 into s_sdcard_block and log status / hex dump.
sdcard_stack_t
Stack size, in bytes, for the SD card thread.
@ k_sdcard_thread_stack_bytes
Sdcard thread stack bytes.
static void internal_sdcard_thread_entry(ULONG thread_input)
Thread entry: init the card once, then loop reading sector 0.
sdcard_period_t
Loop period in ThreadX ticks (port/threadx/inc/tx_user.h pins to 1 ms).
@ k_sdcard_loop_ticks
Sdcard loop ticks.
void _tx_timer_interrupt(void)
static void internal_sdcard_hex_dump(const uint8_t *in, uint8_t len, char *out)
Format len bytes from in into "XX XX ..." ASCII.
sdcard_block_size_t
SD logical block size (512 bytes for SDHC/SDXC).
@ k_sdcard_block_bytes
Sdcard block bytes.
sdcard_hex_t
ASCII-hex formatting constants.
@ k_sdcard_hex_nibble_mask
Low-nibble mask.
@ k_sdcard_hex_alpha_threshold
10..15 -> 'A'..'F'.
@ k_sdcard_hex_nibble_shift
High-nibble right-shift.
@ k_sdcard_hex_chars_per_byte
"XX " incl.
static uint8_t s_sdcard_block[k_sdcard_block_bytes]
Block buffer for one SD sector.
static TX_THREAD s_sdcard_thread
Thread control block.
void SysTick_Handler(void)
SysTick exception handler – tail-calls the ThreadX timer.
static void internal_sdcard_log(const char *s)
Push a NUL-terminated ASCII string out the J-Link OB VCOM.
static char internal_sdcard_nibble_to_hex(uint8_t nibble)
Convert a single nibble to its ASCII hex character.
sdcard_baud_t
Console baud (115200 8N1).
@ k_sdcard_console_baud
Sdcard console baud.
sdcard_layout_t
SDHI pin layout constants.
@ k_sdcard_sdhi_instance
SDHI instance index.
@ k_sdcard_dump_bytes
Bytes from sector 0 to print.
static uint8_t s_sdcard_stack[k_sdcard_thread_stack_bytes]
Stack for the SD card thread (32-bit aligned per ARMv8-M AAPCS).
static CHAR s_thread_name[]
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.
ra8_err_t ra8_board_led_toggle(ra8_board_led_id_t led)
Toggle led's output state.
ra8_err_t ra8_board_sdhi_pins_init(void)
Route the eight SDHI0 bus pins to the SDHI peripheral function.
ra8_err_t ra8_board_led_init(ra8_board_led_id_t led)
Configure led as a digital output, initial level low (off).
@ k_ra8_board_led1
LED1, BLUE, P600 (jumper E27).
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.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Error Code Definitions for ra8-firmware.
@ 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.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
SD card driver layered on top of the RA8D2 SDHI peripheral.
ra8_err_t ra8_sdcard_init(const ra8_sdcard_cfg_t *cfg)
Bring up the SDHI block and perform full SD card initialization.
ra8_err_t ra8_sdcard_read_blocks(uint32_t lba, uint8_t *buf, uint32_t count)
Read count 512-byte blocks starting at lba.
RA8 <-> Eclipse ThreadX glue: SysTick kernel-tick retuning.
ra8_err_t ra8_threadx_systick_retune(void)
Reprogram SysTick.LOAD from the live CPUCLK0 rate.
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.
User-supplied configuration for ra8_sdcard_init.