完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我在跑
ST库IEC60335 STM8AS v1.1.0在STM8S105C6中。 RAM March X定期测试失败,我认为库中存在错误。 B类RAM(来自 通过''ClassBTestStatus STL_TranspMarchX(void)''函数从tiM4中断检查CLASS_B_START = 0x10到CLASS_B_END = 0x7F)。 首先,它将6个字节从B类RAM复制到RunTimeRamBuf [RT_RAM_BUF_SIZE] @''RUN_TIME_RAM_CHCK''。部分RUN_TIME_RAM_CHCK位于0x00-0x0F。 这是将6个字节从B类RAM复制到RunTimeRamBuf的循环: / * ------------------常规记忆自检----------------------- * / /* - - - - - - - - - - - - - - 步骤1 - - - - - - - - - --------------- * / / *保存要测试的6个字节的内容并启动MarchC- 写地址增加的背景* / p_StartRamBlock p_RunTimeRamChk; p_EndRamBlock p_RunTimeRamChk RT_RAM_BLOCKSIZE; 一世 1U ; { RunTimeRamBuf [我 ] p_RunTimeRamChk; p_RunTimeRamChk BCKGRND; } (p_RunTimeRamChk p_EndRamBlock); p_StartRamBlock和p_EndRamBlock是放置在虚拟寄存器(0x80)的局部变量。 p_RunTimeRamChk是放在B类RAM中的全局变量,我的链接器将它放在@ 0x10。此变量用于上述循环,复制B类RAM,然后在其中写入BCKGRND(= 0),因此循环写入控制循环的变量。结果:它开始从0x10到0x01复制6个字节,从0x10到0x15写入0,但是当循环在0x10中写入0时,它在p_RunTimeRamChk中写入0。循环复制超过6个字节,RAM已损坏。 这个由VDE认证的库是否有错误???? 问候 以上来自于谷歌翻译 以下为原文 I'm running ST library IEC60335 STM8AS v1.1.0 in a STM8S105C6. RAM March X periodic test is failing, I think there is an error in the library. Class B RAM (from CLASS_B_START=0x10 to CLASS_B_END=0x7F) is checked from TIM4 interrupt by ''ClassBTestStatus STL_TranspMarchX(void)'' function. Firstly it copies 6 bytes from Class B RAM to RunTimeRamBuf[RT_RAM_BUF_SIZE] @ ''RUN_TIME_RAM_CHCK''. Section RUN_TIME_RAM_CHCK is placed at 0x00-0x0F. This is the loop that copies 6 bytes from Class B RAM to RunTimeRamBuf: /* ------------------ Regular memory Self-check ----------------------- */ /*---------------------------- STEP 1 --------------------------------- */ /* Save the content of the 6 bytes to be tested and start MarchC- Write background with addresses increasing */ p_StartRamBlock p_RunTimeRamChk; p_EndRamBlock p_RunTimeRamChk RT_RAM_BLOCKSIZE; i 1u ; { RunTimeRamBuf[i ] p_RunTimeRamChk; p_RunTimeRamChk BCKGRND; } (p_RunTimeRamChk p_EndRamBlock); p_StartRamBlock and p_EndRamBlock are local variables placed at virtual registers (0x80…). p_RunTimeRamChk is a global variable placed at Class B RAM, my linker places it @0x10. This variable is used in the above loop that copies Class B RAM and then writes BCKGRND (=0) in it, so the loop is writing to the variable that controls the loop. Result: it starts copying 6 bytes from 0x10 to 0x01 and writing 0 from 0x10 to 0x15, but when the loop writes 0 in 0x10 it is writing 0 in p_RunTimeRamChk. The loop copies more than 6 bytes and RAM is corrupted. Is there an error in this library certified by VDE???? Regards |
|
相关推荐
6个回答
|
|
p_RunTimeRamChk&由于您遇到的问题,它的反转应该精确地放在“CLASS_B”部分的外面。
JDF 以上来自于谷歌翻译 以下为原文 p_RunTimeRamChk & its inversion should be placed OUTSIDE the ''CLASS_B'' sections precisely because of the problem you're seeing. jdf |
|
|
|
OK John,但是这个变量放在ST库的B类RAM中。也许它必须存在,因为它是强制性的。我使用一个局部变量来保持其值,同时测试RAM。
我认为有更多错误,循环写入B类RAM之外,因此RAM再次损坏,等等。 我希望这是我的错误,或者我不相信这个库是VDE认证的。 最好的祝福 以上来自于谷歌翻译 以下为原文 OK John, but this variable is placed inside class B RAM in the ST library. Maybe it must be there because it is mandatory. I use a local variable that holds its value while RAM is being tested. I think there are more errors, the loop writes outside class B RAM, so RAM is again corrupted, etc. I hope it is my mistake, or I can't believe this library is VDE certified. Best regards |
|
|
|
这是一个来自stm8s_stl_classB_var.h的片段,其中p_RunTimeRamChk及其反演在部分.RUN_TIME_BUF中声明。我在图书馆本身非常知己(我有一个项目在UL60730下使用它和另一个正在进行中的认证)但是演示项目ST提供似乎遗漏了一些重要的东西。例如,Cosmic演示项目stm8_903.stp和stm8s_105.stp不声明RUN_TIME_BUF部分。更不用说更改链接器文件,我总是在其中发现特定的挑战。我使用Cosmic for stm8& st7开发所以不能对别人提出意见。 (我可以而且经常这样做,但他们没有价值)。
如果您仍然遇到困难,请发送项目文件(* .stp)的副本以及您对stl_classB_var.h&我很乐意看一看。 玩的开心 JDF / ** ************************************************** **************************** * @file stm8s_stl_classB_var.h * @brief此文件包含所有B类变量的定义 * @author STMicroelectronics - MCD应用团队 * @version V1.1.0 * @date MAY-2012 ************************************************** **************************** * @copyright * *< h2>< center>& copy; COPYRIGHT 2012 STMicroelectronics< / center>< / h2> * *根据MCD-ST Liberty SW许可协议V2(“许可证”)获得许可; *除非符合许可,否则您不得使用此文件。 *您可以在以下位置获取许可证副本: * * http://www.st.com/software_license_agreement_liberty_v2 * *除非适用法律要求或书面同意,否则软件 *根据许可证分发,按“原样”分配, *不附带任何明示或暗示的保证或条件。 *有关管理权限的特定语言,请参阅许可证 *许可证下的限制。 * / / *定义以防止递归包含------------------------------------- * / #ifndef __STL_CLASS_B_VAR_H #define __STL_CLASS_B_VAR_H #include''stm8s_stl_param.h'' / *这避免了多次定义的全局变量* / #ifdef ALLOC_GLOBALS #define EXTERN #其他 #define EXTERN extern #万一 / *包括----------------------------------------------- ------------------- * / / *导出类型---------------------------------------------- -------------- * / / *导出的常量---------------------------------------------- ---------- * / / *导出的宏---------------------------------------------- -------------- * / / *导出的函数---------------------------------------------- --------- * / / *全局变量---------------------------------------------- ----------- * / / *透明运行时测试期间使用的临时RAM缓冲区* / / *警告:实际保留的RAM位置从0x ....到0x .... * / / * ================================================ ============================== * / / * MISRA违反规则8.5 - B类变量仅在一个地方定义 在stm8l_stl_startup.c文件的开头定义,所有其他文件都包含此文件 标题作为共同参考* / #ifdef _IAR_ #pragma diag_suppress = Pm123 #endif / * _IAR_ * / #ifdef _COSMIC_ #pragma section @near [RUN_TIME_BUF] / *在运行时测试期间存储原始RAM内容的缓冲区* / EXTERN @near u8 RunTimeRamBuf [RT_RAM_BUF_SIZE]; / *运行时测试的RAM指针* / EXTERN @near u8 * p_RunTimeRamChk; EXTERN @near u8 * p_RunTimeRamChkInv; #ifdef STL_VERBOSE EXTERN @near u16 FreqDifDisplay; //不是真正的B类变量,但对调试很有用 #endif / * STL_VERBOSE * / #pragma section @near [CLASS_B] 接近u16 MarchOverlayGap; / *因三月测试叠加导致内存空白* / 以上来自于谷歌翻译 以下为原文 Here is a snippet from stm8s_stl_classB_var.h where p_RunTimeRamChk and its inversion are declared in section .RUN_TIME_BUF.. I'm quite confidant in the library itself (I have one project certified under UL60730 using it & another in progress) however the demo projects as provided by ST seem to leave out some important stuff. For example the Cosmic demo projects stm8_903.stp and stm8s_105.stp do not declare the RUN_TIME_BUF section. Not to mention changing the linker files around which I've always found a particular challenge. I use Cosmic for stm8 & st7 development so cannot offer opinions on others. (well I could and often do, but they'd be of no value). If you continue to have difficulty send a copy of your project file(*.stp) and any changes you've made to stl_classB_var.h & I'd be happy to take a look. Have fun jdf /** ****************************************************************************** * @file stm8s_stl_classB_var.h * @brief This file contains definition all class B variables * @author STMicroelectronics - MCD Application Team * @version V1.1.0 * @date MAY-2012 ****************************************************************************** * @copyright * * |
|
|
|
谢谢约翰
变量是为3个编译器定义的,它们放在不同的部分,Cosmic定义似乎很好,但看看IAR定义: 的#ifdef _IAR_ EXTERN u8 RunTimeRamBuf [RT_RAM_BUF_SIZE] @ '' RUN_TIME_RAM_CHCK '' ; / *运行时测试的RAM指针* / EXTERN U8 p_RunTimeRamChkB @ '' CLASS_B_RAM '' ; EXTERN U8 p_RunTimeRamChkInv @ '' CLASS_B_RAM_REV '' ; 的#ifdef STL_VERBOSE EXTERN u16 FreqDifDisplay; / *不是真正的B类变量,但对于调试很有用* / #万一 / * STL_VERBOSE * / 接近u16 MarchOverlayGap @''CLASS_B_RAM'' ; / *因三月测试叠加导致内存空白* / EXTERN u16 CtrlFlowCnt @ '' CLASS_B_RAM '' ; / *启动时的程序流程执行* / EXTERN u16 ISRCtrlFlowCnt @ '' CLASS_B_RAM '' ; / *中断程序流程执行* / EXTERN u16 LSI_HSIStartUpFreqkHz @ '' CLASS_B_RAM '' ; / *首先测量存储在HSI上的LSI * / EXTERN u16 LSI_HSEStartUpFreqkHz @ '' CLASS_B_RAM '' ; / *首先测量存储HSE的LSI * / EXTERN u16 LSI_StartUpPeriod @ '' CLASS_B_RAM '' ; / * LSI的初始测量 - 运行时检查的参考* / EXTERN u16 TickCounter @ '' CLASS_B_RAM '' ; / *主程序中使用的软件时基(SysTick ISR)* / EXTERN u8 TimeBaseFlag @ '' CLASS_B_RAM '' ; / *表示主程序为100ms tick * / EXTERN u16 LastCtrlFlowCnt @ '' CLASS_B_RAM '' ; / *控制流量计数器从一个主循环到另一个主循环* / EXTERN U8 p_RunCrc16Chk @ '' CLASS_B_RAM '' ; / *用于crc16运行时测试的FLASH指针* / EXTERN u16 CurrentCrc16 @ '' CLASS_B_RAM '' ; / *当前FLASH 16位Crc * / EXTERN u16 CurrentDesc @ '' CLASS_B_RAM '' ; / *当前描述符地址* / EXTERN u16 CRCBlockIndex @ '' CLASS_B_RAM '' ; / *部分CRC测试所需的计数器* / 接近u16 MarchOverlayGap_ @''CLASS_B_RAM'' ; / *因三月测试叠加导致内存空白* / EXTERN u8 StackOverFlowPtrn [ 4 ] @ '' STACK_BOTTOM '' ; / *此数组中堆栈溢出的魔术模式* / 接近u16 MarchOverlayGapInv @''CLASS_B_RAM_REV'' ; EXTERN u16 CtrlFlowCntInv @ '' CLASS_B_RAM_REV '' ; EXTERN u16 ISRCtrlFlowCntInv @ '' CLASS_B_RAM_REV '' ; EXTERN u8 LSI_HSIStartUpFreqkHzInv @ '' CLASS_B_RAM_REV '' ; EXTERN u8 LSI_HSEStartUpFreqkHzInv @ '' CLASS_B_RAM_REV '' ; EXTERN u16 LSI_StartUpPeriodInv @ '' CLASS_B_RAM_REV '' ; EXTERN u16 TickCounterInv @ '' CLASS_B_RAM_REV '' ; EXTERN u8 TimeBaseFlagInv @ '' CLASS_B_RAM_REV '' ; EXTERN u16 LastCtrlFlowCntInv @ '' CLASS_B_RAM_REV '' ; EXTERN U8 p_RunCrc16ChkInv @ '' CLASS_B_RAM_REV '' ; EXTERN u16 CurrentCrc16Inv @ '' CLASS_B_RAM_REV '' ; EXTERN u16 CurrentDescInv @ '' CLASS_B_RAM_REV '' ; EXTERN u16 CRCBlockIndexInv @ '' CLASS_B_RAM_REV '' ; 接近u16 MarchOverlayGapInv_ @''CLASS_B_RAM_REV'' ; #万一 / * _IAR_ * / 我认为 p_RunTimeRamChkB IAR编译器的放置是错误的。 我应该使用Cosmic编译器吗? 最好的祝福 以上来自于谷歌翻译 以下为原文 Thank you John Variables are defined for 3 compilers and they are placed in different sections, the Cosmic definition seems good, but take a look at the IAR definition: #ifdef _IAR_ EXTERN u8 RunTimeRamBuf[RT_RAM_BUF_SIZE] @ ''RUN_TIME_RAM_CHCK'' ; /* RAM pointer for run-time tests */ EXTERN u8 p_RunTimeRamChkB @ ''CLASS_B_RAM'' ; EXTERN u8 p_RunTimeRamChkInv @ ''CLASS_B_RAM_REV'' ; #ifdef STL_VERBOSE EXTERN u16 FreqDifDisplay; /* Not reallya Class B variable, but useful for debugging */ #endif /* STL_VERBOSE */ EXTERN NEAR u16 MarchOverlayGap @ ''CLASS_B_RAM'' ; /* gap in memory due to March test overlay */ EXTERN u16 CtrlFlowCnt @ ''CLASS_B_RAM'' ; /* program flow execution at start */ EXTERN u16 ISRCtrlFlowCnt @ ''CLASS_B_RAM'' ; /* program flow execution in interrupt */ EXTERN u16 LSI_HSIStartUpFreqkHz @ ''CLASS_B_RAM'' ; /* First measure LSI over HSI stored */ EXTERN u16 LSI_HSEStartUpFreqkHz @ ''CLASS_B_RAM'' ; /* First measure LSI over HSE stored */ EXTERN u16 LSI_StartUpPeriod @ ''CLASS_B_RAM'' ; /* Initial measure of LSI - reference for run-time checks */ EXTERN u16 TickCounter @ ''CLASS_B_RAM'' ; /* Sofware time base used in main program (SysTick ISR) */ EXTERN u8 TimeBaseFlag @ ''CLASS_B_RAM'' ; /* Indicates to the main routine a 100ms tick */ EXTERN u16 LastCtrlFlowCnt @ ''CLASS_B_RAM'' ; /* Control flow counter from one main loop to the other */ EXTERN u8 p_RunCrc16Chk @ ''CLASS_B_RAM'' ; /* Pointer to FLASH for crc16 run-time tests */ EXTERN u16 CurrentCrc16 @ ''CLASS_B_RAM'' ; /* Current FLASH 16-bit Crc */ EXTERN u16 CurrentDesc @ ''CLASS_B_RAM'' ; /* Current Descriptor Address */ EXTERN u16 CRCBlockIndex @ ''CLASS_B_RAM'' ; /* Counter needed for partial CRC test */ EXTERN NEAR u16 MarchOverlayGap_ @ ''CLASS_B_RAM'' ; /* gap in memory due to March test overlay */ EXTERN u8 StackOverFlowPtrn[ 4 ] @ ''STACK_BOTTOM'' ; /* Magic pattern for Stack overflow in this array */ EXTERN NEAR u16 MarchOverlayGapInv @ ''CLASS_B_RAM_REV'' ; EXTERN u16 CtrlFlowCntInv @ ''CLASS_B_RAM_REV'' ; EXTERN u16 ISRCtrlFlowCntInv @ ''CLASS_B_RAM_REV'' ; EXTERN u8 LSI_HSIStartUpFreqkHzInv @ ''CLASS_B_RAM_REV'' ; EXTERN u8 LSI_HSEStartUpFreqkHzInv @ ''CLASS_B_RAM_REV'' ; EXTERN u16 LSI_StartUpPeriodInv @ ''CLASS_B_RAM_REV'' ; EXTERN u16 TickCounterInv @ ''CLASS_B_RAM_REV'' ; EXTERN u8 TimeBaseFlagInv @ ''CLASS_B_RAM_REV'' ; EXTERN u16 LastCtrlFlowCntInv @ ''CLASS_B_RAM_REV'' ; EXTERN u8 p_RunCrc16ChkInv @ ''CLASS_B_RAM_REV'' ; EXTERN u16 CurrentCrc16Inv @ ''CLASS_B_RAM_REV'' ; EXTERN u16 CurrentDescInv @ ''CLASS_B_RAM_REV'' ; EXTERN u16 CRCBlockIndexInv @ ''CLASS_B_RAM_REV'' ; EXTERN NEAR u16 MarchOverlayGapInv_ @ ''CLASS_B_RAM_REV'' ; #endif /* _IAR_ */ I think p_RunTimeRamChkB placement is wrong for IAR compiler. Should I use Cosmic compiler? Best regards |
|
|
|
你好
当我阅读你的帖子时,我最初的反应是建议你使用你最熟悉的编译器。但在仔细观察IAR部件后,我不确定。如果你正在寻找UL认证,他们不会盲目接受VDE证书,所以你可以修复IAR的东西虽然我不知道我从哪里开始,因为我只使用了三星Sam8的IAR。 我正在使用Rev1.0.3,这是我开始时的最新版本。通过UL必须测试一切,所以缺乏VDE不是问题。我确实尝试编译Rev1.1.0的演示项目。只有103& 207_208会建立。 105& 903在链接时出错,因为未定义段RUN_TIME_BUF。虽然容易修复。 这是我提供的ST提供代码的典型经验。没有详细记录和经过测试,如果可以,最好避免。 STVD虽然是我最喜欢的IDE。当然我只用它来编译&调试但很少使用粗话。 我真的很抱歉,我无法给你一些明确的答案。如果可以,请使用Cosmic,16k免费版本是好的。 JDF 以上来自于谷歌翻译 以下为原文 Hi When I read your post my initial reaction was to recommend you use the compiler you're most familiar with. But after looking at the IAR parts more closely I'm not sure. If you're looking for certification under UL they won't blindly accept the VDE certificate so you could fix the IAR stuff though I'm not sure where I'd start as I've only used IAR with the Samsung Sam8. I'm using Rev1.0.3 which was current when I started & going through UL had to test everything anyway so the lack of VDE wasn't an issue. I did try to compile the demo projects for Rev1.1.0. Only the 103 & 207_208 would build. The 105 & 903 errored out at link time because segment RUN_TIME_BUF isn't defined. Easily fixable though. This is typical of my experience with ST provided code. Not well documented & tested and best avoided if you can. STVD though is my favorite IDE. Of course I only use it for compiling & debugging but rarely use foul language while doing so. I'm really sorry I couldn't give you some definitive answer. Use Cosmic if you can, the 16k free version is good. jdf |
|
|
|
也
在第314行的stm8s_stl_param.h中 / *透明三月测试所需的常量* / #define CL_B_START 0x10u / *专用于B类变量的存储区* / #define CL_B_END 0x7fu 这些将需要调整以考虑不同项目/编译器中的加载地址 JDF 以上来自于谷歌翻译 以下为原文 ALSO in stm8s_stl_param.h at line 314 /* Constants necessary for Transparent March tests */ #define CL_B_START 0x10u /* memory area dedicated for Class B variables */ #define CL_B_END 0x7fu These'll need to be adjusted to account for load address in different projects/compilers jdf |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2629 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1782 浏览 1 评论
3607 浏览 6 评论
5987 浏览 21 评论
938浏览 4评论
1314浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
582浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1302浏览 3评论
1356浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-21 02:29 , Processed in 1.114902 second(s), Total 87, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号