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




Loading

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.

Regards.

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.

Dabaf,


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 ]    [ 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