summaryrefslogtreecommitdiffstatshomepage
path: root/docs/renesas-ra/tutorial/intro.rst
blob: 6003e715755386b620cbf73f924bde1fd88ee1c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.. _renesas-ra_intro:

Getting started with MicroPython on the Renesas RA
==================================================

This tutorial will guide you through setting up MicroPython,
getting a prompt, using the hardware peripherals, using internal
flash file system, reset and boot modes, and Factory reset the
internal file system.

Requirements
------------

You need a board. For the information of available boards,
please refer to the general information about Renesas RA port: :ref:`renesas-ra_general`.

You need a USB-Serial conversion cable to connect the board and your PC.
Please get a type with separate signal pins so that you can connect to
the UART TX and RX pins on the board.

Flashing the MicroPython image with J-Link OB
---------------------------------------------

The board has a builtin programmer interface called J-Link OB.
Using the J-Link Software, you can flash the binary image "firmware.hex"
of MicroPython on the board via J-Link OB.

You can download the J-Link Software and Documentation pack from https://www.segger.com/downloads/jlink/.

After installing J-Link Software, start J-Flash-Lite program.  Then specify following device in Device select menu in J-Flash-Lite.

===============  ================
    Board             Device
---------------  ----------------
 EK-RA4M1           R7FA4M1AB
 EK-RA4W1         R7FA4W1AD2CNG
 EK-RA6M1           R7FA6M1AD
 EK-RA6M2           R7FA6M2AF
 RA4M1 CLICKER      R7FA4M1AB
===============  ================

Select a firmware hex file in Data File of J-Link-Lite, and push Program Device button to flash the firmware.

Getting a prompt of MicroPython
-------------------------------

Cross connect USB-Serial conversion cable RX/TX/GND pins to TX/RX/GND pins on the board.

===============  ===============  ===============
     Board        USB Serial RX    USB Serial TX
---------------  ---------------  ---------------
 EK-RA4M1             P411             P410
 EK-RA4W1             P205             P206
 EK-RA6M1             P411             P410
 EK-RA6M2             P411             P410
 RA4M1 CLICKER        P401             P402
===============  ===============  ===============

Access the MicroPython REPL (the Python prompt) via USB serial or UART with 115200 baud rate, 1 stop bit and no parity bit using your favorite terminal software, picocom on Linux or Tera Term on Windows.  You can try on Linux::

      $ picocom /dev/ttyACM0

You can see the MicroPython REPL prompt like below::

   MicroPython v1.20.0 on 2023-04-27; EK-RA6M2 with RA6M2
   Type "help()" for more information.
   >>>