Quality RTOS & Embedded Software

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


MPLAB PIC32MX reserved instruction?

Posted by ulmus on January 4, 2012
Hi! I try to run freeRTOS for the first time, i have main.c as simple as possible:

int main( void )
/* Finally start the scheduler. */

/* Will only reach here if there is insufficient heap available to start
the scheduler. */
return 0;

void vApplicationStackOverflowHook( void )
/* Look at pxCurrentTCB to see which task overflowed its stack. */
for( ;; );

but i get exception titled:
EXCEP_RI, // reserved instruction

dissamble looks like:

2120: static void prvCheckTasksWaitingTermination( void )
2121: {
9D002138 27BDFFF8 addiu sp,sp,-8
9D00213C AFBE0000 sw s8,0(sp) <--- exception address points here
9D002140 03A0F021 addu s8,sp,zero
9D002144 03C0E821 addu sp,s8,zero
9D002148 8FBE0000 lw s8,0(sp)
9D00214C 27BD0008 addiu sp,sp,8
9D002150 03E00008 jr ra

Thanx for any advice, i can't start freeRTOS and dont know why.

RE: MPLAB PIC32MX reserved instruction?

Posted by ulmus on January 4, 2012
I think i got answer:
in main() you have to call
hmm, i googled it but i have also 'Using the freertos' pic32 edition book and in examples from the book there is no call for that function... :(

RE: MPLAB PIC32MX reserved instruction?

Posted by Richard on January 4, 2012
It sounds like you just haven't set up the CPU, which you would have to do for any application you were writing (although the actual setup required depends on the application).

I suggest starting with an existing FreeRTOS demo application. Several are provided with the book, and there is a more complex example in the main FreeRTOS zip file download. Once you have an existing example compiling, you can leave in any configuration and setup necessary in main (the #pragmas at the top of main, and normally a function called prvSetupHardware()), and edit away the rest and replace it with your code.


RE: MPLAB PIC32MX reserved instruction?

Posted by ulmus on January 4, 2012
Thanx, only enable vectored interrupt i was missing:) now all works fine. I have a big application with lots of hardware and now i want to transalte it into freeRTOS app :)
Cross your fingers:)

[ 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