Page 1 of 1
Serious Warning: Possible sw stack corruption.
Posted: Mon Oct 14, 2013 2:26 pm
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.
Re: Serious Warning: Possible sw stack corruption.
Posted: Mon Oct 14, 2013 9:28 pm
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.
Re: Serious Warning: Possible sw stack corruption.
Posted: Mon Oct 14, 2013 10:51 pm
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
Re: Serious Warning: Possible sw stack corruption.
Posted: Tue Oct 15, 2013 2:07 am
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.
Re: Serious Warning: Possible sw stack corruption.
Posted: Tue Oct 15, 2013 7:33 am
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
Re: Serious Warning: Possible sw stack corruption.
Posted: Tue Oct 15, 2013 1:49 pm
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