完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你好,
有没有人使用Spirit1库(作为http://www.st.com/en/embedded-software/stsw-connect009.html的一部分提供)在使用免费工具链的STM8 MCU项目中取得了成功? 该库是用C99标准编写的,使用SDCC或COSMIC编译器不支持的功能。该库也是> 8kb,因此具有免费许可证的IAR编译器也会抛出错误。 感谢任何帮助, -大卫 以上来自于谷歌翻译 以下为原文 Hello, Has anyone had success using the Spirit1 library (provided as part of http://www.st.com/en/embedded-software/stsw-connect009.html) in a project for an STM8 MCU using a free toolchain? The library was written in the C99 standard and uses features that are not supported by the SDCC or COSMIC compilers. The library is also >8kb, so the IAR compiler with the free license also throws an error. Appreciate any help, -David |
|
相关推荐
4个回答
|
|
|
嗨,
使用-pc99命令行开关可以支持Cosmic编译器中的大多数C99功能:如果这还不够,请发布您得到的错误,我们将看到我们可以做什么。 问候, 卢卡 以上来自于谷歌翻译 以下为原文 Hi, using the -pc99 command line switch enables support of most of the C99 features in the Cosmic compiler: if this is not enough please post the error you get and we will see what we can do. Regards, Luca |
|
|
|
|
|
谢谢卢卡,
使用-pc99,我得到了一些使用Cosmic编译的错误。 Spirit1库中的以下文件和示例STM8实现在for循环中声明变量(即''for(int i =(cDataLength-1); i> = 0; i--)''),Cosmic编译器不处理: SPIRIT_Aes.c SPIRIT_Irq.c SPIRIT_PktBasic.c SPIRIT_pktcommon.c SPIRIT_pktstack.c SPIRIT_radio.c SDK_EVAL_Gpio.c SDK_EVAL_Spi_Driver.c 我将那些声明移到了满足编译器的for语句之外。这会改变这些变量的范围并可能导致问题,因为大多数这些函数都重用变量“i”。 在链接期间,我也会收到以下符号未定义的错误: #error clnk Debug spirit1_lib.lkf:1个符号_lroundf未定义(Debug spirit_radio.o) #error clnk Debug spirit1_lib.lkf:1个符号_pow未定义(Debug spirit_radio.o) #error clnk Debug spirit1_lib.lkf:未定义1个符号_log2(Debug spirit_radio.o) #error clnk Debug spirit1_lib.lkf:1个符号_round未定义(Debug spirit_radio.o) 我认为这些是c99中的标准数学函数。我在IAR< math.h>中看到对它们的引用。标题,但看起来它们从Cosmic< math.h>中丢失了头。你知道一个解决方法吗? 感谢您的帮助, -大卫 以上来自于谷歌翻译 以下为原文 Thanks Luca, With -pc99 the I get some errors compiling with Cosmic. The following files in the Spirit1 library and example STM8 implementation declare variables in for loops (i.e. ''for(int i = (cDataLength-1); i>=0; i--)''), which the Cosmic compiler does not handle: SPIRIT_Aes.c SPIRIT_Irq.c SPIRIT_PktBasic.c SPIRIT_pktcommon.c SPIRIT_pktstack.c SPIRIT_radio.c SDK_EVAL_Gpio.c SDK_EVAL_Spi_Driver.c I moved those declarations outside of the for statements which satisfies the compiler. This changes the scope of those variables and could cause issues since most of those functions reuse the variable ''i''. During linking I also get errors that the following symbols are not defined: #error clnk Debugspirit1_lib.lkf:1 symbol _lroundf not defined (Debugspirit_radio.o ) #error clnk Debugspirit1_lib.lkf:1 symbol _pow not defined (Debugspirit_radio.o ) #error clnk Debugspirit1_lib.lkf:1 symbol _log2 not defined (Debugspirit_radio.o ) #error clnk Debugspirit1_lib.lkf:1 symbol _round not defined (Debugspirit_radio.o ) I think these are standard math functions in c99. I see references to them in the IAR Thank you for the help, -David |
|
|
|
|
|
你好,
我确认不支持for循环中的变量声明。 至于链接器阶段的缺失符号,您提到的4个中的3个已经被支持(确保链接文件中的libf),第四个(lroundf())将在下一个版本中添加。 问候, 卢卡 以上来自于谷歌翻译 以下为原文 Hello, I confirm that the variable declaration in the for loop is not supported. As for the missing symbols at the linker stage, 3 out of the 4 that you mention are already supported (make sure you link the libf in the linker file) and the fourth (lroundf()) will be added in the next release. Regards, Luca |
|
|
|
|
|
您可能希望查看SDCC的当前开发版本而不是3.6.0版本。支持在3.6.0版本之后添加到SDCC的for循环中的变量声明。所以当前的开发版本(以及未来的3.7.0版本)都有它。
菲利普 以上来自于谷歌翻译 以下为原文 You might want to check with a current development version of SDCC instead of the 3.6.0 release. Support for variable declarations in for loops as been added to SDCC after the 3.6.0 release. So current development versions (and the future 3.7.0 release) have it. Philipp |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1456 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1505 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3652 浏览 1 评论
3844 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2463 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
730浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
665浏览 5评论
712浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
944浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
749浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 11:39 , Processed in 0.738347 second(s), Total 78, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
4938