Quality RTOS & Embedded Software

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


Create a FreeRTOS from scratch (For MicroChip chips, MPLab IDE)

Posted by eaoiyrioeaf on March 28, 2017

In some case, modifying the example port to your own port might difficult, because it is difficulty to modify all the settings. I'm sharing my procedure to create a project from zero, hope it can help some one. Below are the procedure: 1> Create an empty project by the MPLab wizard, and choose the correct chip model. 2> Create main source file, main.c. 3> Copy the "Hardware" folder & "Source" folder & "FreeRTOSConfig.h" to the project folder, Add the folders to source folder, ProjectProperties-->XC16-->XC16-gcc-->Preprocessing and messages-->C include dirs, then include the "FreeRTOS.h", "task.h" and "queue.h", this time the compiler should build with no error. 4> Disable COROUTINES the in file "FreeRTOSConfig.h" by set the Micro configUSECOROUTINES to 0. 5> Create a new logic folder under the Source file, rename the folder to "FreeRTOS Source", and add heap4.c, list.c, port.c, portasmdsPIC.S, queue.c, tasks.c into this logic folder. 6> Define a empty function void vApplicationIdleHook( void ) in the main.c file. By now, the project should build with no error. 7> Define Micro for the port "MPLABDSPICPORT" ProjectProperties-->XC16-->XC16-gcc-->Preprocessing and messages-->Define C macros. Try to build the project again, if some include error appeared, modify the path to help compiler find the file. In my case, the compiler says "deprecateddefinitions.h:106:64: fatal error: ../../Source/portable/MPLAB/PIC24dsPIC/portmacro.h: No such file or directory". I just change the include statement from #include "../../Source/portable/MPLAB/PIC24dsPIC/portmacro.h" to #include "portmacro.h" then the build pass. 8> At last, we might need to uncheck the Use legacy libc option, Project_Properties-->XC16(Global Options)-->Use legacy libc. according to the help document this option:"Check to use libraries in the format before v3.25. Uncheck to use the new (HI-TECH) libraries format."

Create a FreeRTOS from scratch (For MicroChip chips, MPLab IDE)

Posted by rtel on March 28, 2017

Thanks for these MPLAB specific details. They augment the 'generic' pages: http://www.freertos.org/Creating-a-new-FreeRTOS-project.html http://www.freertos.org/porting-a-freertos-demo-to-different-hardware.html

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

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Version 10.1.0 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