Quality RTOS & Embedded Software

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


printf wont work with pic32 example

Posted by david bafumba on March 5, 2011
I everybody,

I am using FreeRTOS demo program for PIC32MX360F512L and "printf" is not working. is there a setting that I have to make?
I just bought the PIC32 starter kit with the io expansion board, I also bought the book from FreeRTOS (FreeRTOS -a practical guide-pic32 edition). when I run my first progrm from the example001, nothing happen. I dont see what printing tasks as described in the book. is there someone who can point me to the right direction? thanx for your assistance

RE: printf wont work with pic32 example

Posted by Richard on March 5, 2011
> I am using FreeRTOS demo program for PIC32MX360F512L

The demos that come with the book are targeted at the PIC32 USB-II starter kit. That has a PIC32MX795F512L part, which is newer than the PIC32MX360 series. The newer part require one extra configuration option to function, and I'm not sure if that configuration option would prevent the older parts from working. To test this theory, simply remove the line:

#pragma config FSRSSEL = PRIORITY_7

from main.c.

> and "printf" is
> not working.

The demos should be completely configured for printf() to output to an MPLAB window. The call to DBINIT() within vSetupEnvironment(), called from main() configures this for you.

Finally, if you are using the very latest C30 version then the libraries changed the default output buffering from line buffered to no buffering. This would not prevent output being generated, but does make it very slow. I updated the book demos to include a call to vSetIOBuffering() [again called from vSetupEnvironment() in main()] - so check your book demos have this call.

Hope this helps.


RE: printf wont work with pic32 example

Posted by david bafumba on March 5, 2011

hi Richard,

I checked that all the functions you recommended were there(DBINIT() andvSetIOBuffering() called from vSetupEnvironment() ) I never changed anything in the example001. I commented out the< #pragma config FSRSSEL = PRIORITY_7 > line since it wont compile with it. still the printf wont work.

I had the idea of setting pins in PORTD as output TRISD = 0; in main and putting the line PORTD =0X0001; in task1 and PORTD =0X0002; in task2 so I can see the change with my leds. the task1 light up for 1 second and off forever. the task2 light up just after the task1 and stay on forever. I guess it because I remove the < #pragma config FSRSSEL = PRIORITY_7 > . but I can’t put it back since it won’t compile(main.c:44: error: unknown configuration setting: 'FSRSSEL'). So I guess I am stuck... I wish I had the PIC32MX795F512L as recommended in the book.


RE: printf wont work with pic32 example

Posted by Rick Pray on April 1, 2011
I have the USB Starter Kit II and I was having the same problem. I commented out the vSetIOBuffering(); and now I can see the output. So the addition of vSetIOBuffering() broke the vPrintString() output for me.

[ 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