FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2014 Threads] Stack overflow hook on PIC32MZ/HarmonyPosted by pbjork on September 19, 2014 I'm adapting some Harmony 1.0 demo code by adding USART functionality to the Harmony RTOS/dual USB/CDC demo project through the Harmony Configurator. I think I've got the configuration correct. This is on the PIC32MZ starter kit board, with the XC32 1.33 compiler. FreeRTOS v8.? is as included in Harmony 1.0 distribution.
The problem is that when I try to run an extra task, the framework tasks seem to get starved out, and I get a stack overflow hook error. The task that throws the error seems to be the Framework (system) tasks, but sometimes it seems to be a NULL task, according to the current task stub object. If I suspend() the other task immediately after creating it, or before it gets into its for(;;) loop, then the whole original CDC project runs correctly. More specifically, if I try to block the task using the API routines Delay() or DelayUntil() (sp?), then the stack overflow hook is thrown.
I've tried increasing the framework stack size, doubling it to 2048 words, to no avail. Framework task priority is 1, other task priority is 4, max is set to 6.
Any ideas?
Stack overflow hook on PIC32MZ/HarmonyPosted by rtel on September 19, 2014 If you are increasing the stack size but it still overflows then it could be that something is being called recursively, or that simply something has overwritten the stack (corrupted the stack).
What happens if you have your task(s) running at the same priority as the framework task?
Regards.
Stack overflow hook on PIC32MZ/HarmonyPosted by pbjork on September 19, 2014 I'll try dropping the extra task priority to the same as that of the framework task. And check for anything recursive.
BTW, it seems that the overflow can occur before any framework code has been executed ( as verified by breakpoint on the first line). Harmony-generated code does not use assembly wrappers. Is it possible that a bunch of interrupts come in, nesting and increasing the stack usage?
Stack overflow hook on PIC32MZ/HarmonyPosted by pbjork on September 19, 2014 Drat!
I confused configMAXSYSCALLINTERRUPTPRIORITY with configMAXPRIORITY. I changed the former from 3 to 4, corresponding to that of my new task and the code works without a stack overflow. Sorry for wasting both of our times.
BTW, the question about assembly ISR wrappers is still confusing me. Even though Harmony does not auto-generate them, shall I write them out anyway to avoid the nested interrupt stack size problem? Do you suppose that Microchip will get around to providing this option?
Shall I put this into a new topic?
Stack overflow hook on PIC32MZ/HarmonyPosted by rtel on September 19, 2014 Not to worry. I will ping Microchip about the wrappers.
Regards.
Stack overflow hook on PIC32MZ/HarmonyPosted by tlafleur on September 19, 2014 Paul
Is it possible for you to send me or post a copy of your working project...
Thanks
On Fri, Sep 19, 2014 at 11:09 AM, Paul Bjork pbjork@users.sf.net wrote:
Drat!
I confused configMAXSYSCALLINTERRUPTPRIORITY with configMAXPRIORITY.
I changed the former to 4, corresponding to that of my new task and the
code works without a stack overflow. Sorry for wasting both of our times.
BTW, the question about assembly ISR wrappers is still confusing me. Even
though Harmony does not auto-generate them, shall I write them out anyway
to avoid the nested interrupt stack size problem? Do you suppose that
Microchip will get around to providing this option?
Shall I put this into a new topic?
Stack overflow hook on PIC32MZ/Harmony
Sent from sourceforge.net because you indicated interest in
https://sourceforge.net/p/freertos/discussion/382005/
To unsubscribe from further messages, please visit
https://sourceforge.net/auth/subscriptions/
~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~
Tom Lafleur
Stack overflow hook on PIC32MZ/HarmonyPosted by pbjork on September 20, 2014 Tom,
I'm not quite sure how to wrap up the project to send to you, but I'll try to zip it. But where to send it? I suppose I could post it.
Psul
Stack overflow hook on PIC32MZ/HarmonyPosted by tlafleur on September 20, 2014 Tom @ lafleur dot us
~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~
On Sep 19, 2014, at 6:27 PM, Paul Bjork pbjork@users.sf.net wrote:
Tom,
I'm not quite sure how to wrap up the project to send to you, but I'll try to zip it. But where to send it? I suppose I could post it.
Psul
Stack overflow hook on PIC32MZ/Harmony
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/freertos/discussion/382005/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|