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

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