Quality RTOS & Embedded Software

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




Loading

Problem moving from pic32MX360 to pic32MX575

Posted by steveb on December 4, 2010
Hi All.

Have put together several tasks, some tasks using UART/DMA/Interrupts and is running fine using the pic32 starter kit with pic32MX360F512L.

Having problems trying to run the exact same code using pickit-3 with pic32MX575F512L. The _general_exception_handler
is called regardless of what I try. For example I have removed all tasks but 1 and the task is simplified to just spin in a loop. When starting the code, after a few seconds I hit a breakpoint set in the _general_exception_handler.

If removing all tasks, Queues, Sem declarations/definitons and just calling prvSetupHardware() to init clocks, disable interrupts etc, followed by vTaskStartScheduler(), same thing happens.

If I remove vTaskStartScheduler() and just spin in a loop e.g while (TRUE) { i++; }, it seems happy i.e. don't hit the breakpoint in _general_exception_handler(). Note this all in main() and the correct device is selected under the IDEs Configure->Select Device tab...

I have looked at the exception codes but can't determine anything from it:-
Status = 0x103
Cause = 0x8080041C
According to the M4K software user guide, the exception code (41C => 28 based on the bit mapping) is a reserved value....

A friend who is also using the same pickit-3/pic32MX575F512L setup is running similar/standalone code (i.e. without freeRTOS) and has no problems.

One other observation is during initial debugging I noticed the time to step over code/functions seemed very slow when compared to using the pic starter kit/pic32MX360F512L. Not sure if this is just normal behaviour of the pickit-3 but I would expect the hardware config to be the same for both platforms along with the response/speed.

Any help/advice would greatly appreciated.

Regards,
Steve

RE: Problem moving from pic32MX360 to pic32MX575

Posted by steveb on December 4, 2010
Correction to above:

The exception code is 0x1C not 0x41C and equates to 7 not 28.

Exception type is DBE: Bus error exception (data reference: load or store)

RE: Problem moving from pic32MX360 to pic32MX575

Posted by Dave on December 4, 2010
I don't know if this is the solution to your problem, but is something to check. It has tripped people before.

The newer PIC32 devices need different pragma definitions (fuse bit settings maybe, from memory of older PICs?). If you look at the pragmas at the top of main.c for the demo in FreeRTOS\Demo\PIC32MX_MPLAB of the official download you will see this

#pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = OFF
#pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV_2

In the book examples, which use a different and newer PIC32 device, you will see this

#pragma config FPLLODIV = DIV_1, FPLLMUL = MUL_20, FPLLIDIV = DIV_2
#pragma config FWDTEN = OFF, FPBDIV = DIV_2, POSCMOD = XT, FNOSC = PRIPLL, CP = OFF
#pragma config FSRSSEL = PRIORITY_7

The FSRSSEL setting does not exist in the early PIC32 chips, but is essential in the newer ones.

RE: Problem moving from pic32MX360 to pic32MX575

Posted by steveb on December 4, 2010
Nice one Dave!

Seems to be working fine now after adding FSRSSEL = PRIORITY_7. Do you happen to know where this is defined? I'd like to find out what it does... Can't seem to locate it in the reference manual(s).

Stepping over instructions/functions still seems quite slow but will revisit later.

Thanks again!

Cheers,
Steve

RE: Problem moving from pic32MX360 to pic32MX575

Posted by Pistole Gun on June 9, 2011
Hi Steve,

I also have the same problem. I used PIC32 Starter kit (PIC32MX360F512L)
However, when I add #pragma config FSRSSEL = PRIORITY_7
It cannot be built.

my compiler is c32 v1.05 , MPLAB IDE v8.60

Which compiler do you use ?

I will really appreciate your help.
Thanks


[ 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