CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

What is "POR_FROM_DS" [ SOLVED ! ]

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ortegahernandes



Joined: 14 Feb 2020
Posts: 9

View user's profile Send private message

What is "POR_FROM_DS" [ SOLVED ! ]
PostPosted: Fri Mar 27, 2020 11:55 am     Reply with quote

What is "POR_FROM_DS" ?

Sometimes when (intentionally) overflow the serial input (sending a lot of data quickly) this error occurs and the microcontroller is restarted.

It is only for knowledge item.

Grateful for the attention.


Last edited by ortegahernandes on Sat Mar 28, 2020 8:22 am; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 15727

View user's profile Send private message

PostPosted: Fri Mar 27, 2020 12:06 pm     Reply with quote

Are you putting the chip to sleep anywhere?.

This is a reset from deep sleep. Now, remember there is a sleep
instruction after the end of the code. Possibly your chip is actually
dropping out the end of the code, therefore going to sleep and then
you get this reset. So a fault like a stack overflow or underflow
could result in this if you haven't stack overflow reset enabled.

If the serial code is at all well written, it should be impossible to
'overflow'.
ortegahernandes



Joined: 14 Feb 2020
Posts: 9

View user's profile Send private message

PostPosted: Fri Mar 27, 2020 5:08 pm     Reply with quote

Ttelmah
Thanks for listening.

Well, this was not exactly a problem at the moment, because the use of serial is sporadic here.

But I already solved the "problem".

What was happening is that there was an SPI library
and the serial was through interruption because it is running at a low clock.

When the serial interrupt was generated, it would break the SPI library.

I only disabled the serial interruption only at the time of reading / writing the SPI that solved the "problem".
Ttelmah



Joined: 11 Mar 2010
Posts: 15727

View user's profile Send private message

PostPosted: Sat Mar 28, 2020 12:58 am     Reply with quote

What chip?.
What compiler version?.
Hardware or software SPI, using what functions?.
Master or slave SPI?.

If this is a PIC24, you may simply be suffering from not having
allocated enough stack space:

#build (stack=512)

an interrupt inside a function that is already using a lot of stack, will
easily overflow the default allocation. I run with 1KB of stack on a
PIC using several interrupt levels at the same time, and need most of
this....
ortegahernandes



Joined: 14 Feb 2020
Posts: 9

View user's profile Send private message

PostPosted: Sat Mar 28, 2020 6:58 am     Reply with quote

What chip?.
PIC24FV32KA304

What compiler version?.
5.092

Hardware or software SPI, using what functions?.

Software.

----------------------------------------------------------------------------------

Really is a pic24 lol

-----------------------------------------------------------------------------------
#build (stack=512)

I didn't know this stack size allocation / definition function, but one that I learned. ( I now looked in the help (F1) of the ccs about the function)

-----------------------------------------------------------------------------------

Ttelmah
Thanks Very Happy
Ttelmah



Joined: 11 Mar 2010
Posts: 15727

View user's profile Send private message

PostPosted: Sat Mar 28, 2020 8:17 am     Reply with quote

I suspect you may have been seeing a stack overflow.
The .lst file does give 'stack used', but remember this is in words
not bytes, and you seem to be able to run out, even if this says you are
OK.... Sad
ortegahernandes



Joined: 14 Feb 2020
Posts: 9

View user's profile Send private message

PostPosted: Sat Mar 28, 2020 8:21 am     Reply with quote

SOLVED !

I removed the "disabling the serial"
it's been running for over an hour
the problem occurred in less than 5 minutes.

As I still have a lot of RAM space, I put a value of 1024 (according to your "1K" suggestion).

solution> #build (stack = 1024)

Thanks Ttelmah
Ttelmah



Joined: 11 Mar 2010
Posts: 15727

View user's profile Send private message

PostPosted: Sat Mar 28, 2020 8:28 am     Reply with quote

Brilliant. Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group