完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好我正在使用SPC56EL60L3和SPC5STUDIO v5.0。
我需要从RAM运行一段代码,更具体地说是一个函数。 我如何在SPC5Studio中执行此操作?我想我需要添加一个指令,如: __attribute __((section('.ram_code'))) 在函数声明之前,其中ram_code是在链接描述文件中定义的。 请你举个例子吗? 谢谢。 问候 亚历山德罗 #spc5studio #ram #code#spc56 以上来自于谷歌翻译 以下为原文 Hello I'm working with SPC56EL60L3, and SPC5STUDIO v5.0. I need to have a section of code running from RAM, a function more specifically. How do I do this in SPC5Studio? I guess I need to add a directive like: __attribute__ ((section ('.ram_code'))) before the function declaration, where ram_code is the defined in the linker script. Could you, please, provide an example? Thank you. Regards Alessandro #spc5studio #ram #code #spc56 |
|
相关推荐
7个回答
|
|
亚历山德罗你好,
是的,我们在SPC5Studio中有一些例子 您必须通过创建自己的链接器文件来自定义application.ld:user.ld SPC560Dxx系列的应用程序向导中提供了一个示例 SPC560Dxx用于发现的OS-Less STANDBY SRAM测试应用程序 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Alessandro , Yes , we have some example in SPC5Studio you have to customize application.ld by creating your own linker file : user.ld An example has been provided in Application Wizard for SPC560Dxx family SPC560Dxx OS-Less STANDBY SRAM Test Application for Discovery Best regards Erwan |
|
|
|
你好,Erwan,
谢谢您的回复。 也许我错过了一些东西...... 我有SPC5Studio v5.3.1(刚刚更新) 我查看了SPC56DXX可用的exaples,但我找不到你提到的那个(下面的pciture显示我得到的) 无论如何,假设我的函数被称为myFun,我想我需要有类似的东西: __attribute __((section(''.ram_code'')))void myFun(void) { / *代码在这里* / } 其中ram_code是链接器文件中某处定义的部分,执行如下操作: .ram_code 0xADDRESSHERE:ALIGN(16)SUBALIGN(16) { __ram_code__ =。; *(。ram_code) *(ram_code。*) KEEP(*(。ram_code)) __ram_code_end__ =。; }> ramAm我做错了什么? 谢谢。 问候 亚历山德罗 以上来自于谷歌翻译 以下为原文 Hello Erwan, thank you for your reply. Perhaps I'm missing something... I have SPC5Studio v5.3.1 (just updated) I looked among the exaples avilable for SPC56DXX but I couldn't find the one you mentioned (the pciture below shows what I get) Anyway, supposing my function is called myFun, think I need to have something like: __attribute__ ((section (''.ram_code''))) void myFun( void ) { /* code here */ } where ram_code is a section defined somewhere in the linker file, doing something like: .ram_code 0xADDRESSHERE : ALIGN(16) SUBALIGN(16) { __ram_code__ = .; *(.ram_code) *(.ram_code.*) KEEP(*(.ram_code)) __ram_code_end__ = .; } > ramAm I doing something wrong? Thank you. Regards Alessandro |
|
|
|
亚历山德罗你好,
你能从官方更新站点安装HAL组件吗? 帮助==>安装新软件 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Alessandro , Could you install HAL components from the Official Update Site ? Help ==> Install new Software Best regards Erwan |
|
|
|
|
|
|
|
与此同时,我在我的代码中尝试了类似的例子。
我有一个声明如下的函数: __attribute __((section('.ramcode')))static int32_t CoreFlashIntegrityTest(void) 根据spc5Studio示例,“ramcode”部分在链接器文件中定义。 当我构建项目时,我从链接器获取此错误消息: core_test.c :(。text_vle.CorePost + 0x30):错误:重定位被截断以适合:R_PPC_VLE_REL24对`.ramcode' collect2:ld返回1退出状态任何人都可以告诉我发生了什么,这里? 我已经完成了一个小网页搜索,看起来它无法满足我将代码放入RAM的请求,因为区域地址不适合为地址位移保留的数字fof位(在这种情况下为24)。 。) 无论如何,我没有关于如何解决这个问题的线索。 谢谢。 问候 亚历山德罗 以上来自于谷歌翻译 以下为原文 In the meanwhile I tried to something like example, in my code. I got a function declared like this: __attribute__ ((section ('.ramcode'))) static int32_t CoreFlashIntegrityTest( void ) The section 'ramcode' is defined in the linker file, as per the spc5Studio example. When I build the project I get this error message, from the linker: core_test.c:(.text_vle.CorePost+0x30):error: relocation truncated to fit: R_PPC_VLE_REL24 against `.ramcode' collect2: ld returned 1 exit statusCan anyone tell me what's going on, here? I've done a litlle web-search and it looks like it's not able to fullfil my request of placing the code to RAM, since the section address does not fit in the number fof bits reserved for address displacement (24, in this case..) I have no clues on how to fix this, anyway.. Thank you. Regards Alessandro |
|
|
|
亚历山德罗你好,
这只是一个编译器安装问题。 有process_begin:CreateProcess(NULL,ppc-vle-gcc .. FAILED) 因为您正在尝试使用未安装在SPC5Studio上的hightec编译器 你可以重新开关到ppc - vle。 (免费gcc) 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Alessandro , It is just a compiler installation issue. There is process_begin: CreateProcess(NULL, ppc-vle-gcc .. FAILED) because you are trying to use hightec compiler not installed on your SPC5Studio you can reswitch to ppc--vle. (free gcc) Best Regards Erwan |
|
|
|
亚历山德罗你好,
对于free-gcc中的跳转问题, 在Common选项中使用-mlongcall选项 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Alessandro , for the jump issue in free-gcc, use -mlongcall option in Common options Best Regards Erwan |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3004 浏览 1 评论
3329 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1908 浏览 1 评论
3766 浏览 6 评论
6187 浏览 21 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
76浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
87浏览 5评论
109浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
77浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
80浏览 5评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-4-18 04:01 , Processed in 1.144160 second(s), Total 88, Slave 72 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191