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


Error Code in Sample Program

Posted by rog57 on December 21, 2012

I've taken the "webserver" demo for IAR, modified it by removing everything for the USB and webserver, then added a bunch of my code in to IAR for peripheral access to the ADC, I2C, GPIO, etc. It compiles well and I've already created a couple of basic tasks including one that makes a call to the I2C temperature sensor on the board.
When putting data to the DBG port, a error message is being generated. This message is in the function "vApplicationTickHook" . The message is this: "An error has been detected in the Block Time test demo.", and comes up nearly every call after the task that does the I2C temperature read.

What's the cause, and how can it be taken care of?


RE: Error Code in Sample Program

Posted by Richard on December 21, 2012
Some of the standard demo tasks contains self checking code. The block time tasks test that the tasks are blocking, or more accurately, unblocking at the expected times. The test includes a little margin of error to allow for the fact that other tasks are running too, but still rely on the block time tasks being one of the highest priority tasks in the system. I guess that your debug output message is taking so long to execute that the block time task is not running within the time frame its own self checking expects.

How are the debug message being output? Some of the console out semi-hosting type mechanisms actually stall the processor while the output is being sent and that will make the code think it is outside of its allowed self checked timing bands. Other use things like virtual com ports which have excessively long interrupt functions, or excessively long critical section that will also disrupt the execution pattern.

You can ignore the warning, it is not an error as such, but does show that something in your code is taking a lot of time from high priority tasks.


RE: Error Code in Sample Program

Posted by rog57 on December 21, 2012
Thanks for the prompt reply.
I am using the standard CMSIS "debug_frmwrk.c" _DBG_ calls, which output directly out UART0 using PUTC. It's set up at 115K. I have had no issues putting data out the debug port in extremely fast loops without missing data, so I would be surprised if this was the problem

I have one task reading temperature (I2C) and displaying every 4000ms; the other task reading voltage (ADC) and displaying every 7000ms.

The third task is the LED flash tasking, running every 500ms

The variable "mainCHECK_DELAY" is presently at 10000ms. All tasks are set to "mainFLASH_TASK_PRIORITY".

Since these are the only 3 tasks running, which one do you suspect is hogging too much time?


RE: Error Code in Sample Program

Posted by Richard on December 21, 2012
...assuming non of the drivers a disabling interrupts for long periods, is the block time test task the highest priority task in the system?

You can just take the task out, it is only for demo purposes.


RE: Error Code in Sample Program

Posted by rog57 on December 21, 2012
OK, I was not aware of that, but probably would be if I were further ahead in the book! I'm just jumping a bit ahead of myself, but pretty enthused by what I've been able to do so far!

I'm sure I will have more questions as I advance forward. Thank you for the answers!


[ 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