AnsweredAssumed Answered

RUN command in STVD doesn`t work

Question asked by Berton.Ivan.001 on Feb 26, 2017
Latest reply on Mar 1, 2017 by Berton.Ivan.001

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-Link

 

The 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 help

Ivan

Outcomes