完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
嗨,
我正在使用STM8S评估板和Swim-Rlink调试器。 运行程序后,当我说“停止程序”时,我收到此错误: 错误:gdi-error [40121]:写入操作后验证闪存失败。 你能告诉我为什么会这样吗?怎么了?怎么解决? 附加错误的屏幕截图。 谢谢, -su 以上来自于谷歌翻译 以下为原文 Hi, I am using the STM8S eval board and Swim-Rlink debugger. After running the program, when I say ''stop program'', I receive this error: Error: gdi-error[40121]: verification of flash memory failed after write operation. Can you plz tell me why is it so? What's wrong and how to fix it? Attaching a screen shot of the error. Thanks, -SU |
|
|
|
另一个i / p。在进行与时钟相关的设置时,似乎出现了问题。
请注意,在我的STVD项目设置中(以及使用STVP下载代码时),我选择了MCU作为STM8AF519A。 但是,评估板有MCU STM8S208MBT6B。 1)就调试而言,它有什么区别? 2)在进一步研究的同时,我需要采取哪些设置/注意事项(考虑使用STM8S208MBT6B MCU评估板,但是为STM8AF519A编写的代码)? 提前致谢。 -su [此消息由:sandeep.undale于18-06-2009 16:27编辑] 以上来自于谷歌翻译 以下为原文 Another i/p. Seems the things are getting wrong while doing clock related settings. Please note that in my STVD project settings(& while downloading code using STVP), i've selected MCU as STM8AF519A. However, the eval board has MCU STM8S208MBT6B. 1) What difference does it make as far as debugging is concerned? 2) While going further, what settings/care do I need to take(considering am using the STM8S208MBT6B MCU eval board, but code written for STM8AF519A)? Thanks in advance. -SU [ This message was edited by: sandeep.undale on 18-06-2009 16:27 ] |
|
|
|
关于第一个问题 -
错误:gdi-error [40121]:写入操作后验证闪存失败。 你在代码中编写程序存储器吗? 第二个问题 - 1)就调试而言,它有什么区别? >>>在调试方面,你不会看到任何差异。 2)在进一步研究的同时,我需要采取哪些设置/注意事项(考虑使用STM8S208MBT6B MCU评估板,但是为STM8AF519A编写的代码)? >>> STM8AF519A(96K)具有较少的程序存储器w.r.t.到STM8S208MBT6B(128K)。请注意代码大小不超过96K的限制。此外,STM8S208xxx是一款非汽车设备。另一方面,STM8AF9A是一种汽车设备。因此,请参阅STM8A参考手册和设备功能的数据表。 以上来自于谷歌翻译 以下为原文 Regarding the 1st question- Error: gdi-error[40121]: verification of flash memory failed after write operation. Are you writing the program memory in your code? 2nd question- 1) What difference does it make as far as debugging is concerned? >>> On the debugging side, you wont see any difference. 2) While going further, what settings/care do I need to take(considering am using the STM8S208MBT6B MCU eval board, but code written for STM8AF519A)? >>> STM8AF519A(96K) has less program memory w.r.t. to STM8S208MBT6B(128K). Take care that code size does not exceed the limit of 96K. Moreover STM8S208xxx is a non-automotive device. On the other hand, STM8AF9A is an automotive device. So refer the STM8A reference manual and the datasheet for the device features. |
|
|
|
以下是与时钟控制器相关的问题的答案 -
1)CLK-> ICKR = CLK_ICKR_RESET_VALUE; //(U8)0×01 无法将0x01写入CLK-> ICKR。它仍然是0x03。 即,虽然我只想设置ICKR(内部时钟寄存器)的''HSIEN(高速内部RC振荡器使能)'位,但h / w也设置''HSIRDY(高速内部振荡器就绪)' '有点。 >>>>您无法通过软件清除HSIRDY位。该位由硬件控制。实际上,您可以通过软件清除HSIEN位。但是HSIEN位在以下条件下无法清除: - 由CSS激活为安全振荡器时。 - 切换到HSI时钟时(参见CLK_SWR寄存器)。 - 选择HSI作为有效CCO源时(参见CLK_CCOR寄存器)。 当HSI被选为时钟主机(CLK_CMSR寄存器),有源CCO源或安全振荡器(AUX)被使能时,它不能被清除。 复位后,HSI是可用的默认时钟源,直到您切换到其他时钟源。 2)当我尝试这样做时发生错误: CLK-> SWR =(u8)CLK_SOURCE_HSE; // 0xB4 即,在选择HSE作为主时钟源时。 >>>要执行时钟切换到HSE,请按照下列步骤操作: SWCR | = 0x02; SWR = 0xb4; while((SWCR& 0x01)); //等待SWBSY被清除 这是否意味着为了调试目的,我需要选择HSI作为主时钟源? >>>不,您可以按照上述步骤切换到HSE。 以上来自于谷歌翻译 以下为原文 Following are the answers to your questions related to the clock controller- 1) CLK->ICKR = CLK_ICKR_RESET_VALUE; //(u8)0x01 Not able to write 0x01 to CLK->ICKR. It remains 0x03. i.e., While I want to set only the ''HSIEN(High speed internal RC oscillator enable)'' bit of ICKR(Internal clock register), the h/w is also setting the ''HSIRDY(High speed internal oscillator ready)'' bit. >>>> You can not clear the HSIRDY bit by software. This bit is controlled by the hardware. Infact you can clear the HSIEN bit by software. But HSIEN bit can not be cleared under following conditions: - When activated as safe oscillator by the CSS. - When switching to HSI clock (see CLK_SWR register). - When HSI is selected as the active CCO source (see CLK_CCOR register). It cannot be cleared when HSI is selected as clock master (CLK_CMSR register), as active CCO source or if the safe oscillator (AUX) is enabled. After reset, the HSI is the default clock source available until you switch to other clock source. 2) The error occurs when I try to do this: CLK->SWR = (u8)CLK_SOURCE_HSE; //0xB4 i.e. while selecting HSE as master clock source. >>> To perform the clock switching to HSE, follow these steps: SWCR |= 0x02; SWR = 0xb4; while((SWCR & 0x01)); // wait for SWBSY to get cleared Does this mean that for debugging purpose, I need to select HSI as master clock source? >>> No, you can switch to HSE by following the above steps. |
|
|
|
感谢您的所有输入Jatin以及快速回复。
不幸的是,它不起作用。 错误,''gdi-error [40121]:写操作后闪存验证失败。'',一旦执行此语句就会发生: / *高速外部时钟* / CLK-> SWR =(u8)CLK_SOURCE_HSE; // SWR = 0xb4; 奥基。这正是我在做的事情: 1)编译代码并使用STVP工具下载。 (STVP:打开.s19文件(可以看到'程序存储器'选项卡下的编程十六进制指令),程序 - >所有选项卡,已完成。) *对于STVP配置,请检查附件(选择STM8S208xB)。 2)STVD项目设置:MCU选择适用于STM8AF519A。所以我可以在调试时选择MCU的外设寄存器。 3)开始调试。 这是clk init代码,直到它中断: 码: < BR> CLK_Source_TypeDef clock_master; < BR> u16 u16_Down_Counter = CLK_TIMEOUT; < BR> ErrorStatus Swif = ERROR; < BR> < BR> < BR> / *配置时钟* /< BR> < BR> < BR> CLK-> ICKR = CLK_ICKR_RESET_VALUE; < BR> CLK-> ECKR = CLK_ECKR_RESET_VALUE; < BR> CLK-> SWR = CLK_SWR_RESET_VALUE; < BR> CLK-> SWCR = CLK_SWCR_RESET_VALUE; < BR> CLK-> CKDIVR = CLK_CKDIVR_RESET_VALUE; < BR> CLK-> PCKENR1 = CLK_PCKENR1_RESET_VALUE; < BR> CLK-> PCKENR2 = CLK_PCKENR2_RESET_VALUE; < BR> CLK-> CSSR = CLK_CSSR_RESET_VALUE; < BR> < BR> CLK-> CCOR = CLK_CCOR_RESET_VALUE; < BR> (CLK-> CCOR& CLK_CCOR_CCOEN)< BR> {}< BR> CLK-> CCOR = CLK_CCOR_RESET_VALUE; < BR> < BR> CLK-> CANCCR = CLK_CANCCR_RESET_VALUE; < BR> CLK-> HSITRIMR = CLK_HSITRIMR_RESET_VALUE; < BR> CLK-> SWIMCCR = CLK_SWIMCCR_RESET_VALUE; < BR> < BR> < BR> < BR> / *在CLK_CCO引脚上输出Fcpu * /< BR> / *清除CCO类型位部分* /< BR> CLK-> CCOR& =(u8)(~CLK_CCOR_CCOSEL); < BR> < BR> / *选择源* /< BR> CLK-> CCOR | =(u8)CLK_OUTPUT_MASTER; < BR> < BR> < BR> / *当前时钟主节省* /< BR> clock_master =(CLK_Source_TypeDef)CLK-> CMSR; < BR> < BR> / *自动切换模式管理* /< BR> / *启用时钟切换* /< BR> CLK-> SWCR | = CLK_SWCR_SWEN; < BR> < BR> / *禁用开关中断* /< BR> CLK-> SWCR& =(u8)(~CLK_SWCR_SWIEN); < BR> < BR> while((CLK-> SWCR& 0x01)); //等待SWBSY被清除< BR> < BR> / *目标时钟源的选择* /< BR> < BR> / *高速外部时钟* /< BR> CLK-> SWR =(u8)CLK_SOURCE_HSE; ---->错误发生在这里! < BR> < BR> 当我收到你的更新时,我会继续使用HSI。 感谢你的帮助。 问候, SU [此消息由:sandeep.undale于19-06-2009 16:39编辑] 以上来自于谷歌翻译 以下为原文 Thanks for all your inputs Jatin and also for quick reply. Unfortunately, it doesn't work. The error,''gdi-error[40121]: verification of flash memory failed after write operation.'', occurs as soon as this statement is executed: /* High Speed External clock */ CLK->SWR = (u8)CLK_SOURCE_HSE; //SWR = 0xb4; Okey. Here is exactly what I am doing: 1) Compile the code and download it using the STVP tool. (STVP: Open .s19 file(can see the prog hex instructions under 'program memory' tab), Program -> All tabs, done.) *For STVP config, check the attachment(selected STM8S208xB). 2) STVD project settings: MCU selection is for STM8AF519A. So I am able to selected MCU's peripheral registers while debugging. 3) Start debugging. Here is the clk init code till it breaks: Code: CLK_Source_TypeDef clock_master; u16 u16_Down_Counter = CLK_TIMEOUT; ErrorStatus Swif = ERROR; /* Configure Clock */ CLK->ICKR = CLK_ICKR_RESET_VALUE; CLK->ECKR = CLK_ECKR_RESET_VALUE; CLK->SWR = CLK_SWR_RESET_VALUE; CLK->SWCR = CLK_SWCR_RESET_VALUE; CLK->CKDIVR = CLK_CKDIVR_RESET_VALUE; CLK->PCKENR1 = CLK_PCKENR1_RESET_VALUE; CLK->PCKENR2 = CLK_PCKENR2_RESET_VALUE; CLK->CSSR = CLK_CSSR_RESET_VALUE; CLK->CCOR = CLK_CCOR_RESET_VALUE; while (CLK->CCOR & CLK_CCOR_CCOEN) {} CLK->CCOR = CLK_CCOR_RESET_VALUE; CLK->CANCCR = CLK_CANCCR_RESET_VALUE; CLK->HSITRIMR = CLK_HSITRIMR_RESET_VALUE; CLK->SWIMCCR = CLK_SWIMCCR_RESET_VALUE; /* Output Fcpu on CLK_CCO pin */ /* Clears of the CCO type bits part */ CLK->CCOR &= (u8)(~CLK_CCOR_CCOSEL); /* Selects the source */ CLK->CCOR |= (u8)CLK_OUTPUT_MASTER; /* Current clock master saving */ clock_master = (CLK_Source_TypeDef)CLK->CMSR; /* Automatic switch mode management */ /* Enables Clock switch */ CLK->SWCR |= CLK_SWCR_SWEN; /* Disables Switch interrupt */ CLK->SWCR &= (u8)(~CLK_SWCR_SWIEN); while((CLK->SWCR & 0x01)); // wait for SWBSY to get cleared /* Selection of the target clock source */ /* High Speed External clock */ CLK->SWR = (u8)CLK_SOURCE_HSE; ----> ERROR OCCURS HERE! While I get an update from you, I'll proceed with HSI I guess. Thanks for all your help. Regards, SU [ This message was edited by: sandeep.undale on 19-06-2009 16:39 ] |
|
|
|
嗨Sandeep,
请检查这一点: 确保石英晶体已插入(HSE):如果HSE时钟高于16MHz且低至24MHz,请确保在运行项目之前将“Flash_Wait_States”选项字节设置为1。 问候 mozra 以上来自于谷歌翻译 以下为原文 Hi Sandeep, Please check this point: Ensure that the quartz crystal is plugged (HSE): if the HSE clock is higher to 16MHz and lower to 24MHz ensure to set the ''Flash_Wait_States'' option byte to 1 before running the project. Regards mozra |
|
|
|
嗨Sandeep,
正如Mozra所说,HSE时钟频率是多少?如果它的24Mhz并使用1选项字节编程的等待状态。 问候, Jatin 以上来自于谷歌翻译 以下为原文 Hi Sandeep, As asked by Mozra, What is the HSE clock frequency? If its 24Mhz and use 1 wait state programmed with the option byte. Regards, Jatin |
|
|
|
嗨Sandeep,
您能否在您的环境中查看CLK库示例,感谢您随时了解情况 问候 mozra 以上来自于谷歌翻译 以下为原文 Hi Sandeep, Can you please check the CLK Library examples with your environment, Thanks to keep us informed Regards mozra |
|
|
|
嘿Jatin和Morza,
HSE时钟频率为16 Mhz。 -su 以上来自于谷歌翻译 以下为原文 Hey Jatin and Morza, The HSE clock frequency is 16 Mhz. -SU |
|
|
|
嗨Sandeep,
时钟切换顺序应如下: / *禁用开关中断* / CLK-> SWCR& =(u8)(~CLK_SWCR_SWIEN); CLK-> SWCR | = CLK_SWCR_SWEN; //启用时钟切换 CLK-> SWR =(u8)CLK_SOURCE_HSE; while((CLK-> SWCR& 0x01)); //等待SWBSY被清除 请尝试这个序列让我知道。 以上来自于谷歌翻译 以下为原文 Hi Sandeep, The clock switching sequence should be like: /* Disables Switch interrupt */ CLK->SWCR &= (u8)(~CLK_SWCR_SWIEN); CLK->SWCR |= CLK_SWCR_SWEN; // Enables Clock switch CLK->SWR = (u8)CLK_SOURCE_HSE; while((CLK->SWCR & 0x01)); // wait for SWBSY to get cleared Pls try this sequence and let me know. |
|
|
|
亲爱的大家,
我认为他应该检查16M OSC的负载电容。根据数据表正确连接OSC。将电容器大小改为22pF并尝试... 以上来自于谷歌翻译 以下为原文 Dear all, I think he should check the load capacitance of the 16M OSC.Connect the OSC correctly according to datasheet.Change capacitor size to 22pF and try... |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2733 浏览 1 评论
3241 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1810 浏览 1 评论
3650 浏览 6 评论
6038 浏览 21 评论
1339浏览 4评论
201浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
350浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
443浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
274浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 19:26 , Processed in 1.206496 second(s), Total 67, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号