In this tutorial, we will see how we can place the RA microcontroller in boot mode. In this mode the built-in boot program stored in dedicated area within the MCU, is used. The code flash and data flash memories, can be modified from outside using either UART interface (SCI Boot Mode) or USB interface (USB Boot Mode).
InstructionsThe board we will use is EK-RA4M1 (Evaluation Kit for RA4M1 MCU Group) from Renesas.
Every RA MCU has a pin called "MD". This pin is P201 pin.
Depending the state of this pin and as soon as RES pin is released, the chip will either run in "Single-Chip Mode" (Normal Mode) or "Boot Mode".
- If the MD pin level is high, the chip after reset will enter Single-Chip Mode.
- If the MD pin level is low, the chip after reset will enter Boot Mode.
To configure this mode on EK-RA4M1 you need to set the boot jumpers properly. So that the level of the MD-P201 pin will be driven low. And as soon as you press the RESET button, the chip will enter boot mode.
The boot jumpers to set MD pin to low-level are shown below:
The jumper J8 should be placed to connect pins 1 and 3.
The RA MCUs that have available USB Full Speed, support also the USB Boot Mode. And the chip can be programmed by using the USB Full Speed port available on the board.
- Connect the first USB A to USB micro cable to Debug USB to power-on the MCU.
- Connect the second USB A to USB micro cable on Device USB (J9) which is the USB Full Speed port.
- The Boot configuration jumper J8 should be placed between pins 1 and 3.
- Press the RESET button on board.
This is it! If the device has been properly configured, it entered Boot Mode.
And in Device Manager you should see an extra COM port like this:
To program the device with your firmware you need to use Renesas Flash Programmer and create a new project.
In communication settings select COM port and make sure the correct COM port number is selected.
As soon as the connection is successful, you should:
- Select the image file you want to program
- Press the on-board RESET button again.
- Press Start button in Renesas Flash Programmer, to program the chip.
And you can see, that the chip was successfully programmed.
To see your firmware running. You need to return in normal mode (Single-chip Mode). To do this, you need to:
- Place the Boot Configuration jumper J8 between pins 1 and 2.
- Press the RESET button to reset the chip.
And you will be able now, to see the firmware running.
Entering SCI Boot Mode:All RA MCUs support the SCI boot mode. In this mode everything is the same with the USB boot mode. Except the connections that will be done of between the MCU and your PC.
You will need a USB to UART converter (e.g. CP2102 used in this tutorial). Which you should connect with the RXD9/TXD9 pins of SCI peripheral, channel 9 (SCI9).
So you should make sure, that these connections are done:
- TX (USB to UART converter) -> RXD9(P110 pin MCU)
- RX (USB to UART converter)->TXD9(P109 pin MCU)
In Device Manager find the COM port number of the USB to UART converter.
To enter SCI boot mode:
- Connect the USB A to USB micro cable to Debug USB, to power-on the MCU.
- The Boot configuration jumper J8 should be placed between pins 1 and 3.
- Press the RESET button on board.
This is it! If the connections and jumper settings have been properly done. The RA4M1 entered the Boot Mode and programming the chip via Renesas Flash Programmer through SCI9 is available.
Using Renesas Flash Programmer:To program the device with your firmware you need to use Renesas Flash Programmer and create a new project.
In communication settings select COM port and make sure the correct COM port number is selected.
As soon as the connection is successful, you should:
- Select the image file you want to program
- Press the on-board RESET button again.
- Press Start button in Renesas Flash Programming, to program the chip.
And you can see that chip was successfully programmed.
To see your firmware running. You need to return in normal mode (Single-chip Mode). To do this you need:
- Place the Boot Configuration jumper J8 between pins 1 and 2.
- Press the RESET button to reset the chip.
And you will be able to see the firmware now running.
"Here’s how you can easily program your RA devices—just put the chip into boot mode, and it will run the built-in boot firmware. No need for any external debugger or programmer tools!"
Comments