Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread Studio
RT-Thread Studio 创建的STM32G474RB项目下载问题,程序超过64K下载失败,芯片FLASH有128K
发布于 2023-04-21 17:01:26 浏览:805
订阅该版
RT-Thread Studio 创建的STM32G474RB项目下载问题,编译后bin程序超过64K下载失败,小于64K时可以成功下载,芯片FLASH有128K. 补充:使用JLINK下载时大于64K下载失败,使用 DAP-LINK时大于64K下载成功。 如下代码: 通过调整 `static const char data[1024 *7]` 改变编译后的bind大小可以方便复现描述现象。 求助:如何解决上述下载问题。 ```c #include
#define DBG_TAG "main" #define DBG_LVL DBG_LOG #include
static const char data[1024 *7] = {0}; int main(void) { int count = 1; while (count++) { LOG_D("Hello RT-Thread!"); rt_thread_mdelay(1000); for (int var = 0; var < 1000; ++var) { rt_kprintf("%d \r\n",data[var]); } } return RT_EOK; } ``` 以下是JLINK的下载信息,这个信息是STM32G474CCT6的下载信息,芯片256K,同样超过一半 128K时JLINK会出现下载失败。DAP-LINK 超过一半时下载正常。 ``` 开始下载程序:2023-04-22 13:54:48 Download Start Address: 0x08000000 e:\RT-ThreadStudio>"E:/RT-ThreadStudio/repo/Extract/Debugger_Support_Packages/SEGGER/J-Link/v7.50a\JLink.exe" -device STM32G474CC -ExitOnError -CommanderScript E:\RT-ThreadStudio\workspace/.metadata/Temp/rtthread_download_init.jlink SEGGER J-Link Commander V7.50a (Compiled Jul 8 2021 18:22:32) DLL version V7.50a, compiled Jul 8 2021 18:21:11 J-Link Commander will now exit on Error J-Link Command File read successfully. Processing script file... J-Link connection not established yet but required for command. Connecting to J-Link via USB...O.K. Firmware: J-Link V11 compiled Apr 27 2041 16:36:21 Hardware version: V11.00 S/N: 941000024 License(s): GDB, JFlash, FlashDL, RDI, FlashBP VTref=3.296V Selecting SWD as current target interface. Device "STM32G474CC" selected. Selecting 1000 kHz as target interface speed Target connection not established yet but required for command. Device "STM32G474CC" selected. Connecting to target via SWD Found SW-DP with ID 0x2BA01477 Found SW-DP with ID 0x2BA01477 DPIDR: 0x2BA01477 Scanning AP map to find all available APs AP[1]: Stopped AP scan as end of AP map has been reached AP[0]: AHB-AP (IDR: 0x24770011) Iterating through AP map to find AHB-AP to use AP[0]: Core found AP[0]: AHB-AP ROM base: 0xE00FF000 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM) Found Cortex-M4 r0p1, Little endian. FPUnit: 6 code (BP) slots and 2 literal slots CoreSight components: ROMTbl[0] @ E00FF000 ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7 ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM Cortex-M4 identified. Without any give address range, Erase Chip will be executed Erasing device... J-Link: Flash download: Total time needed: 0.231s (Prepare: 0.169s, Compare: 0.000s, Erase: 0.054s, Program: 0.000s, Verify: 0.000s, Restore: 0.007s) J-Link: Flash download: Total time needed: 0.153s (Prepare: 0.107s, Compare: 0.000s, Erase: 0.038s, Program: 0.000s, Verify: 0.000s, Restore: 0.007s) J-Link: Flash download: Total time needed: 0.126s (Prepare: 0.103s, Compare: 0.000s, Erase: 0.014s, Program: 0.000s, Verify: 0.000s, Restore: 0.007s) J-Link: Flash download: Total time needed: 0.128s (Prepare: 0.105s, Compare: 0.000s, Erase: 0.014s, Program: 0.000s, Verify: 0.000s, Restore: 0.008s) Erasing done. Reset delay: 0 ms Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit. Reset: Halt core after reset via DEMCR.VC_CORERESET. Reset: Reset device via AIRCR.SYSRESETREQ. PC = FFFFFFFE, CycleCnt = 00000000 R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000 R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000 R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000 R12= 00000000 SP(R13)= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000, R14(LR) = FFFFFFFF XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException) CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00 FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000 FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000 FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000 FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000000 FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000 FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000 FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000 FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000 FPSCR= 00000000 Downloading file [E:\RT-ThreadStudio\workspace\STM32G474RB-TEST05\Debug\rtthread.bin]... Writing target memory failed. Script processing completed. J-Link: Flash download: Bank 0 @ 0x08000000: 1 range affected (131072 bytes) J-Link: Flash download: Total: 2.291s (Prepare: 0.195s, Compare: 0.036s, Erase: 0.000s, Program & Verify: 1.974s, Restore: 0.085s) J-Link: Flash download: Program & Verify speed: 64 KiB/s 执行完毕, 耗时:7501ms. ```
查看更多
1
个回答
默认排序
按发布时间排序
yutian0606
2024-07-29
这家伙很懒,什么也没写!
# 临时解决办法: ## 1.说明: 经测试,工程编译后的bin文件切换 st-link 后下载运行正常。但jlink下载后异常,通过STM32 ST-LINK Utility 读取通过jlink下载到芯片中的文件,发现超过64k地址后的数据为空(0xFF),说明Jlink只会下载64k范围内的固件,原因是 STM32G474RB 是双 bank ,bank1 的flash空间正好是64K,超过的就没有下载了,所以程序运行异常。 ## 2.临时解决办法: 通过打开齿轮图标的调试配置菜单,在 调试器 -> 设备名称 窗口中将原来的 STM32G474RBTx 改为 STM32G474RCTx (工程芯片还是为 STM32G474RB 不需要改),这样在调试和下载时 JLINK 就会识别为STM32G474RCTx进行操作,STM32G474RCTx 的 bank1 是128K ,这样就可以让 jlink正常下载。 ## 3.注意: 经过自己的工程按 2 的方式改后调试和下载正常,但不保证没有其他问题,仅作参考。 ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20240729/4367d321a956596fa47a2212910eebd9.png.webp)
撰写答案
登录
注册新账号
关注者
1
被浏览
805
关于作者
yutian0606
这家伙很懒,什么也没写!
提问
8
回答
13
被采纳
0
关注TA
发私信
相关问题
1
rt_thread studio 啥时候能用呢
2
RT_Thread使用反馈帖子
3
RTT studio 下的 AT指令问题。
4
什么时候RTT Sdudio支持Ubuntu,Deepin和UOS操作系统
5
rt thread Studio 关于J-LINK下载问题
6
RT-Thread studio 调试设置问题
7
RTT-Studio 如何设置调试配置参数?
8
rt_thread studio 软件包配置
9
RT-Studio目前只能开发STM32的项目吗?
10
rtt studio 生成hex名字修改
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
如何在master上的BSP中添加配置yml文件
2
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
3
RT-Thread 发布 EtherKit开源以太网硬件!
4
rt-thread使用cherryusb实现虚拟串口
5
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
UART
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
ulog
C++_cpp
at_device
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
a1012112796
13
个答案
2
次被采纳
张世争
9
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
本月文章贡献
程序员阿伟
9
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
5
次点赞
RTT_逍遥
1
篇文章
2
次点赞
ThinkCode
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部