完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好
我是STM8S-Discovery和STM8S105的新手。 我通常在汇编程序中编写代码,因此我对微硬件有了更深入的了解。但是我遇到了STVD工具的问题。 当我进入调试模式并按下RUN按钮时,我可以看到 USB连接器旁边的红色LED闪烁。但简单的代码不起作用。 代码应该使绿色LED闪烁,但它不会。 我看不到任何错误信息或其他信息。但是当我用SET PC(调试菜单)将光标设置在代码的第一个命令(bset)上时 然后选择CONtiNUE(调试菜单)程序工作。绿色LED指示灯正常闪烁 直到我停止程序。我可以用STVP读出代码,因此微闪存。 但拔下并重新插入USB连接器后,该程序无法正常工作。 我用的是:ST Visual Develop 4.3.10 Windows 10 STM8S-Discovery(STM8S105C6) Debeug仪器:SWIM ST-Link代码如下: -------------------------------------------------- ------ stm8 / segment'rom' 开始 bset $ 5011,#0 loop_forever ldw X,#$ FFFF loop_delay NOP decw X. jrne loop_delay bcpl $ 500F,#0 jra loop_forever结束 -------------------------------------------------- ------我处理STVD或微初始化有什么问题? 谢谢你的帮助 以上来自于谷歌翻译 以下为原文 Hi I`m new with the STM8S-Discovery and the STM8S105. I usually write my code in assembler so I get a deeper touch on the micros hardware.But I encountered an issue with the STVD tool. When I`m entering the debug mode and push the RUN button I can see the red LED next to the USB connector blinking. But the simple code does not work. The code should make the green LED blinking, but it doesn`t. I can`t see any error message or other info.But when I set the cursor on the first command(bset) of the code with SET PC(Debug menu) and then select CONTINUE(Debug menu) the programm works. The green LED flashes correctly until I stop the programm.I can read out the code with STVP, so the micro is flashed. But the programm does not work after unplug and replug the USB connector. What I use:ST Visual Develop 4.3.10 Windows 10 STM8S-Discovery (STM8S105C6) Debeug instrument: SWIM ST-LinkThe code looks like this: -------------------------------------------------------- stm8/ segment 'rom' start bset $5011,#0 loop_forever ldw X,#$FFFF loop_delay nop decw X jrne loop_delay bcpl $500F,#0 jra loop_forever end --------------------------------------------------------Something wrong with my handling of the STVD or micro initialising? Thanks for any helpIvan |
|
相关推荐
2个回答
|
|
,
, 嗨Max 感谢您的回复。我使用传统的ST62微处理器直到现在。就像我说我用汇编程序编写代码。使用ST62我使用了一个文本文件mycode.asm并用ast6.exe编译它以获取我用程序员发送到ST62的mycode.hex。 设置ST62的复位向量通常如下所示 -------------------------------------------------- -------------------------------------------------- ------- .org 0080h 开始,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, .org 0ff0h ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, .org 0ffch jp ,,, nmi_int ,,,,,,,,,,,,,,,,,,,,,,,,中断向量 jp ,,,, start ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 。结束 -------------------------------------------------- -------------------------------------------------- ------- 现在我使用STVD,我不熟悉。 有一个自动生成的mapping.asm文件,其中包含放置重置向量的信息。 -------------------------------------------------- -------------------------------------------------- ------- STM8 / ,------------------------------------------------- ----- , ,STVD自动生成的分段映射文件, ,不应该手动修改。 , ,当文件重新生效时,更改将丢失。 , ,------------------------------------------------- -----, ♯包括'mapping.inc'BYTES,以下地址长8位 , ram0_segment_start-ram0_segment_end'ram0'WORDS的段字节,以下地址长16位 , ram1_segment_start-ram1_segment_end'ram1'WORDS的段字节,以下地址长16位 , stack_segment_start-stack_segment_end'track'WORDS的段字节,以下地址长16位 , 段字节在4000-43FF'eeprom'WORDS,以下地址长16位 , 段字节在8080-FFFF'rom'WORDS,以下地址是16位长 , 段字节在8000-807F'vectit'END -------------------------------------------------- -------------------------------------------------- ------- 那我现在要做什么呢?地点 ,,, , , ,分割 , , , 'vectit' ,,,,,,,, jp ,,,开始 进入我的主程序? 我在文档INT中发现使用命令而不是JP,但INT并未将其识别为STVD的有效命令。 谢谢你的帮助。 以上来自于谷歌翻译 以下为原文 , , Hi Max Thanks for reply. I used legacy ST62 micros until now. Like I said I write my code in assembler. With the ST62 I used a text file mycode.asm and compiled it with ast6.exe to get the mycode.hex which I sent to the ST62 with the programmer. Set up the reset vector for ST62 usually looks like this ----------------------------------------------------------------------------------------------------------- .org 0080h start , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,,main prog .org 0ff0h , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,,some other vectors .org 0ffch jp , , ,nmi_int , , , , , , , , , , , , , , , , , , , , , ,,interrupt vector jp , , ,start , , , , , , , , , , , , , , , , , , , , , , , , , , ,,reset vector pointed to the start of the program .end ----------------------------------------------------------------------------------------------------------- Now I use STVD and I`m not familiar with. There is an automatic generated mapping.asm file which contains the info where to place the reset vector. ----------------------------------------------------------------------------------------------------------- stm8/ ,------------------------------------------------------ , , SEGMENT MAPPING FILE AUTOMATICALLY GENERATED BY STVD , , SHOULD NOT BE MANUALLY MODIFIED. , , CHANGES WILL BE LOST WHEN FILE IS REGENERATED. , ,------------------------------------------------------ , ♯ include 'mapping.inc'BYTES , The following addresses are 8 bits long , segment byte at ram0_segment_start-ram0_segment_end 'ram0'WORDS , The following addresses are 16 bits long , segment byte at ram1_segment_start-ram1_segment_end 'ram1'WORDS , The following addresses are 16 bits long , segment byte at stack_segment_start-stack_segment_end 'stack'WORDS , The following addresses are 16 bits long , segment byte at 4000-43FF 'eeprom'WORDS , The following addresses are 16 bits long , segment byte at 8080-FFFF 'rom'WORDS , The following addresses are 16 bits long , segment byte at 8000-807F 'vectit'END ----------------------------------------------------------------------------------------------------------- So what I have to do now? Place , , , , , ,segment , , , 'vectit' , , , , , , , , ,jp , , ,start into my main program? I found in the documentation INT as command to use instead of JP , but INT it`s not recognized as a valid comand by STVD. Thanks for any help. |
|
|
|
你能理解C语言吗?
STM8有许多用C编写的示例和库,但在汇编中并不多。 如果你能理解C,它可能会简化你的生活...... ST6的情况并非如此:它的核心不利于C编译器效率,大多数开发工作都是在汇编程序中完成的。 如果C是你的选择, http://cosmicsoftware.com/download_stm8_free.php 作为STM8免费版本并使用http://www.st.com/en/embedded-software/stsw-stm8069.html 无论是在您的应用程序中还是作为示例。否则,请查看此站点 http://stm8sdiscovery.nano-age.co.uk/home :它显示了一个非常简单的使用汇编程序的开始。它包含中断向量,它们应该是STM8的方式 以上来自于谷歌翻译 以下为原文 Can you understand C language? STM8 has many examples and libraries written in C, but not much in assembly. If you can understand C, it will probably simplify your life a lot... This was not the case with ST6: its core was not good for C compiler efficiency and most development work was done in assembler. If C is an option for you, http://cosmicsoftware.com/download_stm8_free.php as a version free of charge for STM8 and use the http://www.st.com/en/embedded-software/stsw-stm8069.html either in your application or as example.Otherwise, look at this site http://stm8sdiscovery.nano-age.co.uk/home : it shows a very simple start using the assembler.Look at the , it includes the interrupt vectors the way they should be for STM8 |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2635 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1783 浏览 1 评论
3610 浏览 6 评论
5988 浏览 21 评论
939浏览 4评论
1316浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
584浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1303浏览 3评论
1359浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 09:41 , Processed in 1.151761 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号