|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
UART "hello world" HIL test for EK-RA8D2 (SCI8 @ 115200). More...
#include <stdint.h>#include "ra8_attributes.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_time.h"Go to the source code of this file.
Enumerations | |
| enum | uart_hello_config_t : uint32_t { k_uart_hello_baud = 115200U , k_uart_hello_period_ms = 1000U } |
| Compile-time settings for the demo. More... | |
Functions | |
| static void | internal_uart_hello_panic_halt (void) |
| Halt forever in WFI – used as a panic stop on init failure. | |
| static void | internal_uart_hello_setup_or_halt (void) |
| Bring CGC + SysTick + SCI8 + LED1 up. | |
| void | main (void) |
| Application entry. | |
Variables | |
| static const uint8_t | s_uart_hello_greeting [] = "hello, ra8d2!\r\n" |
| Greeting string sent every period. | |
UART "hello world" HIL test for EK-RA8D2 (SCI8 @ 115200).
Brings the chip up via ra8_cgc_init() (XTAL -> PLL1 -> CPUCLK0 = 1 GHz, PCLKA = 125 MHz, SCICLK = PLL1R / 4 = 100 MHz), brings up the SCI8 J-Link OB console (TXD8 = PD_02 / RXD8 = PD_03 in async mode at 115200 8N1) through the board-support-package console API, and prints "hello, ra8d2!\r\n" once a second while toggling LED1 as a heartbeat. The CDC channel of the on-board J-Link OB on the EK-RA8D2 surfaces these pins as a virtual serial port on the host; connecting any terminal at 115200 8N1 to that port shows the stream.
Sequence:
Verification: open the J-Link OB CDC port at 115200 8N1, e.g. picocom -b 115200 /dev/cu.usbmodem... on macOS or minicom -D /dev/ttyACM0 -b 115200 on Linux. You should see one greeting line per second with LED1 toggling in lock-step.
Definition in file main.c.
| enum uart_hello_config_t : uint32_t |
|
static |
Halt forever in WFI – used as a panic stop on init failure.
Preserves the failed boot state in a low-activity loop that remains accessible to an attached debugger.
Definition at line 85 of file main.c.
References RA8_INTERNAL.
Referenced by internal_uart_hello_setup_or_halt(), and main().
|
static |
Bring CGC + SysTick + SCI8 + LED1 up.
Panic-halts on any fail.
The SCI8 J-Link OB console (TXD8 = PD_02 / RXD8 = PD_03 @ 115200 8N1) is brought up through the board-support-package console API, which owns the PFS pin routing, the BRR calculation against PCLKA, and the SCI8 init. That keeps the demo correct when the CGC driver is retargeted to a different clock tree.
Definition at line 112 of file main.c.
References internal_uart_hello_panic_halt(), k_ra8_board_led1, k_ra8_clock_id_cpuclk0, k_ra8_ok, k_uart_hello_baud, ra8_board_led_init(), ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), RA8_INTERNAL, and ra8_time_init().
Referenced by main().
| void main | ( | void | ) |
Application entry.
The application entry point Reset_Handler hands control to.
Brings up CGC + SCI8 + LED1 then prints.
Definition at line 144 of file main.c.
References internal_uart_hello_panic_halt(), internal_uart_hello_setup_or_halt(), k_ra8_board_led1, k_ra8_ok, k_uart_hello_period_ms, ra8_board_led_toggle(), ra8_board_uart_console_write(), ra8_delay_ms(), ra8_isr_globals_enable(), and s_uart_hello_greeting.