Getting Started With Renesas RA Family/FSP - Part 0 Blinky Project

by Panos_V in Circuits > Microcontrollers

1 Views, 0 Favorites, 0 Comments

Getting Started With Renesas RA Family/FSP - Part 0 Blinky Project

Media.PNG

New to RA microcontrollers? Perfect , you've found the right starting point! This guide walks you through the fundamentals of the RA ecosystem combined with the associated FSP development tool flow and gets you hands-on with your first embedded project.

Let's jump straight into building a classic Blinky application - yes, the one that makes an LED blink on and off. If embedded development feels intimidating, relax. I'll break down each step, covering everything from installing your tools to writing the code that actually controls the hardware.

By the end of this tutorial, you'll have a working project and understand the basic workflow for RA development. Ready to get started?

Supplies

While this tutorial works with any Renesas RA microcontroller, we'll be walking through the steps using the Evaluation Kit for RA6M4 as our example.

Installation of Development Tools

Get your development environment ready by downloading and installing e2 studio - that's Renesas' official IDE. Just grab the installer that matches your operating system and you're good to go.

Next, you'll want to install the latest FSP release from the official git repository. This gives you all the latest drivers, templates, and tools to work with your RA microcontroller.

These two components work hand-in-hand to give you everything you need for RA development - think of e2 studio as your coding workspace and FSP as your hardware toolkit!

Fire Up E² Studio and Choose the Workspace Directory

Picture111.png
Screenshot_5.png

Choose a workspace directory — this is just the folder where your project files will live. Once that’s set, you’ll see the Welcome tab. Go ahead and click on “Create a new C/C++ project.” Alternatively, just do what the second image is showing

Pick the Right Template

Screenshot_1.png

E2 Studio offers several project templates. For this intructable choose the Renesas RA C/C++ Project

Give Your Project a Name

Picture2.png

Feel free to get creative here! I’ll be honest, my imagination’s a bit limited... I just went with “blinky.”

Select Your Device and Tool Options

Screenshot_2.png

This dialog is where you tell the tools exactly what you're working with. On the left, you're picking your hardware setup - the EK-RA6M4 evaluation board with its R7FA6M4AF3CFB microcontroller running a Cortex-M33 core. You can also choose between C or C++ for your coding language (we'll stick with C for this tutorial).

The right side shows you the key specs of your chosen board - 144 pins, TrustZone security features, and confirms you're working with that Cortex-M33 processor. Pretty handy to have all this info right here!

At the bottom, you're setting up your development environment - choosing your compiler toolchain (the GNU ARM Embedded tools in this case) and debugger (J-Link ARM for flashing and debugging your code).


Flat Project(for Now)

Screenshot_3.png

Now you're at the project type selection - this is where you decide how to handle the security features of your RA microcontroller.

You'll notice three options here, but for our blinky tutorial, we're keeping things simple! Go ahead and select Flat (Non-TrustZone) Project - that's the top option that's already selected for you. This gives you a straightforward, single project setup where all your code, data, and peripheral configurations live in one place. Perfect for getting started!

The other two options you see - TrustZone Secure Project and TrustZone Non-secure Project - are for more advanced security applications where you split your code into secure and non-secure sections. Pretty powerful stuff, but we'll dive into those TrustZone projects in upcoming tutorials once you've got the basics down.

For now, the flat project approach keeps everything simple and gets you coding faster. No need to worry about security partitions or complex project structures - just pure, straightforward embedded development.

Think of it as learning to walk before you run. Once you're comfortable with the basic RA development flow, we'll explore those advanced security features that make these microcontrollers really shine!

Build Artifact Selection

Screenshot_4.png

This step is all about telling the tools what kind of final product you want to create from your code.

For our blinky project, stick with Executable (already selected) - this creates a complete program file that you can flash directly onto your microcontroller and run. Simple and straightforward!

The other options are for more advanced scenarios. Static Library creates reusable code modules you can share between projects, while "Executable Using an RA Static Library" lets you build a program that uses one of those pre-made library modules.

On the right, you'll see RTOS Selection set to "No RTOS" - perfect for our basic LED blinking project. We don't need the complexity of a real-time operating system just to toggle an LED on and off. Keep it simple for now! On the next parts of this tutorial series, we'll dive deeper into RTOS and show you when and why you'd want to use one.

Think of this as choosing between making a complete meal (executable) versus preparing ingredients for later (static library). For your first project, you definitely want that complete, ready-to-run program that'll get your LED blinking right away.

Ready-Made Blinky Project

Screenshot_6.png

Here's the best part - you won't have to write a single line of code for your first project!

Select Bare Metal - Blinky (already highlighted) and you're getting a complete, working LED blinky project right out of the box. All the clock setup, pin configurations, and LED control code? Already done for you!

The "Bare Metal - Minimal" option below is a bare-bones starting point, but for learning the ropes, the Blinky template is perfect.

That checkbox at the bottom - "Use Renesas Code Formatter" - keeps your code looking clean and professional.


FSP Perspective

Screenshot_7.png

This little dialog is asking if you want to switch to the FSP Configuration perspective - think of it as changing your workspace layout to focus on a specific task.

In e2 studio (which is built on Eclipse), a perspective is basically a customized arrangement of windows, panels, and tools designed for different types of work. It's like having different desk setups - one for writing, one for drawing, one for organizing.

The FSP Configuration perspective gives you all the tools you need to set up your microcontroller's peripherals, pins, clocks, and other hardware settings. Instead of hunting through menus, everything you need for configuration is right at your fingertips in an organized layout.

Go ahead and click "Open Perspective" - this will switch your workspace to show the FSP configuration tools prominently. You can always switch back to other perspectives (like the standard C/C++ development perspective) when you're ready to write or debug code.

The "Remember my decision" checkbox means it won't ask you this question again for future projects. Pretty handy once you get comfortable with the workflow!

Your First Project Dashboard

Screenshot_8.png

Perfect! Now you're looking at the FSP Configuration perspective in all its glory. This is your project's command center where everything comes together.

On the left, you've got your Project Explorer showing all your project files - notice how the Blinky template already created a complete folder structure for you.

The center Summary tab gives you a quick overview of your project setup - confirming you're working with the EK-RA6M4 board, CM33 core, and all the technical specs we selected earlier. Below that, you can see all the software components that came with your Blinky template, including the "Simple application that blinks an LED" - exactly what we want!

On the right is the FSP Visualization panel showing a visual representation of your RA6M4 microcontroller with all its pins. This interactive diagram lets you see and configure pin assignments at a glance.

Notice those tabs at the bottom - Summary, BSP, Clocks, Pins, etc. These are your different configuration areas. Right now you're on Summary, but you can click through these tabs to configure clocks, set up pins, add interrupts, and more.

The best part? Your Blinky project is already configured and ready to build - no tweaking required for your first run!

Let FSP Create Your Code Automatically

Now for the magic moment! Click that "Generate Project Content" button you see in the top-right area of the FSP Configuration window.

When you hit this button, FSP springs into action and automatically generates all the code files your project needs. We're talking about a lot of behind-the-scenes work happening in seconds:

  1. Hardware abstraction layer (HAL) drivers for your specific RA6M4 microcontroller
  2. Board Support Package (BSP) files tailored to your EK-RA6M4 evaluation board
  3. Pin configuration code that sets up all the GPIO pins correctly
  4. Clock initialization routines to get your system running at the right speeds
  5. Startup code that gets your microcontroller ready to run your application
  6. Your actual Blinky application code - the main function that controls the LED

Think of it as having an expert embedded engineer write hundreds of lines of low-level code for you instantly. All those tedious register configurations, pin mappings, and hardware setup routines that would normally take hours to write and debug? Done automatically and guaranteed to work with your hardware.

Once generation completes, you'll see new files appear in your Project Explorer, and you'll be ready to build and run your first RA project! We'll dive deeper into understanding and customizing these generated files in the next tutorials, for now, lets just turn on and off these LEDs.

Time to Compile Everything

Now that FSP has generated all your project files, it's time to build your application! Look for the Build button in the toolbar (it looks like a hammer icon) and give it a click.

When you hit build, the compiler takes all those generated files - your HAL drivers, BSP code, pin configurations, and application logic - and turns them into executable machine code that your RA6M4 can understand and run.

Here's something cool to know: all the action for your Blinky application happens in a function called hal_entry(). While most C programs start with main(), FSP applications use hal_entry() as their starting point after all the hardware initialization is complete. This is where your LED blinking logic lives - the simple loop that turns the LED on, waits a bit, turns it off, and repeats.

You'll see the build progress in the console window at the bottom of your screen. If everything goes well (and it should with the template!), you'll get a successful build message and your project will be ready to flash onto the hardware.

The build process creates the files that contains your complete program, ready to be loaded into your microcontroller's flash memory. We'll explore the hal_entry() function and the build output in more detail in upcoming tutorials!

See Your LEDs Blinking!

Screenshot_9.png
Screenshot_10.png

This is the moment you've been waiting for! Time to get that LED blinking on your actual hardware.

Make sure your EK-RA6M4 evaluation board is connected to your computer via USB, then click the Debug button in the toolbar (looks like a little bug icon). This will launch the debugger and automatically flash your compiled program onto the microcontroller.

The debugger does a few things in sequence:

  1. Connects to your board through the J-Link interface
  2. Erases the old program from flash memory
  3. Programs your new Blinky application into the microcontroller
  4. Starts your program running from the beginning

Here's an important step: once the programming is complete, your program will be paused at the very first line of code, waiting for you to tell it to continue. You'll need to click the Resume button (looks like a play button) in the debug toolbar, or simply press F8 on your keyboard to let your program run freely.

After you hit Resume or F8, your code will start executing from that hal_entry() function we mentioned, and you should see the LEDs on your evaluation board start blinking! If everything worked correctly, you'll have that satisfying moment of watching your first RA program come to life.

The debug perspective also lets you set breakpoints, step through code line by line, and examine variables - perfect for when you want to understand exactly how your program flows. But for now, just enjoy watching that LED blink on and off!

Congratulations - you've just completed your first RA microcontroller project from start to finish! In the next tutorials, we'll dig deeper into the code and show you how to customize and expand on this foundation.

Watch LEDs in Action

And there it is! Watch the Red, Green, and Blue LEDs on your EK-RA6M4 board start cycling through their blinking sequence.

That's your first RA project running successfully on real hardware! You've just walked through the complete development workflow from project setup to flashing and running code.

Stay tuned for the next tutorial where we'll dive into the actual code and show you how to fully utilize the capabilities of the Renesas RA MCUs!