Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bootlader single steps but resets when trying to run
#2
I found the cause of this odd behavior and a solution for the very short term, until I can get the system to assign the initial conditions properly.
The problem is caused by the SPLIM register.
With all of the other code the compiler is assigning the SPLIM reasonable values, but with just the assembly code in the DS30, it assigns it to a number beneath the assigned stack value. Which is an error right out of the gate.
So I can either remove the assignment mov #__SP_init, WSTPTR ;done this way which the system only appears to allocate about 75 bytes.

Or use this at the beginning of DS30 loader
mov #__SP_init, WSTPTR
mov #__SPLIM_init,w0
mov w0,_SPLIM

This allocates too much, which is almost the entire memory to stack because it is just the DS30 in the project.
I will probably assign values manually in the end given what I have observed.

The red herring in all this is the way the single step would work, and the false error message of "Target halted due to Software Breakpoint in user code".
So given the stack was at a reasonable location I never noticed the SPLIM was beneath the initial value.

I hope this helps someone else.
Reply


Messages In This Thread
RE: Bootlader single steps but resets when trying to run - by gcourtney - 2014-09-09, 21:53:20

Forum Jump:


Users browsing this thread: 1 Guest(s)