Quality RTOS & Embedded Software

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




Loading

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:

http://www.freertos.org/Stacks-and-stack-overflow-checking.html


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) 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