Stack Overflow Protection

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
iain wilkie
Posts: 97
Joined: Tue Jul 14, 2009 4:37 pm
Has thanked: 13 times
Been thanked: 9 times
Contact:

Stack Overflow Protection

Post by iain wilkie »

So after discovering that an older program I had in V4 would not run in an ATTiny13 in FC8 due to the stack overflowing, I am wondering what measures FC8 could take to flag this up as an error or a warning, this should be I would have though be a fairly important check given that the programmer may have no knowledge as to how much stack is being consumed.

Also to be able to access the .lst file from within FC8 would be very handy

Iain

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Stack Overflow Protection

Post by Benj »

Hello Iain,

On an AVR device we display something like this in the compiler messages.
text data bss dec hex filename
832 0 35 867 363 C:\Users\BenR\AppData\Local\Temp\Inflation REV4A_v7-1.elf
This is specifically from your posted Inflation program.

Flash usage is the .text combined with a copy of the .data initialisers

(static) RAM usage is a combination of data and bss

Might be worth looking at the AVR freaks forums as there are some relevant threads on the topic.

On a PIC things are much better and it lets you know if there are likely to be stack or memory issues. Other devices such as ARM have the same problem as AVR but also have a lot more memory available so it's much less likely to run into the problem.

iain wilkie
Posts: 97
Joined: Tue Jul 14, 2009 4:37 pm
Has thanked: 13 times
Been thanked: 9 times
Contact:

Re: Stack Overflow Protection

Post by iain wilkie »

Benj,

Thanks for the reply but I don't see or understand how this info allows an informed assessment of stack overflow ???

Iain

Post Reply