Error Code in Sample Program

Hi, 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? Thanks,
Gary

Error Code in Sample Program

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

Error Code in Sample Program

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? Gary

Error Code in Sample Program

…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. Regards.

Error Code in Sample Program

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! Gary