Quality RTOS & Embedded Software

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


PIC32MZ UART RX crashes prvIdleTask

Posted by arhancock on March 28, 2017

I am porting our application form a custom PIC32MX board to a new custom PIC32MZ board. I am using Microchip's Harmony 2.01b and FreeRTOS 9.x. I have two uarts configured in the project (UART 1 and 3). Both are transmitting okay. When I receive a character form UART 3, I get a general exception at an address that is in the middle of prvIdleTask. Being failry new to Harmony and FreeRTOS, I am at a loss at to how to debug this. I have tried increasing various stack sizes - no difference, and different Harmony usart models (Byte mode and Buffer queue mode) - not difference.

Any ideas?

PIC32MZ UART RX crashes prvIdleTask

Posted by rtel on March 28, 2017

Is it the case that your application code runs ok on the old board, but the exact same code does not run on the new board? If so, then the first question would be what is different about the boards? Are the PIC32 devices the same on both?

If you think there is a stack overflow then the easiest thing to do is ensure stack overflow detection is turned on:


PIC32MZ UART RX crashes prvIdleTask

Posted by arhancock on March 30, 2017

The boards are significantly different, starting with the PIC. The old one is PIC32MZ695F512L and the new one is PIC32MZ2048EFH144. I/O has been reorganized around the new PICs I/O ports. The serial ports remain the same. The application is normally flashed with a custom USB based boot loader, residing in the lower part of program flash space. A linker script is used in the application build to move the application up 256K. If the application is build with the default linker script and flashed with a programmer, rather than with the boot loader, the serial RX works correctly. Analyzing the load maps between the two versions has not revealed anything helpful. Is there anything in FreeRTOS that needs to be adjusted for vector tables that have moved?

PIC32MZ UART RX crashes prvIdleTask

Posted by rtel on March 31, 2017

Not sure specifically for the PIC32 without cracking out the MIPS manuals to remind myself, but often devices require a register to be set to to the base address of the vector table. If the vector table is moved then the bootloader should setup the required registers before calling the application code.

PIC32MZ UART RX crashes prvIdleTask

Posted by arhancock on March 31, 2017

The boot loader jumps to a copy of the reset code in the application - effectively rebooting the PIC at the application's location. Again, many of the inerrupts are working, its just that UART TX event that trashes the system - event before the ISR get called.

PIC32MZ UART RX crashes prvIdleTask

Posted by arhancock on March 31, 2017

I found that if I move the ebase_addr in the linker script to place the IVT 64K above reset (rather than the 4K I had it at), the error goes away.

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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists