Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Simulator Frame or software stack overlap ?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
autoguider

Bascom Member



Joined: 24 Sep 2007
Posts: 82
Location: Aachen

germany.gif
PostPosted: Fri May 30, 2014 1:34 pm    Post subject: Simulator Frame or software stack overlap ? Reply with quote

Dear all,
I am evaluating some code because the device I want to control sometimes behaves inpredictable.
In the simulation runnig sometime the message Frame or software stack overlap occurs.
I changed the parameters for the stacks and frame several times but the message occurs in the bottom line often when I pause the program.

Here an excerpt form the compiler's report file
Compiler : BASCOM-AVR LIBRARY V 2.0.7.6
Processor : M168
SRAM : 400 hex
EEPROM : 200 hex
ROMSIZE : 4000 hex

ROMIMAGE : 3BF6 hex -> Will fit into ROM
ROMIMAGE : 15350 dec
FLASH USED : 93 %
BAUD : 19200 Baud
XTAL : 6000000 Hz
BAUD error : 2.34%

Stack start : 4FF hex
Stack size : 40 hex
S-Stacksize : 80 hex
S-Stackstart : 4C0 hex
Framesize : 154 hex
Framestart : 2EC hex
Space left : 209 dec

The occupation of SRAM is indicated in the attachment.
In the program there is 1 ISR using NOSAVE option and the communication via UART as well as LCD and print commands.
In testing only ISR and LCD commands were executed. No communication via UART.
There is also 3 floating point multiplications in the code.



In running the simulation HW stack usage is in 15 bytes only. SW stack 2 bytes only.
In the frame I can see so far only activity in 4 bytes.

So far no operation with strings coming from the uart did occur. I cannot imagine how an opverlap may occur.
After studying the Bascom aplication note #183 I cannot find an explanation.

How can I find the reason for an overlap ? and correct it.

Please be so kind to give me some advice.

best regards

Christian

(BASCOM-AVR version : 2.0.7.7 )
Back to top
View user's profile
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1571
Location: Basel, Switzerland

switzerland.gif
PostPosted: Fri May 30, 2014 3:02 pm    Post subject: Reply with quote

Hi,

Have a look at $dbg and maybe "stackcheck.lib"

Without seeing the code it's hard to say.

Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2165

netherlands.gif
PostPosted: Fri May 30, 2014 5:36 pm    Post subject: Reply with quote

Stack of 40h is small, try to increase and see if the error disappear.
Without code hard to say where the problem is.

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum