Quality RTOS & Embedded Software

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


Loading

Quitting the scheduler loop [xtensa] [_frxt_dispatch]

Posted by guido-roncarolo on February 26, 2019

I have a question related to quitting the scheduler loop in the Xtensa FreeRTOS port:

Freertos doc says that in order to quit the RTOS scheduling loop vTaskEndScheduler must be called Please see https://www.freertos.org/a00133.html

vTaskEndScheduler is implemented in term of vPortEndScheduler

Xtensa port has this implementation for vPortEndScheduler void vPortEndScheduler( void ) { /* It is unlikely that the Xtensa port will get stopped. If required simply disable the tick interrupt here. */ }

Having ask my HW buddy, the tick interrupt for us is interrupt 2 and 3,

~~~ Interrupt | Type |Level | BInterrupt | Pin Source ----------+--------+------+------------+----------- 0 | Level | 1 | 0 | Tied low 1 | Edge | 3 | 1 | Tied low 2 | Timer.0| 2 | | Internal 3 | Timer.1| 3 | | Internal ~~~

so I did something like this

~~~ void vPortEndScheduler( void ) { /* It is unlikely that the Xtensa port will get stopped. If required simply disable the tick interrupt here. */ uint32t ints = xthalgetintenable(); __dspprintf("1) xthalgetintenable 0x%xn", ints);

xt_ints_off(1 << 2);
xt_ints_off(1 << 3);
ints = xthal_get_intenable();
__dsp_printf("2) xthal_get_intenable 0x%x\n", ints);

} ~~~ that gives me

~~~ 1) xthalgetintenable 0x4 2) xthalgetintenable 0x0 ~~~ So it would seem that the interrupt is OFF.

Unfortunately_frxt_dispatch keeps running.

Am I making a mistake? Would it be possible to have you guys double check this, please?

Thanks in advance

guido


Quitting the scheduler loop [xtensa] [_frxt_dispatch]

Posted by xz8987f on February 26, 2019

Hi guido, I have implemented ending the scheduler for several microcontrollers. Basically I'm using a combination of setjmp and longjmp. I have documented it in https://mcuoneclipse.com/2019/01/20/freertos-how-to-end-and-restart-the-scheduler/ which has links to the implementation on GitHub. I think you can do the same for your port.

I hope this helps, Erich


Quitting the scheduler loop [xtensa] [_frxt_dispatch]

Posted by guido-roncarolo on February 27, 2019

Hello Erich!

Thanks so much for the very detail and well documented work you did: I tested on my xtensa hifi4 and does work OK!

Thank you so much

guido


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


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

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo, Nuvoton Cortex-M23 demo & STM32H745 dual core (AMP) demo.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

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

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Mediatek

Renesas

RISC-V

SiFIve RISC-V

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