Reply by Joey October 31, 20112011-10-31
--- In r..., "kareem" wrote:
>
> --- In r..., "Joey" wrote:
> >
> > I have posted my changes in 4 files that have fixed this problem for me:
> >
> > SERLINK.LIB
> > RS232.LIB
> > UCOS2.LIB
> > UTIL.LIB
> >
> > This is based on DC 9.62. All my changes are marked with
> > "***** CHANGE *****".
> >
> > Please let me know if they work for you also.
> >
> HI joey, i tried to apply your change in dynamic c 10.46 but i still have the same problem the program crash after 10 min
>

The problems are all due to poorly written interrupt handlers. The updated files above with the interrupt handlers for RS232, the ucos system timer, the serlink (gprs modem), and the general faults.

If your 10.46 application has other interupt sources, those drivers may also have to be updated.

Reply by Tom Collins October 16, 20112011-10-16
Changes to the DC9 libraries may not port well to the DC10 libraries.

If you're really using DC 10.46, you should upgrade to 10.66:
http://www.digi.com/support/productdetl.jsp?pidI78&osvid=0&tp&tp2=0

If you continue to have PPP/UCOS problems, then email s...@rabbit.com to report them.

-Tom
On Oct 16, 2011, at 4:21 AM, kareem wrote:

> --- In r..., "Joey" wrote:
> >
> > I have posted my changes in 4 files that have fixed this problem for me:
> >
> > SERLINK.LIB
> > RS232.LIB
> > UCOS2.LIB
> > UTIL.LIB
> >
> > This is based on DC 9.62. All my changes are marked with
> > "***** CHANGE *****".
> >
> > Please let me know if they work for you also.
> > HI joey, i tried to apply your change in dynamic c 10.46 but i still have the same problem the program crash after 10 min
Reply by kareem October 16, 20112011-10-16
--- In r..., "Joey" wrote:
>
> I have posted my changes in 4 files that have fixed this problem for me:
>
> SERLINK.LIB
> RS232.LIB
> UCOS2.LIB
> UTIL.LIB
>
> This is based on DC 9.62. All my changes are marked with
> "***** CHANGE *****".
>
> Please let me know if they work for you also.
>
HI joey, i tried to apply your change in dynamic c 10.46 but i still have the same problem the program crash after 10 min

Reply by Dave McLaughlin April 23, 20112011-04-23
Thanks Peter,

As I get an email and don't use the web interface I didn't put 2 and 2
together.

I'll go online today and check them out.

Dave...
---
Very funny Scotty, now beam down my clothes!!!
---

From: r... [mailto:r...] On
Behalf Of petermcs
Sent: 22 April 2011 23:45
To: r...
Subject: [rabbit-semi] Re: PPP while using ucos2

Hi Dave,

If you look in the files link on the left they are there. The list is in
alphabetical order so you will have to search down near the end for most of
them.

Regards,
Peter
Reply by petermcs April 23, 20112011-04-23
You're welcome Dave!

I'll be interested in seeing how you get on with these as I use the RS232.LIB with ucos2 for the MS/TP support on the BACnet stack and it generates almost continuous serial traffic (token passing network so even when "nothing" is happening the token is whizzing back and forward).

Regards,
Peter

--- In r..., "Dave McLaughlin" wrote:
>
> Thanks Peter,
>
> As I get an email and don't use the web interface I didn't put 2 and 2
> together.
>
> I'll go online today and check them out.
>
> Dave...
> ---
> Very funny Scotty, now beam down my clothes!!!
> ---
>
> From: r... [mailto:r...] On
> Behalf Of petermcs
> Sent: 22 April 2011 23:45
> To: r...
> Subject: [rabbit-semi] Re: PPP while using ucos2
>
>
> Hi Dave,
>
> If you look in the files link on the left they are there. The list is in
> alphabetical order so you will have to search down near the end for most of
> them.
>
> Regards,
> Peter
>

Reply by petermcs April 22, 20112011-04-22
Hi Dave,

If you look in the files link on the left they are there. The list is in alphabetical order so you will have to search down near the end for most of them.

Regards,
Peter

--- In r..., "Dave McLaughlin" wrote:
>
> Hi Joey,
>
> Where have you uploaded the files?
>
> I will be happy to test them for you on my hardware with the PPP connection
> which sends data every few minutes.
>
>
> Dave...
> ---
> Very funny Scotty, now beam down my clothes!!!
> ---
>
> From: r... [mailto:r...] On
> Behalf Of Joey
> Sent: 22 April 2011 19:07
> To: r...
> Subject: [rabbit-semi] Re: PPP while using ucos2
>
>
> I have posted my changes in 4 files that have fixed this problem for me:
>
> SERLINK.LIB
> RS232.LIB
> UCOS2.LIB
> UTIL.LIB
>
> This is based on DC 9.62. All my changes are marked with
> "***** CHANGE *****".
>
> Please let me know if they work for you also.
>

Reply by Dave McLaughlin April 22, 20112011-04-22
Hi Joey,

Where have you uploaded the files?

I will be happy to test them for you on my hardware with the PPP connection
which sends data every few minutes.

Dave...
---
Very funny Scotty, now beam down my clothes!!!
---

From: r... [mailto:r...] On
Behalf Of Joey
Sent: 22 April 2011 19:07
To: r...
Subject: [rabbit-semi] Re: PPP while using ucos2

I have posted my changes in 4 files that have fixed this problem for me:

SERLINK.LIB
RS232.LIB
UCOS2.LIB
UTIL.LIB

This is based on DC 9.62. All my changes are marked with
"***** CHANGE *****".

Please let me know if they work for you also.
Reply by Joey April 22, 20112011-04-22
I have posted my changes in 4 files that have fixed this problem for me:

SERLINK.LIB
RS232.LIB
UCOS2.LIB
UTIL.LIB

This is based on DC 9.62. All my changes are marked with
"***** CHANGE *****".

Please let me know if they work for you also.

Reply by mohamed April 22, 20112011-04-22
sure the ucos and PPP over serial are not working together and you can find a simple program that i posted previously in this thread which is demonstrating the problem, you can check this thread history

--- In r..., "Joey" wrote:
> The major problem is with the interrupt handlers. They are not
> compliant with the uCOS interrupt handler spec. Stack corruptions
> occurs whenever a nested interrupt causes a task switch. A typical case
> is as follows:
>
> 1 the serlink driver (PPP) interrupts and starts processing
>
> 2 the serlink driver re-enables interrupts before completing
>
> 3 the rt clock interrupt fires
>
> 4 clock driver declares a task switch because some timer expired for a
> higher prio task
>
> 5 clock driver completes and task switches
>
> 6 new task starts running with corrupted stack because the serlink
> registers are still on the stack. often it is the xpc that is messed up
>
> 7 watchdog causes reboot
>
> I see this a lot with serlink because it interrupts a lot and the
> handler takes a long time to execute so the probability of corruption is
> great (especially with large data packets), but other handlers
> (RS232.lib, util.lib) are also capable of causing the same problem.
>
> There is also a bug in the ucos2.lib that complicates the issue.
>
> Line 1488 (in my version)
>
> "sbc a,(hl)" shoud be "or (hl)"
>
> Whether or not you see the bug will of course depend on how many tasks
> and at what prio they run at, as well as what ucos2 features you are
> using.
>

Reply by Joey April 21, 20112011-04-21
The major problem is with the interrupt handlers. They are not
compliant with the uCOS interrupt handler spec. Stack corruptions
occurs whenever a nested interrupt causes a task switch. A typical case
is as follows:

1 the serlink driver (PPP) interrupts and starts processing

2 the serlink driver re-enables interrupts before completing

3 the rt clock interrupt fires

4 clock driver declares a task switch because some timer expired for a
higher prio task

5 clock driver completes and task switches

6 new task starts running with corrupted stack because the serlink
registers are still on the stack. often it is the xpc that is messed up

7 watchdog causes reboot

I see this a lot with serlink because it interrupts a lot and the
handler takes a long time to execute so the probability of corruption is
great (especially with large data packets), but other handlers
(RS232.lib, util.lib) are also capable of causing the same problem.

There is also a bug in the ucos2.lib that complicates the issue.

Line 1488 (in my version)

"sbc a,(hl)" shoud be "or (hl)"

Whether or not you see the bug will of course depend on how many tasks
and at what prio they run at, as well as what ucos2 features you are
using.