cancel
Showing results for 
Search instead for 
Did you mean: 

Dubts, how to reset stm8s

lmx1
Associate II
Posted on December 01, 2013 at 08:05

Hi guys,

I am new to STM8s discovery...

I have done the following code:

stm8/

    ;mapping.asm exists ...

    segment 'rom'

    

start

    bset $5011,#0;sets PD0 to input

loop_main

    ldw X,#$FFFF

loop_delay

    nop

    decw X

    jrne loop_delay

    bcpl $500F,#0; togle port to input/output

    jra loop_main

        

    end

This will blink the led...at least it should...

the problem is..it never blink :S

In debug mode I tried to see where is the problem...and when I start debug...the PC starts in 0x6000 :S

For what I understand it should start in 0x8080...

Is there any chance to when we reset the board in CN1, it restart the PC, but the first instruction is a jra to 0x8080?? to start running the code??

Am'i  thinking correct?

In stvp I chosed the Motorola like binary file, and in program code I flashed the board...

Thanks in advance

Ps:What is Blank check??does the programmer write something in the flash or epromm??

regards

tux
3 REPLIES 3
lmx1
Associate II
Posted on December 10, 2013 at 23:49

any help?please..

thanks in advance

regards

tux

kylejcavanaugh
Associate
Posted on August 29, 2014 at 16:37

Hi Tux,

  I have a similar issue.  When I start the debugger it too starts in 0x6000.  I assume this has something to do with the bootloader since this memory space is reserved for the bootloader.   But I don't have or want to use a bootloader at this time.  I still have this problem.  Did you ever get your problem resolved?  Thanks.  Take care, Kyle

lmx1
Associate II
Posted on June 06, 2015 at 01:12

Hi,

Sorry for the delay..

yes I agree it have to do with bootloader..

when you make a reset by default the PC starts at 6000, if then runs a series of checks, that lasts for 1 second, if you enter in bootloader mode , it will start running bootloader reply ode protocol...

But the strange thing is that , if you don't enter bootloader mode, it should, after that jump to 0x8000 which is the entry point for interrupt vectors..

you can disable bootloader mode, but then if you need it...it will be a mess, because if you don't have a way to change registers, you will not ne able to enter it again:(

this is strange behavior..

One solution that I found that works is jumping to 0x8000 the interrupt vector table...but its strange because bootloader should by it self jump there..