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

move PIC18F code from 5.3.0 to 7.0.1

Posted by Mark on August 22, 2011
I have a set of working code for PIC18F2685 that was built with FreeRTOS v5.3.0. [I inherited it from someone who is no longer here. I've successfully made some fixes and modifications from time to time.]

A couple of times in the last year or two, I have attempted to move this project to a newer version of FreeRTOS. The effort generally fails, and to simply get work done, I revert to the old 5.3.0.

I'm only developing for one target [PIC18F development with MPLAB IDE and MPLAB c18 Lite], so I deleted all of the other ports from the 7.0.1 directories. Since there are only a few files, I moved the FreeRTOS source files to my "src" directory in MPLAB project, and I moved the include files to my "src\include" directory in the project. I changed the path in the #include for portmacro.h inside portable.h.

During the compile, I get a few warnings about typing. I crawled through the FreeRTOS source and I think the types are okay.

C:\$Projects\src\tasks.c:502:Warning [2066] type qualifier mismatch in assignment

C:\$Projects\src\serial.c:207:Warning [2074] location PRODH specified in the interrupt save list is redundant
C:\$Projects\src\serial.c:207:Warning [2074] location PRODL specified in the interrupt save list is redundant
C:\$Projects\src\serial.c:207:Warning [2074] location TABLAT specified in the interrupt save list is redundant
C:\$Projects\src\serial.c:207:Warning [2074] location .tmpdata specified in the interrupt save list is redundant
C:\$Projects\src\serial.c:234:Warning [2074] location PRODH specified in the interrupt save list is redundant
C:\$Projects\src\serial.c:234:Warning [2074] location PRODL specified in the interrupt save list is redundant
C:\$Projects\src\serial.c:234:Warning [2074] location TABLAT specified in the interrupt save list is redundant
C:\$Projects\src\serial.c:234:Warning [2074] location .tmpdata specified in the interrupt save list is redundant

C:\$Projects\src\list.c:74:Warning [2066] type qualifier mismatch in assignment
C:\$Projects\src\list.c:82:Warning [2066] type qualifier mismatch in assignment
C:\$Projects\src\list.c:83:Warning [2066] type qualifier mismatch in assignment
C:\$Projects\src\list.c:156:Warning [2066] type qualifier mismatch in assignment

The project compiles, programs, and runs my initializations prior to setting up the FreeRTOS setup [e.g. vPortInitialiseBlocks(...); xTaskCreate(...); and, vTaskStartScheduler()]. But the application does not run.

I've tried commenting out all of the CAN, RS232, and UI code, and left a simple "heartbeat_LED" task, but it does not go.

I would appreciate any hints.

I have done considerable C/C++ coding in my career; but, I am relatively new to Microchip and FreeRTOS.

RE: move PIC18F code from 5.3.0 to 7.0.1

Posted by MEdwards on August 24, 2011
PIC18 is not a good target for any pre emptive RTOS because of the horrid way it banks memory.

According to http://www.freertos.org/History.txt FreeRTOS V7.x is backward compatible with FreeRTOS V6.x and FreeRTOS V6.x is backward compatible with FreeRTOS V5.x. you have to go back as far as 4.x to find an incompatibility when an ISR safe queue function changed. So sorry, can't help. The theory is, if you are using the same project files, you should just need to copy the latest FreeRTOS code over the top of the old FreeRTOS code.

Have you tried updating the compiler?

RE: move PIC18F code from 5.3.0 to 7.0.1

Posted by Mark on September 6, 2011
The FreeRTOS site cautions that PIC18 is not a good target. So far it's worked okay, but I'm doing fairly simple and non-demanding tasks, and the compiler has been good about handling the memory addressing.

The problem boiled down to my unfamiliarity with setting up a new FreeRTOS project in MPLAB IDE for the C18 toolsuite.

I crawled through the source code with a diff tool and I noticed that an important MPLAB C18 header was include only if "MPLAB_C18_PORT" was defined but it did not seem to be defined in code. I loaded the old project and found it was defined in the compiler option settings. This got me one step nearer.

I laboriouly went through all of the MPLAB IDE project settings and configurations making screenshots of each tool/page/tab in the working project. Then I went through a new project in the same detail to compare to the old settings.

The problem was the output needed to be INHX8M. The default in the new project was INHX32.

I am building and running.

Now if I can just figure out how to set up control registers so I can use ISR to read CAN instead of polling the input buffer.
But that is another topic for another post...

Kind regards.
- -
Mark


[ 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