【瑞萨RA6M3】1. 基于 vscode 搭建开发环境

基于 vscode 搭建开发环境

  • [1. 准备](#1. 准备)
  • [2. 安装](#2. 安装)
    • [2.1. 安装瑞萨软件包](#2.1. 安装瑞萨软件包)
    • [2.2. 安装编译器](#2.2. 安装编译器)
    • [2.3. 安装 cmake](#2.3. 安装 cmake)
    • [2.4. 安装 openocd](#2.4. 安装 openocd)
    • [2.5. 安装 ninja](#2.5. 安装 ninja)
    • [2.6. 安装 make](#2.6. 安装 make)
  • [3. 生成初始代码](#3. 生成初始代码)
  • [4. 修改 cmake 脚本](#4. 修改 cmake 脚本)
  • [5. 调试准备](#5. 调试准备)
  • [6. 仿真](#6. 仿真)

1. 准备

需要瑞萨仓库中的两个软件:

  1. MDK_Device_Packs.zip
  2. setup_fsp_rasc.exe(RA Smart Configurator)

交叉编译工具链:

  1. gcc
  2. cmake

2. 安装

2.1. 安装瑞萨软件包

MDK_Device_Packs_v5.2.0.zip
setup_fsp_v5_2_0_rasc_v2024-01.1.exe

安装 setup_fsp_rasc.exe(RA Smart Configurator)

2.2. 安装编译器

Arm GNU Toolchain Downloads -- Arm Developer

下载最新版本:arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip

下载后解压,把解压路径添加到环境变量。

在终端中执行指令,查看 gcc 的版本信息:

bash 复制代码
$ arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=D:\Applications\Toolchain\arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi\bin\arm-none-eabi-gcc.exe
COLLECT_LTO_WRAPPER=D:/Applications/Toolchain/arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi/bin/../libexec/gcc/arm-none-eabi/13.2.1/lto-wrapper.exe
Target: arm-none-eabi
Configured with: /data/jenkins/workspace/GNU-toolchain/arm-13/src/gcc/configure --target=arm-none-eabi --prefix=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/install --with-gmp=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --with-mpfr=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --with-mpc=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --with-isl=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --disable-shared --disable-nls --disable-threads --disable-tls --enable-checking=release --enable-languages=c,c++,fortran --with-newlib --with-gnu-as --with-headers=yes --with-gnu-ld --with-native-system-header-dir=/include --with-sysroot=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/install/arm-none-eabi --with-multilib-list=aprofile,rmprofile --with-libiconv-prefix=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --host=i686-w64-mingw32 --with-pkgversion='Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)' --with-bugurl=https://bugs.linaro.org/
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 13.2.1 20231009 (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7))

2.3. 安装 cmake

https://cmake.org/download/

下载后解压,把解压路径添加到环境变量。

在终端中执行指令,查看 cmake 的版本信息:

bash 复制代码
$ cmake --version
cmake version 3.28.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

2.4. 安装 openocd

https://github.com/openocd-org/openocd/releases

下载解压后,将解压路径添加到环境变量中。

在终端中执行指令,查看 openocd 的版本信息:

bash 复制代码
$ openocd --version
Open On-Chip Debugger 0.12.0 (2023-01-14-23:37)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html

2.5. 安装 ninja

ninja 和 make 都是构建系统工具,它们通常作为后端,被 cmake 生成和使用,相比之下 ninja 具有更好的性能和更专注于构建速度。

https://github.com/ninja-build/ninja/releases

下载解压后,将解压路径添加到环境变量。

在终端中执行命令,查看 ninja 版本信息:

bash 复制代码
$ ninja --version
1.11.1

2.6. 安装 make

https://gnuwin32.sourceforge.net/packages/make.htm

下载安装后,需要将安装路径添加到环境变量中。

在终端中执行命令,查看 make 版本信息:

bash 复制代码
$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-pc-mingw32

3. 生成初始代码

打开 rasc(RA Smart Configurator)

RAFA6M3A H 3 C FB

  1. H:2MB
  2. FB:144引脚

4. 修改 cmake 脚本

修改顶层 CMakeLists.txt


5. 调试准备

玩转 pyocd - 哈拎 - 博客园 (cnblogs.com)

bash 复制代码
$ pyocd list -t
  Name                      Vendor                   Part Number                  Families   Source   
------------------------------------------------------------------------------------------------------
  air001                    AirM2M                   Air001                                  builtin  
  air32f103xb               AirM2M                   Air32F103xB                             builtin  
  air32f103xc               AirM2M                   Air32F103xC                             builtin  
  air32f103xe               AirM2M                   Air32F103xE                             builtin  
  air32f103xg               AirM2M          
bash 复制代码
$ pyocd pack -s
  Vendor   Pack   Version  
---------------------------
bash 复制代码
$ pyocd pack find R7FA6M3AH
0000684 I No pack index present, downloading now... [pack_cmd]
  Part        Vendor    Pack             Version   Installed  
--------------------------------------------------------------
  R7FA6M3AH   Renesas   Renesas.RA_DFP   5.2.0     False
bash 复制代码
$ pyocd pack -i R7FA6M3AH
Downloading packs (press Control-C to cancel):
    Renesas.RA_DFP.5.2.0
Downloading descriptors (001/001)
bash 复制代码
$ pyocd pack -s
  Vendor    Pack     Version  
------------------------------
  Renesas   RA_DFP   5.2.0
bash 复制代码
$ pyocd list -p
  #   Probe/Board                  Unique ID      Target  
----------------------------------------------------------
  0   XIVN1987 XV-Link CMSIS-DAP   5F95D4D86436   n/a
bash 复制代码
$ pyocd flash --target=R7FA6M3AH --erase=auto --frequency=1000000 ./build/FSP_Project.elf
0001841 I Loading D:\Workspace\other\ra\proj01\build\FSP_Project.elf [load_cmd]
[==================================================] 100%
0009190 I Erased chip, programmed 4992 bytes (39 pages), skipped 912 bytes (8 pages) at 0.79 kB/s [loader]

没尝试过:RT-Thread-使用标准PyOCD烧录RA6M3 HMI-BoardRT-Thread问答社区 - RT-Thread

6. 仿真

F5

相关推荐
寻梦csdn1 天前
pycharm+miniconda兼容问题
ide·python·pycharm·conda
徐小夕@趣谈前端1 天前
Web文档的“Office时刻“:jitword共建版2.0发布!让浏览器变成本地生产力
前端·数据结构·vue.js·算法·开源·编辑器·es6
电饭叔1 天前
Jupyter学习中的问题--FileNotFoundError
ide·学习·jupyter
noBt1 天前
Windows IDEA 卡顿严重
java·ide·intellij-idea
小疙瘩1 天前
去掉 IDEA 中 mybatis配置文件的局部背景颜色(图解)
java·ide·intellij-idea
zhanglianzhao1 天前
Win 11 WSL 配置Claude code 并在VsCode中使用
ide·vscode·编辑器·claude·cladue code
Keying,,,,1 天前
VScode中终端闪退问题
ide·vscode·编辑器
热爱生活的五柒1 天前
如何在vscode中使用Claude code以及插件中配置setting.json无效的解决方法
ide·vscode·编辑器
ONLYOFFICE1 天前
ONLYOFFICE 自动化工具:宏和 AI 函数如何选择?
运维·自动化·编辑器·onlyoffice
dzj20212 天前
Visual Studio2022中好用的AI编码工具介绍——Windsurf(Codeium)
ide·ai·visual studio·code