View previous topic :: View next topic |
Author |
Message |
ortegahernandes
Joined: 14 Feb 2020 Posts: 23
|
What is "POR_FROM_DS" [ SOLVED ! ] |
Posted: Fri Mar 27, 2020 11:55 am |
|
|
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: 19535
|
|
Posted: Fri Mar 27, 2020 12:06 pm |
|
|
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: 23
|
|
Posted: Fri Mar 27, 2020 5:08 pm |
|
|
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: 19535
|
|
Posted: Sat Mar 28, 2020 12:58 am |
|
|
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: 23
|
|
Posted: Sat Mar 28, 2020 6:58 am |
|
|
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 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Sat Mar 28, 2020 8:17 am |
|
|
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.... |
|
|
ortegahernandes
Joined: 14 Feb 2020 Posts: 23
|
|
Posted: Sat Mar 28, 2020 8:21 am |
|
|
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: 19535
|
|
Posted: Sat Mar 28, 2020 8:28 am |
|
|
Brilliant. |
|
|
|