Use DAP in e2studio for development and debugging (based on DShanMCU-RA6M5 development board)
百问网瑞萨MCU文档教程在线学习
: http://renesas-docs.100ask.net
Table of contents
Article directory
1. Document preparation
All information used in this document is obtained from the page: http://download.100ask.net/boards/Renesas/DShanMCU-RA6M5/index.html
2. Hardware preparation
We will use the following development kits:
name | quantity |
---|---|
DShanMCU-RA6M5 development board | 1 |
USB Type-C data cable | 1 |
DShanMCU-RA6M5 development board purchase link: https://item.taobao.com/item.htm?id=728461040949
2.1 Hardware Wiring
Connect the USB Type-C data cable to the Type-C interface printed with silk screen on the DShanMCU-RA6M5 development board , and then connect the other end of the USB Type-C data cable to the USB port of the computer. As shown below:Debug
百问网瑞萨MCU文档教程在线学习
: http://renesas-docs.100ask.net
3. Install Python
The package we provide already contains the Python installation package, just open and install it directly. If you want to get it from the Python official website or get an updated version, the address is: https://www.python.org/downloads
It is recommended to use the installation package that matches the course, so as to avoid some unknown problems.
Open 6_使用软件/PYOCD/
the python installation package located in the directory, and double-click on the 64-bit system python-3.11.4-amd64-Recommended.exe
to install it. If it prompts that it cannot be installed, use it python-3.11.4-32bit.exe
. As shown below:
The installation steps are as follows:
- First click to check Add python.exe to PATH * and then click Customize installation :
- These options are checked by default, if not checked, please check them as shown in the picture:
- Select Install Python 3.11 for all users :
- The installation is complete, click Close to complete and exit the installation:
4. Install PYOCD
After installing python, press the win+r key on the keyboard, a small window will pop up in the lower left corner of the screen, enter in the input box cmd
and press the Enter key:
Click to run python according to the above figure, and you will get the window shown in the figure below:
Click to select the window, enter/copy and paste python -m pip install -U pyocd
and press Enter, and wait patiently for the installation to complete, as shown in the following figure:
If an error is prompted, it is usually caused by network problems, because the relevant resources need to be pulled from abroad, so this requires multiple attempts and waiting patiently:
Generally, the timed out error is caused by the problem of accessing foreign servers. At this time, we continue to run python -m pip install -U pyocd
and try a few more times:
It may only be needed once, or it may need to be tried several times. Generally, after an error is prompted, try again 2-3 times to complete successfully. The success interface is shown in the following figure:
The complete installation process, screenshot:
Complete installation process, text:
C:\Users\biubiu>python -m pip install -U pyocd
Defaulting to user installation because normal site-packages is not writeable
Collecting pyocd
Downloading pyocd-0.35.1-py3-none-any.whl (13.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.7/13.7 MB 24.6 kB/s eta 0:00:00
Collecting capstone<5.0,>=4.0 (from pyocd)
Downloading capstone-4.0.2-py2.py3-none-win_amd64.whl (896 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 896.4/896.4 kB 24.6 kB/s eta 0:00:00
Collecting cmsis-pack-manager<1.0,>=0.5.2 (from pyocd)
Downloading cmsis_pack_manager-0.5.2-py3-none-win_amd64.whl (2.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.7/2.7 MB 19.0 kB/s eta 0:00:00
Collecting colorama<1.0 (from pyocd)
Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting importlib-metadata>=3.6 (from pyocd)
Downloading importlib_metadata-6.8.0-py3-none-any.whl (22 kB)
Collecting importlib-resources (from pyocd)
Downloading importlib_resources-6.0.0-py3-none-any.whl (31 kB)
Collecting intelhex<3.0,>=2.0 (from pyocd)
Downloading intelhex-2.3.0-py2.py3-none-any.whl (50 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.9/50.9 kB 26.8 kB/s eta 0:00:00
Collecting intervaltree<4.0,>=3.0.2 (from pyocd)
Downloading intervaltree-3.1.0.tar.gz (32 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting lark<2.0,>=1.1.5 (from pyocd)
Downloading lark-1.1.7-py3-none-any.whl (108 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 108.9/108.9 kB 28.8 kB/s eta 0:00:00
Collecting libusb-package<2.0,>=1.0 (from pyocd)
Downloading libusb_package-1.0.26.2-cp311-cp311-win_amd64.whl (90 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.4/90.4 kB 19.2 kB/s eta 0:00:00
Collecting natsort<9.0,>=8.0.0 (from pyocd)
Downloading natsort-8.4.0-py3-none-any.whl (38 kB)
Collecting prettytable<4.0,>=2.0 (from pyocd)
Downloading prettytable-3.8.0-py3-none-any.whl (27 kB)
Collecting pyelftools<1.0 (from pyocd)
Downloading pyelftools-0.29-py2.py3-none-any.whl (174 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 174.3/174.3 kB 25.2 kB/s eta 0:00:00
Collecting pylink-square<2.0,>=1.0 (from pyocd)
Downloading pylink_square-1.2.0-py2.py3-none-any.whl (82 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.4/82.4 kB 25.5 kB/s eta 0:00:00
Collecting pyusb<2.0,>=1.2.1 (from pyocd)
Downloading pyusb-1.2.1-py3-none-any.whl (58 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.4/58.4 kB 19.0 kB/s eta 0:00:00
Collecting pyyaml<7.0,>=6.0 (from pyocd)
Downloading PyYAML-6.0.1-cp311-cp311-win_amd64.whl (144 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 144.7/144.7 kB 19.0 kB/s eta 0:00:00
Collecting six<2.0,>=1.15.0 (from pyocd)
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting typing-extensions<5.0,>=4.0 (from pyocd)
Downloading typing_extensions-4.7.1-py3-none-any.whl (33 kB)
Collecting hidapi<1.0,>=0.10.1 (from pyocd)
Downloading hidapi-0.14.0-cp311-cp311-win_amd64.whl (58 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.2/58.2 kB 9.5 kB/s eta 0:00:00
Collecting appdirs<2.0,>=1.4 (from cmsis-pack-manager<1.0,>=0.5.2->pyocd)
Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting cffi (from cmsis-pack-manager<1.0,>=0.5.2->pyocd)
Downloading cffi-1.15.1-cp311-cp311-win_amd64.whl (179 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 179.0/179.0 kB 27.5 kB/s eta 0:00:00
Requirement already satisfied: setuptools>=19.0 in c:\program files\python311\lib\site-packages (from hidapi<1.0,>=0.10.1->pyocd) (65.5.0)
Collecting zipp>=0.5 (from importlib-metadata>=3.6->pyocd)
Downloading zipp-3.16.2-py3-none-any.whl (7.2 kB)
Collecting sortedcontainers<3.0,>=2.0 (from intervaltree<4.0,>=3.0.2->pyocd)
Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting wcwidth (from prettytable<4.0,>=2.0->pyocd)
Downloading wcwidth-0.2.6-py2.py3-none-any.whl (29 kB)
Collecting psutil>=5.2.2 (from pylink-square<2.0,>=1.0->pyocd)
Downloading psutil-5.9.5-cp36-abi3-win_amd64.whl (255 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 255.1/255.1 kB 26.4 kB/s eta 0:00:00
Collecting pycparser (from cffi->cmsis-pack-manager<1.0,>=0.5.2->pyocd)
Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 23.9 kB/s eta 0:00:00
Building wheels for collected packages: intervaltree
Building wheel for intervaltree (pyproject.toml) ... done
Created wheel for intervaltree: filename=intervaltree-3.1.0-py2.py3-none-any.whl size=26128 sha256=dea34301fef6a0d0440f15d693ac29517637e1a213aa8d421aa6794f2329c089
Stored in directory: c:\users\biubiu\appdata\local\pip\cache\wheels\31\d7\d9\eec6891f78cac19a693bd40ecb8365d2f4613318c145ec9816
Successfully built intervaltree
Installing collected packages: wcwidth, sortedcontainers, pyelftools, intelhex, appdirs, zipp, typing-extensions, six, pyyaml, pyusb, pycparser, psutil, prettytable, natsort, lark, intervaltree, importlib-resources, hidapi, colorama, capstone, pylink-square, libusb-package, importlib-metadata, cffi, cmsis-pack-manager, pyocd
WARNING: The script natsort.exe is installed in 'C:\Users\biubiu\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script pylink.exe is installed in 'C:\Users\biubiu\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts pyocd-gdbserver.exe and pyocd.exe are installed in 'C:\Users\biubiu\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed appdirs-1.4.4 capstone-4.0.2 cffi-1.15.1 cmsis-pack-manager-0.5.2 colorama-0.4.6 hidapi-0.14.0 importlib-metadata-6.8.0 importlib-resources-6.0.0 intelhex-2.3.0 intervaltree-3.1.0 lark-1.1.7 libusb-package-1.0.26.2 natsort-8.4.0 prettytable-3.8.0 psutil-5.9.5 pycparser-2.21 pyelftools-0.29 pylink-square-1.2.0 pyocd-0.35.1 pyusb-1.2.1 pyyaml-6.0.1 six-1.16.0 sortedcontainers-2.4.0 typing-extensions-4.7.1 wcwidth-0.2.6 zipp-3.16.2
[notice] A new release of pip is available: 23.1.2 -> 23.2.1
[notice] To update, run: python.exe -m pip install --upgrade pip
C:\Users\biubiu>
At this point, the installation of PYOCD is successfully completed!
5. Configure PYOCD (Windows)
It can be used on e2stduio after PYOCD is configured on the windows system, so we need to configure PYOCD on the windows system first, and the configuration steps are as follows.
Open it in the file manager C盘
and create a new 100ASK_PYOCD
directory, as shown in the figure below:
Enter the newly created directory, and copy the pyocd.yaml and MDK_Device_Packs_v4.5.0.zip in 100ASK_PYOCD
the data package to the newly created directory located in the C drive, as shown in the following figure:6_使用软件/PYOCD/
100ASK_PYOCD
Use the decompression tool to decompress MDK_Device_Packs_v4.5.0.zip to get Renesas.RA_DFP.4.5.0.pack
Continue to use the decompression tool to decompress Renesas.RA_DFP.4.5.0.pack to get Renesas.RA_DFP.4.5.0
the folder:
Renesas.RA_DFP.4.5.0
Rename the folder to Renesas.RA_DFP
:
The installation is located in the data package 6_使用软件/Everything-1.4.1.1024.x64-Setup.exe
, open it after installation , and enter the searchEverything
according to the figure below pyocd
In the above search results, we focus on pyocd.exe
and pyocd-gdbserver.exe
, the directories of both are the same, located in: C:\Users\biubiu\AppData\Roaming\Python\Python311\Scripts
different computers and different systems may be different, the actual result shall prevail. Please write down this path, it will be used again later.
Press win+r on the keyboard, a small window will pop up in the lower left corner of the screen, enter in the input box cmd
and press Enter to enter the windows command line window, enter C:\Users\biubiu\AppData\ Roaming\Python\Python311\Scripts\pyocd.exe list --targets --config C:\100ASK_PYOCD\pyocd.yaml Press the Enter key to execute, as shown in the following figure:
At this point, the configuration of PYOCD (Windows) is complete!
6. Configure PYOCD (e2studio)
6.1 Install e2stduio
If e2studio has been installed before, please uninstall the original e2studio and restart the computer, and then follow the steps below to install!
Install the one located in the data package 6_使用软件/setup_fsp_v4_5_0_e2s_v2023-04.exe
, or obtain an updated version by yourself . It is recommended to use the supporting version.
installation steps:
- After opening, there will be a loading progress bar. After the progress bar is full, this interface will pop up. Select
All Users
(all users):
- Next selection
Custom Install
(custom installation):
Welcome
AndExtra Features
according to the default option, there is no need to update. It is not recommended to check the Chinese language pack in Extra Features. It is recommended to use the default English interface . In the third step, which isCustomise Features
, check according to the figure below, and then click Next to enter the next step:
- In the next step, check it as shown in the figure below and click next to enter the next step:
- In the next step, agree to the Licenses and click next to enter the next step:
- Next step, the default is fine, click next to enter the next step:
- In the next step, wait for the inspection to be completed. If there is no red prompt, everything is normal. You can click install to install:
- In the official installation stage, wait patiently for the installation to complete. During this period, there will be some pop-up windows asking whether to install or allow, and you must click Install or Allow.
- The installation is complete, click ok to exit the installer:
6.2 Configure PYOCD in e2stduio
- Open
e2stduio
Follow the steps belowWindow --> Perspectives --> Open Perspective -->Other...
:
- In the new window that opens, follow the steps below to open CMSIS Packs :
- Follow the steps below to open
Window --> Perspective --> Customize Perspective
:
- In the new window that opens, uncheck the two options, as shown in the figure:
- Follow the steps below to open
Window --> Preferences
:
- In the opened new window, according to the position shown in the figure below, paste the path that was located in the previous search using the Everything software
C:\Users\biubiu\AppData\Roaming\Python\Python311\Scripts
:
- Create a new project or open an existing project, complete the compilation, and then open it as follows
Run--> Debug Configuratons...
:
- After entering the new window, follow the steps below to open the new configuration file:
- In the newly opened page, configure according to the following figure:
-
Click
Debugger
to continue configuration, as shown in the following figure:The text to be entered is:
- R7FA6M5BF
- –config C:\100ASK_PYOCD\pyocd.yaml
- Click
Common
to continue configuration, as shown in the figure below:
- Finally, click
Debug
the button to enter the debug mode and start working. After the programming is completed, the debug operation can be performed, as shown in the figure below:
After exiting the debug mode, you will find that the board can run the program just programmed by itself, which means that the program can be programmed into the development board and run in the future.
At this point, we can use DAP in e2stduio for programming and debugging!
8. More Learning Resources
百问网瑞萨MCU文档教程在线学习
: http://renesas-docs.100ask.net- Renesas Electronics official website: https://www.renesas.cn
- Renesas RA MCU Ecological Community: https://www.ramcu.cn
- DShanMCU-RA6M5 technical exchange QQ group: 881706770
- DShanMCU-RA6M5 development board supporting information: http://download.100ask.net/boards/Renesas/DShanMCU-RA6M5/index.html
- DShanMCU-RA6M5 development board purchase link: https://100ask.taobao.com
- 100ask.net online learning platform: https://www.100ask.net
- Baiwen.com bilibili: https://space.bilibili.com/275908810
- 100ask.net technical exchange community: https://forums.100ask.net