tasks don't show up on FreeRTOS task list when debugging

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

tasks don't show up on FreeRTOS task list when debugging

4,301 Views
wesleyxie
Contributor III

Hi, 

please check below screenshot, I created a task by xTaskCreateStatic, and named as "Task".

this task is started, I set a breakpoint in my task, and the PC is stopped. then I refresh the "Task list" of FreeRTOS debug plugin, but my task info doesn't show up. (it showed up some times, but some times no, I don't know why)

QQ图片20180101180510.png

0 Kudos
9 Replies

2,737 Views
dkageff
Contributor III

PEMicro says that their debugger does not support FreeRTOS thread aware debugging on the PowerPC.  Given this, are there any solutions that NXP can recommend for FreeRTOS thread aware debugging in S32 Design Studio and the DEVKIT-MPC5748G?  Thanks

0 Kudos

3,632 Views
edw8
Contributor III

Thanks Ruud. Is this something that can be shared with NXP/MCUXpresso IDE team so that it gets included in an upcoming release? I am finding that even with a PEMicro Multilink ACP probe I have the same behavior.

MCUXpresso IDE team, are there any plans to address this issue that you may have already scheduled?

Thanks.

-Ed.

0 Kudos

3,632 Views
ruudsiebierski
Contributor III

Hi Ed,

I changed the following timeout value to something high (like 10000).

gate.await(2000L, TimeUnit.MILLISECONDS);

I used Java Bytecode Editor to do that.

This is some of the decompiled source code (maybe handy for the IDE team?);

  private MemoryByte[] readBytes(long address, long length)
  {
    DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), getContext().getSessionId());
    IStack stack = (IStack)tracker.getService(IStack.class);
    
    MIDataReadMemoryBytes mi = new MIDataReadMemoryBytes(getContext(), "0x" + Long.toString(address, 16), 0L, (int)length);
    final CountDownLatch gate = new CountDownLatch(1);
    final List<MemoryByte[]> list = Collections.synchronizedList(new ArrayList());
    
    DataRequestMonitor<MIDataReadMemoryBytesInfo> rm = new DataRequestMonitor(stack.getExecutor(), null)
    {
      public void handleSuccess() {
        list.add(((MIDataReadMemoryBytesInfo)getData()).getMIMemoryBlock());
        gate.countDown();
      }
      
    };
    ICommandControl cc = (ICommandControl)tracker.getService(ICommandControl.class);
    cc.queueCommand(mi, rm);
    try
    {
      gate.await(2000L, TimeUnit.MILLISECONDS);
    }
    catch (InterruptedException localInterruptedException) {}
    if (list.isEmpty()) {
      Logger.error(Texts.get("Error.ReadBytesTimout"));
      return null;
    }
    
    return (MemoryByte[])list.get(0);
  }
0 Kudos

3,632 Views
edw8
Contributor III

Hello Ruud,

Where can I find the MemoryReader config option? Is this a setting from within MCUXpresso IDE that can be increased? I am running into a similar issue and want to see if I can avoid having to purchase another debug probe. I'm currently using the iMXRT1050-EVKB as a debug probe and also LPC-Link2, both Daplink adaptations.

Thanks.

-Ed.

0 Kudos

3,632 Views
ruudsiebierski
Contributor III

Hi Ed,

It is not a config option unfortunately, I actually changed the binary code of the plugin.

BR,

Ruud

0 Kudos

3,632 Views
ruudsiebierski
Contributor III

Hi,

I had the same problem while debugging using OpenSDA. Turned out that the OpenSDA connection was too slow to transfer the information from the target. 

If you see logging like this in the TAD log, you probably experiencing the same problem.

17:01:45.557 ERROR: [TaskFactory] Cannot read information from "pxReadyTasksLists[5]".
17:01:49.274 ERROR: [MemoryReader] Read bytes method timed out!
17:01:49.274 ERROR: [MemoryReader] Could not get memory block! Invalid address "0x40005a68" and/or "0x1e20" length of a block!
17:01:49.274 ERROR: [TaskFactory] Stack memory block was not read properly, stack has default values.
17:01:50.276 ERROR: [TaskFactory] Cannot read information from "xDelayedTaskList1".

The MemoryReader in the tad plugin uses a default of 2 seconds, which is not always enough. 

BR,

Ruud

0 Kudos

3,631 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

I tried your scenario on modified example project (in attachment if you like to test it on your machine) - and I can't reproduce your issue. All static tasks (4) are shown properly for me all time. 

pastedImage_3.png

My FreeRTOS Task Aware Debugger for GDB version is 1.0.2.201704260904

Jiri

0 Kudos

2,757 Views
dkageff
Contributor III

Hello.  I have a similar problem when trying to debug a FreeRTOS project running on an MPC5748G evaluation board.  I have installed S32 Design Studio for Power Architecture 2.1 and am using the demo project freertos_mpc5748g.  When I run the program, I only see the FreeRTOS system task in the Debug window (see 'Debug window' attachment) , however I do see the four LED tasks when I do a FreeRTOS task list (see 'Task list' attachment).  The project uses FreeRTOS v10.0.1. will try the modifications to FreeRTOSConfig.h described above.  I did check tasks.c for xDelayedTaskList1 and xDelayedTaskList2 and they appear to be globals in tasks.c.  Thet are defined with the PRIVILEGED_DATA macro but that seems to be a blank definition.  Is sthere anything else to look for/try?

0 Kudos

2,755 Views
dkageff
Contributor III

I forgot to mention that I am using the 'debug_ram' configuration and have the PEMicro OpenSDA interface selected.

0 Kudos