完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,
我正在使用带SPC5 Studio的SPC560C50L3 MCU。我正在尝试添加一个库文件,该文件使用大量堆栈和堆使用动态分配到我的应用程序中。由于堆栈溢出,我的代码常常陷入其中。现在我可以在user.ld文件中更改堆栈大小。但是如何在运行时检查堆栈和堆使用情况?任何建议都会有所帮助。 问候 THOMAS。 #spc560#stack-overflow 以上来自于谷歌翻译 以下为原文 Hello Everyone, I am working on SPC560C50L3 MCU with SPC5 Studio. I am trying to add a library file which uses heavy stack and heap using dynamic allocations into my application. My code used to stuck in between due to stack overflow. Now I am able to change the stack size in the user.ld file. But how do I check the stack and heap usage at run time ? Any suggestion would be helpful. Regards THOMAS. #spc560 #stack-overflow |
|
相关推荐
2个回答
|
|
好吧,我确实从80年代开始在这里旅行,所以并不奇怪。你倾向于足智多谋,因为ICE的成本与汽车一样多,虽然现在跟踪/配置文件盒的价格便宜很多,但很多人没有它们,或者用于支持它们的标头连接。
有些工具提供了对调用树和堆栈深度的静态分析,但是中断和嵌套往往是一个更大的未知因素。 我构建的大多数东西都有一个命令行监视器,允许现场调试/分析,这些通常包括从控制台感知到的堆栈深度报告,以及运行测试/诊断例程之后的报告。还尝试在硬故障的情况下提供寄存器转储,因此我们可以尝试确定LED的闪烁模式或静默死亡。热插拔系统并不总是实用或可靠。 以上来自于谷歌翻译 以下为原文 Well I did travel here from the 80's so not exactly surprising. You tended to be resourceful because an ICE would cost as much as a car, and while trace/profile pods are now much cheaper a lot of people don't have them, or header connections to support them. Some tools provide for static analysis of call trees and stack depth, but interrupts and nesting there tends to be a bigger unknown factor. Most things I build have a command line monitor to permit field debug/analysis, these typically include a reporting of stack depth as perceived from the console, and after running test/diagnostic routines. Also try to provide a register dump in case of hard failure, so we have something to work from than trying to determine the flashing pattern of an LED, or silent death. Hot-plugging a system isn't always practical or reliable. |
|
|
|
我以为我疯狂地从构建基于串口的控制台和简单的CLI解析器开始每个项目;)
我的疯狂来自于我对Cisco路由器的长期经验以及它们具有内置良好调试功能的能力(包括发生崩溃时的内存和堆栈跟踪)。我还为我的项目添加了一些脚本功能,因为我喜欢脚本语言。 我喜欢的另一个奇怪的事情是从SRAM运行代码(如果可能的话,由于SRAM大小)。许多人说这是愚蠢的,因为闪光灯可以在很多次重编程中存活下来。我曾经使用TI MCU,其中1000个周期被杀死;)我注意到你也使用这个功能。 以上来自于谷歌翻译 以下为原文 I was thinking I am mad starting every project from building serial-based console and simple CLI parser;) My madness come from my long experience with Cisco routers and their ability to have built-in decent debugging capabilities (including memory and stack traces when a crash occurs). I also add some scripting capabilities to my projects as I like scripting languages. Another weird thing I like is running code from SRAM (if possible due to SRAM size). Many people say it's stupid as the flash can survive many cycles of reprogramming. I used to use a TI MCU where the 1000 cycles were killing;) I noticed that you also use this feature. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2881 浏览 1 评论
3282 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1861 浏览 1 评论
3711 浏览 6 评论
6125 浏览 21 评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
411浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
510浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
334浏览 2评论
使用STM32F407VET6的USB2.0功能,发现ctl后芯片无数据返回,是什么原因可能导致的呢?
246浏览 2评论
用STM32G431开发工程,1.50版本的Package包文件无法输出项目工程
354浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-2-24 11:52 , Processed in 1.216514 second(s), Total 78, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191