Industry White Paper
Send and Receive Serial Data: Configuring SCI UART on the FPB-RA8E1
Learn how to send and receive serial data on the Renesas FPB-RA8E1, configure the SCI UART stack and pins in e² studio, and verify it with a terminal.
Bringing up a new microcontroller board without a working serial link leaves you debugging in the dark. Whether you need to stream sensor telemetry to a PC, accept command strings from a host processor, or print status messages during board bring-up, Universal Asynchronous Receiver/Transmitter (UART) communication is typically the first peripheral interface you configure. However, on high-speed Arm Cortex-M85 microcontrollers with multiplexed pin headers and independent peripheral clock trees, getting those first bytes across the wire requires aligning the peripheral clock, GPIO port modes, interrupt callback logic, and terminal framing.
This article demonstrates how to configure and execute bidirectional UART communication on the Renesas FPB-RA8E1 Fast Prototyping Board. Using the e² studio IDE and Flexible Software Package (FSP), you will enable the Serial Communications Interface (SCI) clock source, map SCI3 transmit and receive signals to the onboard Arduino Uno R3 header pins, implement an interrupt-driven UART callback, and verify 15-byte serial transfers using the Termite terminal utility and the e² studio real-time Expressions view.
Project Specs
| Target Board | FPB-RA8E1 |
| MCU Family | Renesas RA8 Series (R7FA8E1AFDCFB) |
| Peripheral Covered | Serial Communications Interface B UART (r_sci_b_uart) |
| IDE / Toolchain | e² studio + LLVM Embedded Toolchain for Arm (21.1.1) |
| FSP Version | 6.3.0 |
| Interface Used | SCI3 on Arduino interface header (P309 / RXD3, P310 / TXD3) via USB-to-UART (COM10) |
| Baud Rate | 115200 bps (8 bits, None parity, 1 bit stop) |
| Skill Level | Beginner / Intermediate |
| Build Time | 20 minutes |
| Prerequisites | e² studio installed, Termite (3.4) or serial terminal installed, USB-to-UART adapter connected |
Why Does Interrupt-Driven UART Matter on the FPB-RA8E1?
Polling a serial status register inside a tight loop to check if a byte has arrived wastes processing power that a 360 MHz Arm Cortex-M85 microcontroller like the Renesas RA8E1 could spend on Helium M-Profile Vector Extension (MVE) digital signal processing or machine learning inference. At a standard baud rate of 115200 bps, transmitting a single 10-bit frame takes roughly 86.8 microseconds, which corresponds to more than 31,000 CPU clock cycles on the RA8E1. Blocking the processor across a 15-byte message would stall application execution for nearly half a million cycles.
The Renesas RA family eliminates this bottleneck through the r_sci_b_uart Hardware Abstraction Layer (HAL) driver in the FSP. Instead of polling for each character, your application passes a buffer pointer and byte count to R_SCI_B_UART_Read or R_SCI_B_UART_Write. The SCI peripheral shifts bits in and out in hardware and fires dedicated receive and transmit-complete interrupts when the full transfer finishes, invoking your user callback function to set a completion flag.
What You’ll Need
Hardware
- Renesas FPB-RA8E1 Fast Prototyping Board
- USB cable for the onboard J-Link debugger connection
- USB-to-UART serial converter wired to Arduino interface header J2 (D0 / P309 and D1 / P310)
Software
- e² studio IDE
- Flexible Software Package (FSP) (6.3.0)
- Serial terminal application (Termite 3.4 by CompuPhase, Tera Term, or PuTTY)
- FPB-RA8E1 Quick Start Guide [PDF]
- FPB-RA8E1 v1 User’s Manual [PDF]
- RA8E1 Group Datasheet [PDF]
The Concept in 60 Seconds
UART is an asynchronous, two-wire serial protocol where one line transmits data (TXD) and a second line receives data (RXD). Because there is no shared clock wire between the FPB-RA8E1 and your host computer, both endpoints must be configured in advance with identical framing parameters: 115200 baud rate, 8 data bits, None parity, and 1 stop bit (8N1).
On the RA8E1 microcontroller, UART functionality is provided by the Serial Communications Interface B (SCI_B) peripheral. Bringing up an SCI_B channel on the FPB-RA8E1 involves three hardware-level details that often catch developers off guard:
- Dedicated Peripheral Clock (SCICLK): The SCI peripheral clock is disabled by default in a minimal project and must be connected to an active oscillator such as the High-Speed On-Chip Oscillator (HOCO) on the FSP Clocks tab.
- Pin Multiplexing Conflicts: On the FPB-RA8E1, Arduino header pins D0 (P309) and D1 (P310) default to GPIO Input mode in the board support package. You must disable GPIO mode on P309 and P310 so SCI3 can claim them as RXD3 and TXD3.
- Asynchronous Callback Flags: Because R_SCI_B_UART_Read and R_SCI_B_UART_Write are non-blocking APIs, your code coordinates transfer completion through volatile status flags (g_receive_complete and g_transfer_complete) updated inside UART_callback.
Step-by-Step: Building the UART Project
Step 1: Create a Minimal Bare-Metal Project in e² studio
- Open e² studio and click File > New > Renesas C/C++ Project > Renesas RA.
- In the Renesas RA C/C++ Project (Project Name and Location) dialog, enter Uart_example_FPB_RA8E1 into the Project name field and click Next >.
- In the Device and Tools Selection dialog (Figure 1), confirm FSP Version is set to 6.3.0 and select FPB-RA8E1 from the Board drop-down menu, which automatically selects the R7FA8E1AFDCFB device and CM85 core. Verify that C is selected as the language, LLVM Embedded Toolchain for Arm (21.1.1) is chosen as the toolchain, and J-Link ARM is set as the debugger, then click Next >.

Figure 1. The Device and Tools Selection dialog with FSP 6.3.0 and the FPB-RA8E1 board selected, which populates the R7FA8E1AFDCFB device and CM85 core. Image used courtesy of Renesas
- Select Flat (Non-TrustZone) Project and click Next >. Choose None for the SmartBundle setting and click Next >. Select Executable and No RTOS, click Next >, select the Bare Metal - Minimal template, and click Finish. Click Open Perspective when prompted to open the FSP Configuration perspective.
Starting from the Bare Metal - Minimal template initializes the core board support package without adding unused middleware threads.
Step 2: Add the UART Stack and Enable the SCI Clock Source
- In the FSP Configuration editor (configuration.xml), open the Stacks tab and click New Stack > Connectivity > UART (r_sci_b_uart).
- Hover your cursor over the newly added g_uart0 UART (r_sci_b_uart) block to read the red error tooltip (Figure 2): Error: Requires SCISPICLK/SCICLK to be enabled on the Clocks tab.

Figure 2. The error tooltip on the newly added g_uart0 UART (r_sci_b_uart) stack, reporting that SCISPICLK/SCICLK is not yet enabled. Image used courtesy of Renesas
- Switch to the Clocks tab, scroll down to locate SCICLK Disabled, click its drop-down menu, and select SCICLK Src: HOCO, which configures SCICLK 5 MHz (Figure 3).

Figure 3. The Clocks tab with SCICLK Src set to HOCO, producing the 5 MHz SCICLK that feeds the baud-rate generator. Image used courtesy of Renesas
Enabling SCICLK from HOCO supplies the baud-rate generator inside the SCI peripheral with a stable 5 MHz reference clock, clearing the stack error indicator.
Step 3: Configure the UART Stack Properties and Callback
- Return to the Stacks tab, click g_uart0 UART (r_sci_b_uart), and open the Properties window.
- Expand Module g_uart0 UART (r_sci_b_uart) > General and review the default framing settings (Name: g_uart0, Channel: 0, Data Bits: 8bits, Parity: None, Stop Bits: 1bit).
- Expand the Baud section and keep the default Baud Rate of 115200 (with Baud Rate Modulation set to Disabled and Max Error (%) set to 5).
- Expand the Interrupts section and change Callback from NULL to UART_callback, leaving the four interrupt priorities at Priority 12 (Figure 4).

Figure 4. The g_uart0 UART (r_sci_b_uart) properties with Callback changed from NULL to UART_callback. Image used courtesy of Renesas
Defining UART_callback instructs the FSP to generate the interrupt service routine hooks needed to capture incoming characters and flag completed transfers.
Step 4: Map SCI3 to the Arduino Header Pins and Resolve GPIO Conflicts
- Open the FPB-RA8E1 Quick Start Guide [PDF] (R20QS0073EG0101) and check its Figure 2. FPB-RA8E1 Arduino Interface in Section 5. Arduino Interface. Confirm that Arduino header pins D0 and D1 route to P309 (RXD3) and P310 (TXD3) on SCI channel 3 (Figure 5).

Figure 5. Figure 2 of the FPB-RA8E1 Quick Start Guide, showing the Arduino Uno R3 interface pin assignments. Image used courtesy of Renesas
- In e² studio, switch to the Pins tab, scroll down the Pin Selection tree under Peripherals, expand Connectivity:SCI, and select SCI3.
- In the Pin Configuration pane, set Operation Mode to Asynchronous UART, assign RXD3 to P309, and assign TXD3 to P310 (Figure 6).

Figure 6. The SCI3 pin configuration with Operation Mode set to Asynchronous UART and RXD3 and TXD3 assigned to P309 and P310. Image used courtesy of Renesas
- To resolve the red pin-conflict indicators that appear, scroll up the Pin Selection tree to Ports > P3 and expand P3. Select P309 (Symbolic Name: Arduino_D0) and change its Mode from Input mode to Disabled. Next, select P310 (Symbolic Name: Arduino_D1) and change its Mode from Input mode to Disabled, which transitions P309 and P310 into Peripheral mode (SCI3_RXD3 and SCI3_TXD3) and clears the pin errors (Figure 7).

Figure 7. P310 after the mode change, now reporting Peripheral mode with the SCI3_TXD3 function assigned. Image used courtesy of Renesas
- Return to the Stacks tab, select g_uart0 UART (r_sci_b_uart), and under Properties > General, change Channel from 0 to 3. Verify that RXD3 (P309) and TXD3 (P310) replace under the stack’s Pins section (Figure 8), then click Generate Project Content and click Proceed.

Figure 8. The g_uart0 stack after Channel is changed to 3, with RXD3 and TXD3 resolved to P309 and P310. Image used courtesy of Renesas
Disabling the default GPIO input mode on P309 and P310 releases the physical pads so the SCI3 peripheral can control them without a port contention error.
Step 5: Define Buffers, Volatile Flags, and the UART Callback
- On the g_uart0 UART (r_sci_b_uart) stack block, click the blue information icon (i) to open the RA Flexible Software Package Documentation (UART (r_sci_b_uart)) and scroll down to the SCI UART Example section.
- In e² studio, expand the src folder in Project Explorer and open hal_entry.c. Define the 15-byte transfer macro and copy the buffer and status flag declarations from the FSP documentation example below #include "hal_data.h":
#define TRANSFER_LENGTH 15
uint8_t g_dest[TRANSFER_LENGTH];
uint8_t g_src[TRANSFER_LENGTH];
uint8_t g_out_of_band_received[TRANSFER_LENGTH];
volatile uint32_t g_transfer_complete = 0;
volatile uint32_t g_receive_complete = 0;
uint32_t g_out_of_band_index = 0; - Expand Developer Assistance > HAL/Common > g_uart0 UART (r_sci_b_uart) and drag Callback function definition into hal_entry.c above void hal_entry(void). Copy the switch (p_args->event) implementation from user_uart_callback in the FSP documentation and paste it inside void UART_callback(uart_callback_args_t *p_args) to handle UART_EVENT_RX_CHAR, UART_EVENT_RX_COMPLETE (which sets g_receive_complete = 1;), and UART_EVENT_TX_COMPLETE (which sets g_transfer_complete = 1;).
- Ensure the volatile qualifier is added to both g_transfer_complete and g_receive_complete (lines 8 and 9 of hal_entry.c).
Adding the volatile keyword to g_transfer_complete and g_receive_complete prevents the compiler from optimizing away the while loops that wait for the interrupt callback to update those flags.
Step 6: Implement the UART Read and Write Sequence in hal_entry()
- Inside void hal_entry(void), drag Call R_SCI_B_UART_Open() from Developer Assistance into hal_entry(), declare the error status variable fsp_err_t status; above it, and verify the call status = R_SCI_B_UART_Open(&g_uart0_ctrl, &g_uart0_cfg); with assert(FSP_SUCCESS == status);.
- Drag Call R_SCI_B_UART_Read() into hal_entry(), pass g_dest as the second argument and TRANSFER_LENGTH as the third argument (status = R_SCI_B_UART_Read(&g_uart0_ctrl, g_dest, TRANSFER_LENGTH);), and add assert(FSP_SUCCESS == status);.
- Add a polling loop while (!g_receive_complete) { } to wait until 15 bytes have been received into g_dest.
- Drag Call R_SCI_B_UART_Write() below the while (!g_receive_complete) loop, replace its buffer and length arguments with g_src and TRANSFER_LENGTH (status = R_SCI_B_UART_Write(&g_uart0_ctrl, g_src, TRANSFER_LENGTH);), and add assert(FSP_SUCCESS == status);.
- Copy the buffer initialization for loop from the FSP documentation and insert it directly above R_SCI_B_UART_Write to fill g_src with the first 15 uppercase alphabet characters ('A' through 'O'):
for (uint32_t i = 0; i < TRANSFER_LENGTH; i++) { g_src[i] = (uint8_t) ('A' + (i % 26)); } - Below the assert(FSP_SUCCESS == status); statement following R_SCI_B_UART_Write, add while (!g_transfer_complete) { } to wait until transmission completes (Figure 9).

Figure 9. The completed hal_entry.c, with the read, the g_src initialization loop, and the write framed by the two completion-flag loops. Image used courtesy of Renesas
Calling R_SCI_B_UART_Read first arms the receiver to capture TRANSFER_LENGTH (15) bytes from the terminal before the board responds by transmitting the 15-byte g_src alphabet string.
Step 7: Build, Debug, and Verify Serial Communication
- Click Uart_example_FPB_RA8E1 in Project Explorer and click the hammer icon to build the project.
- Right-click Uart_example_FPB_RA8E1, select Debug As > Renesas GDB Hardware Debugging, and click Switch to open the Debug perspective.
- Switch to the hal_entry.c tab, highlight g_dest, and add g_dest to the Expressions window to monitor the incoming receive buffer (as opposed to the transmit buffer g_src). Expand g_dest (g_dest[0] through g_dest[14]), select the entries, right-click, and select Enable Real-time Refresh.
- Open Termite 3.4, click the top connection bar if disconnected, then click Settings. Select your USB-to-UART COM port (COM10), set Baud rate to 115200 (Data bits: 8, Stop bits: 1, Parity: none, Flow control: none, Transmitted text: Append LF), and click OK.
- In e² studio, click the Resume icon twice (first pausing at hal_entry() in main.c, and second starting continuous execution). In Termite, type 012345678912345 (15 bytes) into the bottom transmit bar and send it.
Code Snippet
fsp_err_t status;
status = R_SCI_B_UART_Open(&g_uart0_ctrl, &g_uart0_cfg);
assert(FSP_SUCCESS == status);
// Receive 15 bytes into g_dest and wait for UART_EVENT_RX_COMPLETE
status = R_SCI_B_UART_Read(&g_uart0_ctrl, g_dest, TRANSFER_LENGTH);
assert(FSP_SUCCESS == status);
while (!g_receive_complete) { }
// Populate g_src with 'A'..'O' and transmit 15 bytes back to the terminal
for (uint32_t i = 0; i < TRANSFER_LENGTH; i++) {
g_src[i] = (uint8_t) ('A' + (i % 26));
}
status = R_SCI_B_UART_Write(&g_uart0_ctrl, g_src, TRANSFER_LENGTH);
assert(FSP_SUCCESS == status);
while (!g_transfer_complete) { }
What You Should See
Once you send the 15-character string 012345678912345 from Termite (COM10 115200 bps, 8N1, no handshake), UART_EVENT_RX_COMPLETE fires on the 15th byte and the FPB-RA8E1 immediately transmits ABCDEFGHIJKLMNO back to the terminal window. Simultaneously, in the e² studio Expressions view, g_dest[0] through g_dest[14] update in real time to display the received ASCII values (48 '0' through 57 '9', followed by 49 '1' through 53 '5'), as shown in Figures 10 and 11.

Figure 10. Termite showing the 15 characters sent to the board and the ABCDEFGHIJKLMNO string returned by the FPB-RA8E1. Image used courtesy of Renesas
![The Expressions view with g_dest[0] through g_dest[14] holding the received ASCII values.](https://www.allaboutcircuits.com/uploads/articles/sci-uart-fpb-ra8e1-fig11.png)
Figure 11. The Expressions view with g_dest[0] through g_dest[14] holding the received ASCII values. Image used courtesy of Renesas
Troubleshooting
The g_uart0 UART (r_sci_b_uart) stack shows a red clock error when added
The SCI peripheral clock is disabled by default. Open the Clocks tab in the FSP Configuration editor, scroll down to SCICLK Disabled, and select an active clock source such as SCICLK Src: HOCO.
Red pin-configuration errors appear after assigning P309 and P310 to SCI3
Pins P309 (Arduino_D0) and P310 (Arduino_D1) are pre-assigned to GPIO Input mode in the board template. In the Pins tab under Ports > P3, select P309 and P310 individually and set their Mode to Disabled so SCI3 can use them in Peripheral mode.
The board never responds after sending characters in the terminal
The R_SCI_B_UART_Read call waits for TRANSFER_LENGTH (15) bytes before triggering UART_EVENT_RX_COMPLETE. Ensure you send at least 15 characters (with Transmitted text set to Append nothing if you want an exact 15-byte match) and verify that g_receive_complete and g_transfer_complete are declared as volatile uint32_t.
Characters in the terminal are garbled or missing
Verify that the baud rate in your terminal program matches the 115200 baud rate configured in the FSP g_uart0 stack properties, and confirm that Channel is set to 3 to match SCI3 on P309 and P310.
Where to Take It Next
Because this introductory example executes a single 15-byte read-and-write transaction without an enclosing while(1) loop, a natural first enhancement is wrapping the R_SCI_B_UART_Read and R_SCI_B_UART_Write sequence inside a while(1) loop and resetting g_receive_complete = 0; and g_transfer_complete = 0; after each pass for continuous command processing. You can also click Add DTC Driver for Transmission directly inside the g_uart0 UART (r_sci_b_uart) stack block in e² studio to offload multi-byte transmit transfers to the Data Transfer Controller (DTC).
Frequently Asked Questions
Which pins on the FPB-RA8E1 are used for Arduino UART communication?
On the FPB-RA8E1 Arduino Uno R3 interface (J2), D0 connects to P309 (RXD3) and D1 connects to P310 (TXD3), which map to Serial Communications Interface channel 3 (SCI3).
Why must g_receive_complete and g_transfer_complete be declared as volatile?
Both variables are modified asynchronously inside the UART_callback interrupt service routine while hal_entry() polls them in empty while loops. Without volatile, the compiler can cache their initial 0 value in a CPU register, causing the program to hang in an infinite loop even after the interrupt fires.
What is the difference between UART_EVENT_RX_CHAR and UART_EVENT_RX_COMPLETE in the FSP UART callback?
UART_EVENT_RX_CHAR fires when an unsolicited (“out-of-band”) byte arrives outside of an active R_SCI_B_UART_Read transfer, whereas UART_EVENT_RX_COMPLETE fires once the exact number of bytes requested in R_SCI_B_UART_Read (TRANSFER_LENGTH) has been written into your destination buffer (g_dest).
Related Resources
- FPB-RA8E1 Fast Prototyping Board Product Page
- RA8E1 Microcontroller Group Product Page
- FPB-RA8E1 Quick Start Guide [PDF]
- FPB-RA8E1 v1 User’s Manual [PDF]
- RA8E1 Group User’s Manual: Hardware [PDF]
- RA8E1 Group Datasheet [PDF]
- FSP Documentation
- Renesas RA Family Overview