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

FreeRTOS base Question (stm32f HID/VCP)

Posted by msahn on January 22, 2013
hi~

I have several Question like below.


h/w : STM32F
s/w : based FreeRTOS , HID/VCP
My Program have been 5 tasks( HID/VCP TX , HID/VCP RX , UART TX, UART RX, test )

1. I would like to know method to check test task periodically.
I want to check test task works well.

Except vTaskList function. ( because : This function will disable interrupts for its duration. It is not intended for normal application runtime use but as a debug aid )


2. when coding below method(2.1 and 2.2), system became pause(stop). Is pause(stop) Action normal?

2.1 after same task duplicate create(same handle) , duplicate delete ==> system pause(stop)
ex> xTaskHandle xHandle;

xTaskCreate( , , , , , &xHandle )
xTaskCreate( , , , , , &xHandle )
vTaskDelete(xHandle); // system live
vTaskDelete(xHandle); // system pause(stop)

2.2 without task create, when random task handle delete. ===> system pause(stop)
ex> xTaskHandle xHandle;

vTaskDelete(xHandle); // system pause(stop)


3. I can communication this method ( STM32F USB HID <--> Window ).
I want communication this method ( STM32F USB HID <--> android ). Is it possible ????
If possible , I know method.


Help Me. please,

because of Short English , explanation is diffcult. sorry.


RE: FreeRTOS base Question (stm32f HID/VCP)

Posted by Richard on January 22, 2013
“1. I would like to know method to check test task periodically.
I want to check test task works well. ”


What is it you want to know about the test task, and when do you want to know it?

If you want a snapshot view of the task then you could use a state viewer plug-in if you are using IAR or an Eclipse based IDE. That will tell you the stack usage at least.

You can also code the task to monitor itself, if you want continuous monitoring.



“ xTaskCreate( , , , , , &xHandle )
xTaskCreate( , , , , , &xHandle )
vTaskDelete(xHandle); // system live
vTaskDelete(xHandle); // system pause(stop)”



Is xHandle the same variable? A task handle can only reference one task at a time. It will reference the first task created after the first call to xTaskCreate(), but then that reference will be lost and it will instead reference the second task created after the second call to xTaskCreate.

Then, after the first call to vTaskDelete() xHandle will not reference any valid task (the task it did reference is not deleted), so the second call to vTaskDelete() will be invalid.


“ I want communication this method ( STM32F USB HID <--> android ). Is it possible ????”


I know some vendors provide software with this functionality (NXP do I think, for example), but it is way outside of my knowledge space and not FreeRTOS released.

Regards.

RE: FreeRTOS base Question (stm32f HID/VCP)

Posted by msahn on January 22, 2013
first, thanks you. richardbarry. thanks

1. Answer , Add a Reply

-> I don't want like IAR viewr plug-in.

Just need to confirm test task.
I want to know test task imformation whether live or die.
I want to know test task imformation whether working or not working.

You can also code the task to monitor itself, if you want continuous monitoring.
-> This answer is good.
but, need to more detail imformation.
I don't know to use what FreeRTOS API function for monitor itself.

please, one more,

RE: FreeRTOS base Question (stm32f HID/VCP)

Posted by Richard on January 22, 2013
Most of the standard FreeRTOS demos use a set of common tasks that monitor themselves and update a counter if they are running correctly. A check task then monitors all the counters to ensure that all the tasks are running as expected. This is just one way of doing it though.

The best way of doing it depends on what your task is doing. For example...if the task is supposed to run every second, then have the task read the time each time it executes so the task knows if it is running at the correct rate or not. If it detects that it is running at the correct rate it can communicate the error to whatever is monitoring the system. You can also use the hardware watchdog by having the task kick the watchdog if it is running and running correctly, and have it not kick the watchdog if it is not running or running incorrectly.

Regards.

RE: FreeRTOS base Question (stm32f HID/VCP)

Posted by Jerry Durand on January 22, 2013
One thing I do to check if tasks are running is I have each task I care about set a bit in my global FLAGS variable. Periodically (slowly) I run a Housekeeping task and one of the things it does is check the flags (easy to do with a bit mask). If all is well it clears the flags and continues. Otherwise it skips touching the watchdog timer so the system will reset.

Note that on setting and clearing flag bits in a global FLAGS variable I have two short functions that enter critical task while doing the change to prevent being swapped out in mid-change and messing up the global FLAGS.

FlagSet(bit_mask); // OR in the bit
FlagClear(bit_mask); // AND out the bit


[ 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