diff --git a/README.md b/README.md index 0f5e053d2dd24d6f188642b48f047e123a69d14b..8ac56460d4706f309e2da4a13e196328f5394ed5 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ RT-Thread Smart 是基于 RT-Thread 操作系统上的混合操作系统,简 - [RT-Thread EtherKit 上手指南](/rt-thread-version/rt-thread-standard/hw-board/rzn2l-etherkit/rzn2l-etherkit.md) - [OPENHW Core-V-MCU](/rt-thread-version/rt-thread-standard/tutorial/quick-start/openhw-core-v-mcu/quick-start.md) - [富瀚微 MC3302](/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc3302/quick-start.md) +- [富瀚微 MC632X](/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/quick-start.md) - [其他...](/rt-thread-version/rt-thread-standard/tutorial/quick-start/more.md) #### 内核学习 diff --git a/rt-thread-version/rt-thread-standard/_sidebar.md b/rt-thread-version/rt-thread-standard/_sidebar.md index cf5b12ee919826fe307dde92ea28a5ab901a3450..701355728a78feb5e30416c8a5fac3b8ee33ff5d 100644 --- a/rt-thread-version/rt-thread-standard/_sidebar.md +++ b/rt-thread-version/rt-thread-standard/_sidebar.md @@ -23,6 +23,7 @@ - [英飞凌 CY8CKIT-062S2-43012](/rt-thread-version/rt-thread-standard/tutorial/quick-start/CY8CKIT-062S2-43012/quick-start.md) - [OPENHW Core-V-MCU](/rt-thread-version/rt-thread-standard/tutorial/quick-start/openhw-core-v-mcu/quick-start.md) - [富瀚微 MC3302](/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc3302/quick-start.md) + - [富瀚微 MC632X](/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/quick-start.md) - [其他开发板...](/rt-thread-version/rt-thread-standard/tutorial/quick-start/more.md) - 内核 - [内核基础](/rt-thread-version/rt-thread-standard/programming-manual/basic/basic.md) diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/0.mc632x.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/0.mc632x.png new file mode 100644 index 0000000000000000000000000000000000000000..dee64a56d0722d90f34921b63092949731685605 Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/0.mc632x.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/10.ram.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/10.ram.png new file mode 100644 index 0000000000000000000000000000000000000000..8405bb4c8aee484e59f2d969acf1173d0c245703 Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/10.ram.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/11.flash.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/11.flash.png new file mode 100644 index 0000000000000000000000000000000000000000..0a48135478f3a0a017c58816c1c22f2fdfa9d4e2 Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/11.flash.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/2.uboot.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/2.uboot.png new file mode 100644 index 0000000000000000000000000000000000000000..df1d6119533ce83ebf3dbef96baa8787c9c41113 Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/2.uboot.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/3.secureCRT.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/3.secureCRT.png new file mode 100644 index 0000000000000000000000000000000000000000..eab995b7709c911ae0135fb4a62be5d9be5e02aa Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/3.secureCRT.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/4.xmodom.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/4.xmodom.png new file mode 100644 index 0000000000000000000000000000000000000000..e81361b4472eac4740dacfdb3a6a043b1c068c21 Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/4.xmodom.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/5.xmodem2.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/5.xmodem2.png new file mode 100644 index 0000000000000000000000000000000000000000..9564ad08bd8bbddd6633429ac8a1e1768ae9a0c3 Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/5.xmodem2.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/6.run.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/6.run.png new file mode 100644 index 0000000000000000000000000000000000000000..b0af34a7c02f8049dee09bdd13819d4f3db6db3e Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/6.run.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/7.complie.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/7.complie.png new file mode 100644 index 0000000000000000000000000000000000000000..fe80ff3066c7d8acfc0c0ca770927729c88330dc Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/7.complie.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/8.helloworld.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/8.helloworld.png new file mode 100644 index 0000000000000000000000000000000000000000..6f9fe0df41ebbdf1b58d1ef3ed66cf3b1dc6e091 Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/8.helloworld.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/9.tftp64.png b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/9.tftp64.png new file mode 100644 index 0000000000000000000000000000000000000000..ce27a0811029ea0cbf9692bdd9fb0f71a301dd1d Binary files /dev/null and b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/figures/9.tftp64.png differ diff --git a/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/quick-start.md b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/quick-start.md new file mode 100644 index 0000000000000000000000000000000000000000..b7f4d206a4c877ed709b40287a12858d9055f5ba --- /dev/null +++ b/rt-thread-version/rt-thread-standard/tutorial/quick-start/fullhan-mc632x/quick-start.md @@ -0,0 +1,198 @@ +# Fullhan MC632X上手指南 + +## 一 MC632X简介 + +一款支持两路 mipi 输出,单路 mic 输入,支持 wifi,ephy,SD 卡等多种外设功能的新一代低端双路 4M 图像处理芯片。可广泛运用于如安防监控,门锁门禁,儿童相机的多种智能嵌入式图像处理领域的高性价比芯片。 + +![](figures/0.mc632x.png) + +### 1.1 产品规格和技术参数 + +| **功耗** | **典型场景 800mW** | +| ------------ | ------------------------------------------------------------ | +| **工作电压** | **内核电压为 0.9V;IO 电压为 1.8/3.3V;DDR2 SDRAM 接口电压为 1.8V** | +| **封装** | **QFN88** | +| **管脚间距** | **0.35mm;9x9mm 封装大小** | +| **工作温度** | **-20~70°C** | + +### 1.2 性能参数 + +- CPU0 单核,最高支持 900MHz; 协处理器 CPU1 单核, 最高支持 450MHz; +- 视频编解码支持:H.264/H.265:2880x1620@30fps H.264/H.265 编码;2560x1920@25fps H.264/H.265 编码;JPEG:2880x1620@30fps 编解码;2560x1920@25fps 编解码。 +- NN 智能算力:算力 0.5TOPS,支持人形和人脸等网络结构。 +- 视频输入:分时支持最多 2 路 Camera inputs;单路最大支持 5MP@30fps ;双路最大支持 2*5MP@15fps +- 视频输出:支持 LCM RGB 输出,RGB565, RGB666, RGB888 格式,支持最大 size:800X600@60fps;支持 LCM MCU 输出,RGB565, RGB666 格式,支持最大 size:600X400@60fps。 +- 音频编解码:软件实现多协议音频编解码,支持 G.711、G.726。 +- 音频接口:1 个 I2S/PCM 接口,用于外接 Audio Codec ;内置 Audio Codec, 支持一路单独端麦克风输入,1 路单端 lineout 输出,支持 32KHz, 44.1KHz 两个系列采用率 ;1 路数字 MIC,为 PDM 接口。 +- 网络接口:支持 10/100Mbit/s 半双工或全双工;集成 FE PHY。 +- 外围接口:支持 1 个 SPI 接口;支持 2 个 I2C 接口;支持 2 个 PWM 和 8 个 STM;支持 2 个 SDIO2.0 接口;支持多个 GPIO 接口;1 个 USB 2.0 ,支持 HOST 及 Device 接口;3 个 UART 接口,其中 1 个支持 4 线。 + +### 1.3 ISP特性 + +- 支持 RGB Bayer 数据格式,Sensor 输出窗口坐标随意 +- 支持标准 Bayer Pattern 2x2 起始点可配置 +- 支持暗角矫正(强度可配) +- 支持轻度广角矫正(矫正幅度不超过 5%,中心/强度可配置) +- 支持自动坏点消除 +- 支持动态范围处理 +- 支持高性能 3D 降噪 +- 支持高性能 2D 降噪 +- 支持高性能 CFA +- 支持 AE/AWB 统计和控制 +- 支持局部对比度调整和细节增强 +- 支持颜色校正、色度空间调整 +- 支持图像效果调整(亮度、锐度、饱和度和 Gamma) +- 支持 Y/C 域降噪 +- 支持自适应锐化 +- 支持视频缩放 +- 支持 OSD 叠加 (仅主/子幅面支持 OSD 叠加) +- 支持两个大小可配置的 Graphic,Graphic data 支持 ARGB1555 +- 支持多窗口TXT 菜单(4x Window),字体大小可配置(16x16 ~ 64x64),字库可配置,TXT 菜单自动反色 + +更多信息请访问 [富瀚微官网](https://www.fullhan.com/) + +## 二 开发环境 + +| **RTOS** | **RT-Thread** | +| ------------ | ------------------------- | +| **工具链** | **arm-fullhanv2-eabi-b3** | +| **开发环境** | **Linux** | + +## 三 SDK使用说明 + +### 3.1 SDK环境搭建 + +SDK从[富瀚微](https://www.fullhan.com/)获取,首先将SDK拷贝至linux环境使用下述命令进行解压: + +```shell +unzip -O GBK FH_RT_V3.4.0_20250123.zip +``` + +进入工具链的目录,当前环境工具链路径如下(具体路径根据自己的环境进行调整): + +```shell +/home/rtt/FH_RT_V3.4.0_20250123/docs_tools/software/pc +``` + +执行下述命令安装富瀚微的工具链(如果遇到文件无权限的先修改文件的权限): + +```shell +chmod 777 install_toolchain.sh +sudo ./install_toolchain.sh +``` + +在任意目录下执行 `arm-fullhanv2-eabi-gcc --version`,若出现下述信息则表示工具链安装成功: + +```shell +rtt@rtt-virtual-machine:~$ arm-fullhanv2-eabi-gcc --version +arm-fullhanv2-eabi-gcc (GNU Tools for Fullhan SoCs 6-2020-08) 6.3.1 20170620 (release) +Copyright (C) 2016 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. +``` + +完成上述工具即可进一步熟悉SDK,开始正式开发。 + +### 3.2 u-boot烧录 + +开发板默认从SPI NOR Flash启动,u-boot可以通过串口烧录,u-boot的名称如下: + +```shell +xmodem_芯片型号_其他参数.img +``` + +MC632X通常烧录下述文件即可: + +```shell +xmodem_MC632X_SPI_1_WIRE.img +``` + +![](figures/2.uboot.png) + +安装`SecureCRT 8.3`软件 ,将板卡的串口使用USB转串口工具与主机连接,使用`SecureCRT 8.3`软件连接板卡,给板卡通电后快速按回车键,当出现`203`字符后,表示芯片进入烧录模式。 + +![](figures/3.secureCRT.png) + +点击下述选项(`send Xmodem`),发送uboot固件: + +![](figures/4.xmodom.png) + +选中`xmodem_MC632X_SPI_1_WIRE.img`文件: + +![](figures/5.xmodem2.png) + +烧录成功后如下图所示: + +![](figures/6.run.png) + +从上述log可以看出`U-Boot`正常启动。 + +## 四 编译应用 + +首先进入`$SDK/rt-thread`目录,执行下述命令生成应用配置: + +```shell +sudo make mc632x_defconfig +``` + +执行上述命令可能遇到某些文件没有权限,按提示进入指定目录将需要使用的文件设置可执行权限。执行make 编译程序,编译完成输出如下log: + +![](figures/7.complie.png) + +找到生成的应用文件: + +![](figures/8.helloworld.png) + +## 五 更新应用 + +### 5.1 直接在DDR中运行 + +uboot支持tftp服务,在本地启动tftp服务进行应用程序的传输,这里使用`tftpd64.exe`启动tftp服务。 + +![](figures/9.tftp64.png) + +执行下述示例命令设置板卡与服务器的IP,板卡应和主机在同一局域网: + +```shell +set serverip 192.168.1.10 +set ipaddr 192.168.1.20 +saveenv +``` + +完成上述配置后,将应用程序拷贝至tftp服务器的文件传输目录,然后执行下述命令运行应用程序,将该文件数据传输到 DDR 内存的 a0000000 地址处: + +```shell +sf probe 0 +tftp a0000000 helloworld.bin +go a0000000 +``` + +运行结果如下: + +![](figures/10.ram.png) + +### 5.2 固化程序在Flash + +上述方式需要启动U-Boot后手动运行命令执行,如果期望启动后自动运行应用,可以将编译处的bin问价烧录到Flash中,上电后通过U-Boot跳转运行: + +首先执行下述命令修改U-boot启动后执行的命令: + +```shell +set bootcmd 'sf probe 0;sf read 40000000 0x120000 300000;go 40000000' +saveenv +``` + +然后执行下述命令将示例程序 `helloworld.bin`固化在Flash中并复位启动: + +```shell +sf probe 0 +sf erase 0x120000 300000 +tftp 41000000 helloworld.bin +sf write 41000000 0x120000 300000 +reset +``` + +完成上述步骤后便可以上电直接运行应用程序,运行结果如下: + +![](figures/11.flash.png) +