【瑞萨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

相关推荐
1024奇点13 小时前
【仓颉语言入门 · 第二篇 第 12 课】
开发语言·数据库·ide·mysql·开源
console.log('npc')15 小时前
周期任务功能完整实现:CRON 编辑器 + 模板变量 + 执行历史
javascript·vue.js·编辑器
迪菲赫尔曼15 小时前
【基础篇 08】让VS Code连接服务器:界面在本地,文件保存到远端
运维·服务器·vscode·yolo·论文·教程·ultralyt
2501_9151063216 小时前
Windows 上开发 Unity iOS,使用 KXBuild 进行真机调试、性能采样与打包 ipa
windows·vscode·unity·ios·个人开发·swift·敏捷流程
weixin_3993806918 小时前
TongWeb7.0.4.9M11如何接入到idea(by lqw)
java·ide·intellij-idea
MicrosoftReactor1 天前
技术速递|超越一刀切:为 GitHub Copilot CLI 和 VS Code 实现决策路由
vscode·ai·github·copilot·决策路由
徐小夕@趣谈前端2 天前
Web 端 OFD 编辑器踩坑记:从“只能预览”到“在线改”
前端·编辑器
_小许_2 天前
AI IDE 与 Agent Harness:一次说清 Cursor、Codex 该怎么选
ide·人工智能·ai编程·cursor·codex
喆星时瑜2 天前
探索 Anaconda 中的 JupyterLab、Jupyter Notebook、iPython 解释器(Qt 控制台)和 Spyder IDE
ide·jupyter·ipython
2501_915918412 天前
Windows 上开发 React Native iOS,真机调试、Fast Refresh 与打包 ipa
windows·vscode·react native·ios·个人开发·swift·敏捷流程