完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
任何人都知道如何在宇宙编译器上使用@eeprom
是否支持@eeprom vu32 EE_Total; 以上通过了编译器,但如果我尝试使用它我会得到错误我也尝试过char和int但似乎没有工作。 我想读取和写入u23 u16和u8到EEPROM而不必担心指针等,似乎也有4字节结构。 以上来自于谷歌翻译 以下为原文 Anyone know how to use the @eeprom on the cosmic compiler Does it suppot @eeprom vu32 EE_Total; The above passed the complier but if I try to use it I get errors I've also tried char and int but none seem to work. I want to read and write u23 u16 and u8 to EEPROM without having to worry about pointer etc there also seems to be a 4 byte structure. |
|
相关推荐
8个回答
|
|
它应该像你写的那样工作;你得到了什么样的错误?
另请参阅本手册的第51页。 问候, 卢卡 以上来自于谷歌翻译 以下为原文 It should work as you wrote it; what kind of errors do you get? Also take a look at page 51 of the manual. Regards, Luca |
|
|
|
这是我在下面得到的错误,但只是我尝试在main.c中包含的另一个文件中的函数中使用它
所以我假设我必须将它声明为外部的某个地方? 运行链接器clnk -l''C: Program Files COSMIC CXSTM8_32K Lib'' - o Debug light_sensor.sm8 -mDebug light_sensor.map -eDebug light_sensor.err -p Debug light_sensor.lkf Debug light_sensor.err中报告的错误 以上来自于谷歌翻译 以下为原文 This is the error I get below but only whan I try to use it in function that is in another file that's included into main.c So I assume I have to declare it as external somewhere? Running Linker clnk -l''C:Program FilesCOSMICCXSTM8_32KLib'' -o Debuglight_sensor.sm8 -mDebuglight_sensor.map -eDebuglight_sensor.err -p Debuglight_sensor.lkf errors reported in Debuglight_sensor.err |
|
|
|
不管它甚至在main中都不起作用,即使我只是用数字加载它我得到相同的链接错误。
EE_totalPowerAcc = 0x00001201; / * * / 以上来自于谷歌翻译 以下为原文 No it doesn't work anyway even in main, even if I just load it with a number I get the same link error. EE_totalPowerAcc = 0x00001201; /* */ |
|
|
|
我发现如果我只编译主文件就可以了
如果我尝试构建完整项目,则链接器会失败。 这是通过编译main生成的代码 ; 384 FLASH_Unlock(FLASH_MEMTYPE_DATA); 3113 06fa a601 ld a,#1 3114 06fc cd0000调用_FLASH_Unlock 3116; 386 ee_test = 0x12; 3118 06ff ae0012 ldw x,#18 3119 0702 89 pushw x 3120 0703 ae0000 ldw x,#_ ee_test 3121 0706 cd0000 call c_eewrw 3123 0709 85 popw x 3124; 388 EE_totalPowerAcc = totalPowerAcc.l; 3126 070a ae0048 ldw x,#_ totalPowerAcc 3127 070d cd0000调用c_ltor 3129 0710 ae0004 ldw x,#_ EE_totalPowerAcc 3130 0713 cd0000致电c_eewrl 3132; 390 FLASH_Lock(FLASH_MEMTYPE_DATA); 3134 0716 a601 ld a,#1 3135 0718 cd0000致电_FLASH_Lock 由此 FLASH_Unlock(FLASH_MEMTYPE_DATA); ee_test = 0x12; EE_totalPowerAcc = totalPowerAcc.l; FLASH_Lock(FLASH_MEMTYPE_DATA); totalPowerAcc.l是u32的结构 以上来自于谷歌翻译 以下为原文 I found if I complie just the main file it's ok If I try to build the full project the linker fails. This is the code it produced by compiling the main ; 384 FLASH_Unlock(FLASH_MEMTYPE_DATA); 3113 06fa a601 ld a,#1 3114 06fc cd0000 call _FLASH_Unlock 3116 ; 386 ee_test = 0x12; 3118 06ff ae0012 ldw x,#18 3119 0702 89 pushw x 3120 0703 ae0000 ldw x,#_ee_test 3121 0706 cd0000 call c_eewrw 3123 0709 85 popw x 3124 ; 388 EE_totalPowerAcc = totalPowerAcc.l; 3126 070a ae0048 ldw x,#_totalPowerAcc 3127 070d cd0000 call c_ltor 3129 0710 ae0004 ldw x,#_EE_totalPowerAcc 3130 0713 cd0000 call c_eewrl 3132 ; 390 FLASH_Lock(FLASH_MEMTYPE_DATA); 3134 0716 a601 ld a,#1 3135 0718 cd0000 call _FLASH_Lock from this FLASH_Unlock(FLASH_MEMTYPE_DATA); ee_test = 0x12; EE_totalPowerAcc = totalPowerAcc.l; FLASH_Lock(FLASH_MEMTYPE_DATA); totalPowerAcc.l is a structure for a u32 |
|
|
|
生成的代码看起来没问题,但我需要更多细节来了解问题的来源:来自链接器的确切错误消息(显然STVD指示链接器将其报告给特定文件)以及可能两个文件的源代码(如果您还在尝试使用该配置)
以上来自于谷歌翻译 以下为原文 the generated code looks ok, but I need more details to understand where the problem comes from: the exact error message from the linker (apparently STVD directs the linker to report this into a specific file) and possibly the source code for both files (if you are still trying with that configuration) |
|
|
|
看起来没有看到标题
错误clnk Debug light_sensor.lkf:1符号_FLASH_CR2未定义((C: Program Files COSMIC CXSTM8_32K Lib libm0.sm8)eepwrl.o(C: Program Files COSMIC CXSTM8_32K Lib libm0.sm8 )eeprom.o) 错误clnk Debug light_sensor.lkf:1符号_FLASH_NCR2未定义((C: Program Files COSMIC CXSTM8_32K Lib libm0.sm8)eepwrl.o(C: Program Files COSMIC CXSTM8_32K Lib libm0.sm8 )eeprom.o) error clnk Debug light_sensor.lkf:1个符号_FLASH_IAPSR未定义((C: Program Files COSMIC CXSTM8_32K Lib libm0.sm8)eepwrl.o(C: Program Files COSMIC CXSTM8_32K Lib libm0.sm8 )eeprom.o) 似乎链接器找不到eeprom.i文件,我也遇到了使用assert_param()的任何lib文件的问题,编译器无法修复原型,当我将它添加到我的配置文件时,它给出了许多ramdom错误。 我对这个编译器和ST部分的实验一直很糟糕,因为我不认为我会购买Cosmic编译器。 / *导出类型---------------------------------------------- -------------- * / / *导出的常量---------------------------------------------- ---------- * / / *取消注释下面的行以扩展''assert_param''中的宏 标准外设库驱动程序代码* / #define USE_FULL_ASSERT(1)/ *导出的宏---------------------------------------- -------------------- * / #ifdef USE_FULL_ASSERT / ** * @brief assert_param宏用于函数的参数检查。 * @param expr:如果expr为false,则调用assert_failed函数 *报告源文件的名称和来源 *失败的呼叫的行号。 *如果expr为true,则不返回任何值。 * @retval:无 * / #define assert_param(expr)((expr)?(void)0:assert_failed((uint8_t *)__ FILE __,_ _ _ __)) / *导出的函数---------------------------------------------- --------- * / void assert_failed(uint8_t * file,uint32_t line); #其他 #define assert_param(expr)((void)0) #endif / * USE_FULL_ASSERT * / 以上来自于谷歌翻译 以下为原文 Look like the header is not seen error clnk Debuglight_sensor.lkf:1 symbol _FLASH_CR2 not defined ((C:Program FilesCOSMICCXSTM8_32KLiblibm0.sm8)eepwrl.o (C:Program FilesCOSMICCXSTM8_32KLiblibm0.sm8)eeprom.o ) error clnk Debuglight_sensor.lkf:1 symbol _FLASH_NCR2 not defined ((C:Program FilesCOSMICCXSTM8_32KLiblibm0.sm8)eepwrl.o (C:Program FilesCOSMICCXSTM8_32KLiblibm0.sm8)eeprom.o ) error clnk Debuglight_sensor.lkf:1 symbol _FLASH_IAPSR not defined ((C:Program FilesCOSMICCXSTM8_32KLiblibm0.sm8)eepwrl.o (C:Program FilesCOSMICCXSTM8_32KLiblibm0.sm8)eeprom.o ) It seems that linker can not find the eeprom.i file also I'm having problems with the any of the lib file that use the assert_param() the compiler can't fimd the prototype and when I add it to my config file it give many ramdom error. My experiance of this compiler and the ST part has been very poor thinking of droping the Cosmic compiler for sure I don't think I'll be purchasing it. /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Uncomment the line below to expanse the ''assert_param'' macro in the Standard Peripheral Library drivers code */ #define USE_FULL_ASSERT (1) /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT/** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source * line number of the call that failed. * If expr is true, it returns no value. * @retval : None */ #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0) #endif /* USE_FULL_ASSERT */ |
|
|
|
仍然没有任何任何想法为什么链接器没有看到eeprom.i文件?
以上来自于谷歌翻译 以下为原文 Stll not working anyone any ideas why the linker doesn't see the eeprom.i file? |
|
|
|
嗨,
我有同样的问题。 这个问题已经解决了吗? 以上来自于谷歌翻译 以下为原文 Hi, I am having the same problem. Has this issue been resolved? |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2751 浏览 1 评论
3244 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1814 浏览 1 评论
3655 浏览 6 评论
6046 浏览 21 评论
1342浏览 4评论
204浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
360浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
451浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
277浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-30 10:54 , Processed in 1.636132 second(s), Total 90, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号