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] [June 2011 Threads] PIC32 StarterKit General Exception Handler crPosted by Pistole Gun on June 10, 2011 Hallo everyone,
I am using PIC32 Starter
RE: PIC32 StarterKit General Exception Handler crPosted by Pistole Gun on June 10, 2011 Hallo everyone, Sorry I make accidentally pressed enter.
I am using PIC32 Starter kit (PIC32MX360F512L). freeRTOSv5.10 C32 Compiler v1.05 MPLABv8.60
Previously, I have made it work to create task such as blinking LED. Then I port it with API from Microchip Graphics Library. There is no problem.
Next, I also implement FS API from Microchip with FreeRTOS. It crash and go to void _general_exception_handler( unsigned portLONG ulCause, unsigned portLONG ulStatus ) it crashed here and never back.
Then I add taskENTER_CRITICAL(); while(1) { } taskEXIT_CRITICAL();
It worked, but the task will be always executed (looping here) It never go to applicationIdleHook.
So, I think that it is not the solution.
I suspicious that the problem is on Stack. I have modified configMINIMAL_STACK_SIZE, but nothing was changed. Even, the memory gauge on MPLAB did not changed the Data memory.
Does anyone have the solution ? Any suggestions would be very appreciated.
Thanks
RE: PIC32 StarterKit General Exception Handler crPosted by Richard on June 10, 2011 > It worked, but the task will be always executed (looping here) It > never go to applicationIdleHook.
You have locked it in a null loop in a critical section. It will not leave that code, and the tick interrupt is being held off by the critical section. I would expect that to be the only code that executed (except interrupts that are above a certain priority level that are not effected by the critical section).
> > So, I think that it is not the solution. > > I suspicious that the problem is on Stack. I have modified > configMINIMAL_STACK_SIZE, but nothing was changed. Even, the memory > gauge on MPLAB did not changed the Data memory.
You can turn stack checking on, if it is not on already.
Regards.
RE: PIC32 StarterKit General Exception Handler crPosted by Pistole Gun on June 10, 2011 Hi richard,
Thank you very much.
>You can turn stack checking on, if it is not on already. Do you mean #define configCHECK_FOR_STACK_OVERFLOW2 (in FreeRTOSConfig.h) ? I have turned it more than 0. (2) It never go to void vApplicationStackOverflowHook( void ) Is this mean that there is no stack overflow ?
Before the program went to void _general_exception_handler( unsigned portLONG ulCause, unsigned portLONG ulStatus ) The program is break in port_asm.S
portRESTORE_CONTEXT
There is error below in MPLAB IDE CORE-E0002: Exception due to misaligned word access, from instruction at 0x9d01b28c
What does it mean ?
Thank you very much.
RE: PIC32 StarterKit General Exception Handler crPosted by Dave on June 10, 2011 Some architectures need word (32 bit) data and instructions to be aligned on 32 bit boundaries in memory. And if you try reading, writing, or executing a 32 variable or instruction that is not on a 32 bit boundary you will get a misaligned word access exception.
It tells you the address of the instruction that caused the exception, so you need to look up what is at that address.
RE: PIC32 StarterKit General Exception Handler crPosted by Pistole Gun on June 11, 2011 Hi dave,
Thanks for your suggestion.
If I know the address of instruction which caused the exception, how to know what kind of instruction in C ? MPLAB will generate the .hex , but I do not know which instruction in C.
Thank you very much..
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|