Quality RTOS & Embedded Software

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


Loading

questions about PIC32 porting

Posted by Piero B on February 25, 2010
Hi all

i have some questions:

1. Why there is this setting: configISR_STACK_SIZE ? i didn't understand how i can manage it
2. What are the rules to manage ISR priorities using this port, if i need ISRs that works with or without kernel API?
3. (THE MUST IMPORTANT) If i try to compile using 16bit, even putting some functions with attribute nomips16, porting doesn't work! have you ever try to build a demo on mplab using 16bit setting for compiler?

thanks to all

RE: questions about PIC32 porting

Posted by Richard on February 25, 2010
“1. Why there is this setting: configISR_STACK_SIZE ? i didn't understand how i can manage it”


This is in FreeRTOSConfig.h. Any definition that starts 'config' should be located in there (in theory).


“2. What are the rules to manage ISR priorities using this port, if i need ISRs that works with or without kernel API?”


Search for configKERNEL_INTERRUPT_PRIORITY on this page http://www.freertos.org/port_PIC32_MIPS_MK4.html


“3. (THE MUST IMPORTANT) If i try to compile using 16bit, even putting some functions with attribute nomips16, porting doesn't work! have you ever try to build a demo on mplab using 16bit setting for compiler?”


I have just queried this myself and the answer was that there is no fundamental reason why it should not work with the nomips16 attribute placed correctly. The main assembly code that performs the context switch already has this attribute set, but maybe it needs to be elsewhere also. I have to admit to not having tried it.

Regards.

RE: questions about PIC32 porting

Posted by Piero B on March 1, 2010
“Quote:
1. Why there is this setting: configISR_STACK_SIZE ? i didn't understand how i can manage it

This is in FreeRTOSConfig.h. Any definition that starts 'config' should be located in there (in theory).”

Ok... i found something about thsi in freertos website. Now it is clear.
“Quote:
2. What are the rules to manage ISR priorities using this port, if i need ISRs that works with or without kernel API?

Search for configKERNEL_INTERRUPT_PRIORITY on this page http://www.freertos.org/port_PIC32_MIPS_MK4.html ”

Thanks for your feedback.
“Quote:
3. (THE MUST IMPORTANT) If i try to compile using 16bit, even putting some functions with attribute nomips16, porting doesn't work! have you ever try to build a demo on mplab using 16bit setting for compiler?

I have just queried this myself and the answer was that there is no fundamental reason why it should not work with the nomips16 attribute placed correctly. The main assembly code that performs the context switch already has this attribute set, but maybe it needs to be elsewhere also. I have to admit to not having tried it. ”

Richard, i found the solution! Let me explain.

In pic32 porting, there are 3 macros (portDISABLE_INTERRUPTS(void); portENABLE_INTERRUPTS(void); portYIELD(void); )
that have inside microchip library macros:
_CP0_GET_STATUS();
_CP0_SET_STATUS( ulStatus );

These macros are different if __mip16 is defines, and this define is added for each file if project build option GENERATE 16 BIT CODE is set.

It seems there is a problem when a 16 bit version for _CP0_xxx is used.

So, i did the following changes:

- all files are compiled using 16bit except port.c
- i changed portmacro.h: in my code (portDISABLE_INTERRUPTS(void); portENABLE_INTERRUPTS(void); portYIELD(void); ) became functions moved in port.c, so, all other files will use a 32bit version for these functions, that means that _CP0_xxx are always used in 32bit version

i will provide to your personal email my modified files.

Bye
Piero


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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

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.


Careers

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

Renesas

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