Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

PIC32 StarterKit General Exception Handler cr

Posted by Pistole Gun on June 10, 2011
Hallo everyone,

I am using PIC32 Starter

RE: PIC32 StarterKit General Exception Handler cr

Posted 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 cr

Posted 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 cr

Posted 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 cr

Posted 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 cr

Posted 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..


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS