Quality RTOS & Embedded Software

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


_general_exception_handler erasing flash

Posted by Robert H. Oujesky on June 9, 2011
I am using FreeRTOS on a custom PIC32 based board that looks a lot like an Explorer 16 board. Anyway, when I erase the 3rd page of flash I am getting a _general_exception_handler. I cannot extract from the volumes of microchip data what the cause is. How do I interpret what the ulCause and ulStatus mean? It might be helpful.....
Also, how is _general_exception_handler registered as the exception handler? I searched for _general_exception_handler all thru the code and it only appears in main.c. Is _general_exception_handler some kind of compiler/linker reserved function for microchip? Just curious about that part.....


RE: _general_exception_handler erasing flash

Posted by Richard on June 9, 2011
The CAUSE register is described in the manual for the MIPS M4K core, not in the PIC32 manual (at least that was the case when I wrote the port). You can download the M4K technical documentation from MIPS directly.


RE: _general_exception_handler erasing flash

Posted by Robert H. Oujesky on June 9, 2011
after re-reading, it is not clear what i am doing :( I downloaded the "HID Bootloader..." example from microchip. It appears to work. In my code, I have a loop:
for( temp = 0; temp < (MaxPageToErase); temp++ )
//pFlashTemp = 0x1d000000;
pFlashTemp = pFlash + (temp*FLASH_PAGE_SIZE);
NVMErasePage((void*) pFlashTemp );
USBDeviceTasks(); //Call USBDriverService() periodically to prevent falling off the bus if any SETUP packets should happen to arrive.

the 3rd time thru the loop I get a _general_exception_handler. I wonder if the call to NVMErasePage causes a _general_exception_handler in some kind of asynchronous way so it just so happens the exception occurs, but i continue stepping?????

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

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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner