Serious Warning: Possible sw stack corruption.

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
beejo
Posts: 31
Joined: Thu Sep 11, 2008 12:46 pm
Location: TheNetherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Serious Warning: Possible sw stack corruption.

Post by beejo »

Is there anyone who has experience with the use, in the same program, of a hardware Uart and a software Uart from the PIC16F877A for reading, editing, and sending data of a RS232 device to another RS232device?
I've been a long time experimenting. Now I notice the following warning messages in the compile posts.

During the compilation i notice the following warning :

Serious Warning: Possible sw stack corruption, function 'FCD_RS2320_ReceiveRS232Char' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCD_RS2321_ReceiveRS232Char' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)

Does this mean that the Interrupt is not working properly. In other words that the correct stack info is lost? Because I can't read any good data string into the PIC.

How can I solve this Mega problem?
Please help me quickly with this pressing problem.


Thank in advance,
Beejo

Flowcode V5 user.
Attachments
RS232communication between 2devices REV E.fcf
(57.22 KiB) Downloaded 309 times

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: Serious Warning: Possible sw stack corruption.

Post by Kenrix2 »

If you could just change your target micro to one with two hardware UARTs your project would be a lot easier. Another option might be a hardware switching scheme to direct the serial signal between the two devices and just use the hardware UART.

beejo
Posts: 31
Joined: Thu Sep 11, 2008 12:46 pm
Location: TheNetherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Serious Warning: Possible sw stack corruption.

Post by beejo »

Hi Kenrix2

Thank you for willing to help me .
Yes, your write. But I need a micro with 2x PWM for the motorcontrol and 2 Usart for communication. Then you need soon the Pic18F..K.. models. This series mcu is not programmable with the E06 programmer board. I know it has to be possible to do this with a hardware and a software Uart.

Code: Select all

`Another option might be a hardware switching scheme to direct the serial signal between the two devices and just use the hardware UART`
If i direct the commands directly to the other device e.g. make a bypass then i can not modify this signal. So I have to read the commands and add another set of commands depending on that command. But for the moment I would be very happy if there is communication possible between the 2 Usart.

best regards,
Beejo

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: Serious Warning: Possible sw stack corruption.

Post by Kenrix2 »

I tried to compile your program using the -sw 6 2 switch and it compiled just fine. here is my linker/assembler parameters which you can copy and paste it : -ld "C:\Program Files\Flowcode\v5\Tools\BoostC\lib" libc.pic16.lib rand.pic16.lib float.pic16.lib "%f.obj" -t PIC%p -d "%d" -p "%f -sw 6 2"
Maybe I am overly cautious but I would be concerned about using the software uart with an interrupt enabled.

beejo
Posts: 31
Joined: Thu Sep 11, 2008 12:46 pm
Location: TheNetherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Serious Warning: Possible sw stack corruption.

Post by beejo »

Hi Kenrix2,

You got no error message like this in your compilation?

Code: Select all

Serious Warning: Possible sw stack corruption, function 'FCD_RS2320_ReceiveRS232Char' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCD_RS2321_ReceiveRS232Char' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
In my assembler/linker option are two differences.

Code: Select all

-ld "C:\Program Files (x86)\Flowcode\v5\Tools\BoostC\lib" libc.pic16.lib rand.pic16.lib float.pic16.lib "%f.obj" -t PIC%p -d "%d" -p "%f" -swcs 6 2
The first has to do with the 64 bit machine (x86) and the other difference is:
The software stack key in my linker/assembler parameters is positioned directly after the last character ("). However, I have tested both possibilities and both key notifications give the same error message above at compile time.

Beejo

beejo
Posts: 31
Joined: Thu Sep 11, 2008 12:46 pm
Location: TheNetherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Serious Warning: Possible sw stack corruption.

Post by beejo »

Hi Kenrix2,
I tried your SW key and finally without stack corruption error so thank you again for this. Maybe i didn't save the compiling options. Also You are write again why make it too difficult I will follow your advise and make a bypass
When certain commands are missing I send them afterwards via the PIC.

Code: Select all

 Another option might be a hardware switching scheme to direct the serial signal between the two devices and just use the hardware UART.
But when i read your advise good you mean a switching solution. Do you have an example of this?
Kind regards ,
Beejo

Post Reply