Debugging Problem with FreeRTOS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debugging Problem with FreeRTOS

1,686 Views
samc
Contributor III

Hello,

I develop an application with FreeRTOS since several weeks and since 3 days I have a problem.

I use the PE Multilink debugger with KDS V3.2.0 and processor expert. I installed FreeRTOS Task Aware Debugger for GDB plug-in.

All worked fine until the last week where I had debugging problem :

1)  It seems that debugger is not able to debug all thread except "main thread". Normaly in the debug window there is state of all thread (I had this possibility before) but now nothing except "main" thread. See "Only One Thread.png".

However all threads are running, my application works fine.

2) When I place a breakpoint, the application stops correctly but it's impossible to use "step by step " to debug ("step into / step over / step return)? It works only at start-up when executing code in "main" function. It seems to have a direct link with the first point...

3) When I launch the debugger and I do a "suspend" then a "resume" the application doesn't run again. Same with a "terminate" I have the is error message : Erreor Message.png.

4) When I launch the debugger and I do a "suspend", "Task List" is empty, "Queue List" have this error :Error Queue.png and this one: Remot Failure Reply Error.png

Does anybody know what's the source of this problem ?

Best Regards,

Sam

0 Kudos
3 Replies

1,350 Views
samc
Contributor III

Hi,

I did new test and it's strange. In my application I have a conditional compilation to manage 2 flash models and with the other I have no problem.

So I continue to developp and now the problem appears with new code implementation.

After test, I see this behaviour : when I declarre a global variable like this "unsigned char test_U8A[6] = {0};", I have the bug when I delete the initialisation like this : "unsigned char test_U8A[6];" it works.

Is it possible to have a problem from this ?

EDIT: After moved all initialized variables at déclaration to code (initializing function), all works and with the 2 flash.

I never had this case, is it normal to not have any warning or error with compiler ? is there an option to activate this in KDS ?

0 Kudos

1,350 Views
samc
Contributor III

Hi,

Thanks you your reply.

I tested your suppositions, I'm sure it's not that.

However I have a track. My application have several tasks (higher than 10) and when I create task without "xTaskNotifyWait" function it works correctly. When I had a task with this function the problem appears. On this kind of task I tried deleting this function and executing the code, it works, then I add the "xTaskNotifyWait", it bugs. I don't understand what I was able to make to have this behaviour. When I create a new project with a xTaskNotify, no problem.

Sam,

0 Kudos

1,350 Views
BlackNight
NXP Employee
NXP Employee

Hi Sam,

it seems to me that the debugger is not able to find all the necessary data structures of your application. Can you check and disable any code optimizations in your project settings.

Check the stack size of each task. I saw a problem recently if a task had a huge stack size set (1000 uint32_t): keep it 'reasonable', e.g. around 500.

About 2): Keep in mind that the number of hardware breakpoints are limited (4 usually on Cortex-M4), so you cannot have too many set and then you cannot step. Remove/disable the other breakpoints, or consider using 'Skip Breakpoints' as described in Software and Hardware Breakpoints | MCU on Eclipse 

Other than that: check that your debug cable is not exposed to any noise (motors/etc).

I hope this helps,

Erich

0 Kudos