返回列表 发新帖我要提问本帖赏金: 15.00元(功能说明)

[G32R] 【极海G32R430 TinyBoard开发板测评】+ 修改OPT实现ISP

[复制链接]
899|1
袁胜富 发表于 2026-5-8 23:27 | 显示全部楼层 |阅读模式
本帖最后由 袁胜富 于 2026-5-8 23:27 编辑

一、概述
      
                      4364369fdf16fa2dd6.png
                                                                     图1
     G32R430 支持从不同的存储区启动,用户通过配置 Option Bytes 的 BOOTADDR[15:0]位段进行
选择。
若从 BootLoader 启动,用户可使用串口接口重新编程用户 Flash。在嵌入式 BootLoader 模式
下,用户可以选择通过以下任意一组串行接口重新编程 Flash:
⚫ USART1(默认接口)(PB6/PB9)
⚫ USART2(PD5/PD9)
由图1知道,G32R430的启动地址需要对BOOTADDR[15:0]位进行配置,配置0x4000从flash 0x8000000开始启动;配置0x0080从系统的存储器启动,在此配置下可以使用官方的工具GeehyProg_SetUp_V1.0.6_Chinese通过USART1或USART2进行串口在线升级程序。
                   5619869fdf5a56b95d.png
                                           图2
      由图2可知配置0x4000需要配置BOOTADDR[7:0]:0x00,nBOOTADDR[7:0]:0xFF;BOOT_ADDR[15:8]:0x40,nBOOT_ADDR[15:8]:0xBF;
      由图2可知配置0x0080需要配置BOOTADDR[7:0]:0x80,nBOOTADDR[7:0]:0x7F;BOOT_ADDR[15:8]:0x00,nBOOT_ADDR[15:8]:0xFF;
二、代码
  1. //
  2. // G32R430 Option Bytes Configuration
  3. //
  4. // Address range: 0x1FFF0000 ~ 0x1FFF000B
  5. // Each field is 1 byte (8 bits).
  6. //
  7. // Below example sets:
  8. //   - RDP to Level0: 0xAA (nRDP: 0x55)
  9. //   - USER to 0x03 => SW IWDG = 1, SW WWDG = 1, WLOCK enable = 0
  10. //        (nUSER = 0xFC)
  11. //   - WLOCK = 0xFF => disable all write protections
  12. //        (nWLOCK = 0x00)
  13. //   - BOOTADDR = 0x4000 (boot from 0x08000000, for demonstration)
  14. //        (nBOOTADDR = 0xBFFF)
  15. //   - You can adjust these settings based on your application needs.
  16. //

  17.     .section .ARM.__at_0x1FFF0000
  18.     /* 0x0000: RDP, nRDP */
  19.     .byte 0xAA          /* RDP: 0xAA => Level0 (no protection) */
  20.     .byte 0x55          /* nRDP: 0x55 => complement of RDP */

  21.     /* 0x0002: USER, nUSER */
  22.     .byte 0x03          /* USER: [2]=0 => WLOCK Disable,
  23.                                  [1]=1 => SW WWDG ,
  24.                                  [0]=1 => SW IWDG */
  25.     .byte 0xFC          /* nUSER: complement of 0x07 */

  26.     /* 0x0004: WLOCK, nWLOCK */
  27.     .byte 0xFF          /* WLOCK: 0xFF => all sectors unprotected (bit=1 => write protection OFF) */
  28.     .byte 0x00          /* nWLOCK: complement of 0xFF */

  29.     /* 0x0006: Reserved */
  30.     .byte 0x00
  31.     .byte 0xFF

  32.     /*4000 */
  33.     /* 0x0008: BOOTADDR[7:0], nBOOTADDR[7:0] */
  34.     .byte 0x00          /* BOOTADDR[7:0] */
  35.     .byte 0xFF          /* nBOOTADDR[7:0] */

  36.     /* 0x000A: BOOTADDR[15:8], nBOOTADDR[15:8] */
  37.     .byte 0x40          /* BOOTADDR[15:8] */
  38.     .byte 0xBF          /* nBOOTADDR[15:8] */


  39. /* End of file */

三、测试
4451869fdf958d687b.png
修改g32r430_opt.s下载程序
打开GeehyProg_SetUp_V1.0.6_Chinese
1406069fdfa559f0c2.png
连接成功
$K\ARM\ARMCLANG\bin\fromelf.exe --bin --output ./Output/@L.bin !L或$K\ARM\ARMCLANG\bin\fromelf.exe --bin --output @L.bin !L生成bin文件
1161969fe00c19798f.png
6568069fe00d9c1c4f.png


打赏榜单

21ic小管家 打赏了 15.00 元 2026-06-11
理由:极海评测奖励

lemonboard 发表于 2026-5-9 13:34 | 显示全部楼层
这么应用的优势在哪里啊?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

37

主题

186

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部
0