Quality RTOS & Embedded Software

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


HT-TECH picc18

Posted by Nobody/Anonymous on January 5, 2005
Hello r.barry,

Can FreeRTOS use HT-TECH picc18 complier instead of mcc18 complier for pic18 port?

Best regard!

RE: HT-TECH picc18

Posted by Richard on January 5, 2005

There is currently no port for the HI TECH compiler, but no reason I know of why one could not be produced. This would however take some effort.

Best regards.

RE: HT-TECH picc18

Posted by Nobody/Anonymous on January 11, 2005
I was told that since you can't access the stack in Hi-Tech, you can't use a pre-emptive RTOS.

RE: HT-TECH picc18

Posted by Nobody/Anonymous on January 11, 2005
I'm not familiar with this compiler but if it does not allow you to access the stack then portions of the port would have to be written in assembly. The IAR ARM7 port is similar. Here the inline assembly cannot access the required C variables so wrappers are written in assembly, and these just call the C functions. The stack management is handled by asm macros. The other ports don't have assembly files.

RE: HT-TECH picc18

Posted by Nobody/Anonymous on January 11, 2005
They use what they call a "Compiled Stack." I think that means that there is no stack. There is a fixed call tree instead. But I'm not sure exactly what that means.

RE: HT-TECH picc18

Posted by Nobody/Anonymous on December 18, 2005
I'm actually working on a port to the HT-Soft PICC18 compiler for FreeRTOS. I've gotten it to a point where I've run into an issue with the software stack. I don't understand how the MPLAB C18 compiler would work here either.

What I see is that the linker script provided looks like it assigns the firxt 0x60 bytes at the top of the BIG_BLOCK (Heap) to be a stack. Then, in the code (demo#1) the first mention or access of the stack is in the xSerialPortInitMinimal-> xQueueCreate-> pvPortMalloc-> vTaskSuspendAll-> portENTER_CRITICAL function/macro at the first queue creation. This macro assigns INTCON to POSTINC1 without initializing FSR1 in any visible way.
I don't see how this could work at all. Does the MPLAB C18 assign FSR1 magically and permanently to the stack based on the linker request? Wouldn't a section of the heap need to ba allocated as a software stack, and the FSR pointed to the right location before access? Otherwise, how can one be sure the compiler hasn't hijacked the FSR for some other purpose in the compiled code since last access?

Can someone help?

RE: HT-TECH picc18

Posted by KenL on December 18, 2005
I wrote the previous message. Created an account to facilitate further messages. This message is sent with said account.

RE: HT-TECH picc18

Posted by Nobody/Anonymous on December 18, 2005
It has been some time since I looked at the PIC port, but I recall that the port code just uses the same programmers model as the compiler. You would have to check the C18 documentation but I'm petty sure that this register is used as the stack pointer by the compiler and therefore setup by the C init routines before main() is called. The compiler always expects this to point to the stack from that point on and never uses the register for anything else.

RE: HT-TECH picc18

Posted by KenL on December 19, 2005
I have looked and what you describe is correct, although I'm somewhat suprised by the convention. I've also found that the PICC18 uses a hybrid of the internal hardware stack (for function return addresses) and a compiled stack (for data params). I'm not sure how to account for that in FreeRTOS yet. This comparison of PICC18 and C18 may also be useful: http://www.xargs.com/pic/picc18-vs-c18.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