This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS v4.1, Stellaris, and SafeRTOS

Hi,

I'm evaluating CCS v4.1.0.02006 for use on a Stellaris LM3S9B96, which has SafeRTOS in ROM.  The safe rtos demo builds & runs fine, but I do not see any kernel awareness in CCS.  Is there any kernel awareness in CCS for this RTOS?  If not now, will there be?  Is there kernel awareness in CCS for any MCU RTOS?

Thanks!

Paul

  • Paul,

    We have Kernel awareness for Linux and BIOS in CCS.  At the moment we don't have plans for anything else.  BIOS is available for our MCUs and is free.

    What sort of kernel awareness features are you used to using?

    John

     

  • Thanks John.

    In eclipse, there is a more-or-less built in feature that allows displaying basic thread info in the debug window (which now always says thread [main]).  When the cpu is paused, it should display all threads, with their name, and then selecting a thread will switch the local variable window to the context of that thread.  I'm sure there is some sort of plug in required to get this working with each different RTOS, but I'm not an eclipse guru, so couldn't tell you how it works.

    In addition to the built-in thread feature of Eclipse, other windows that display kernel objects, such as queues, semaphores, etc are very handy to have.  I've downloaded the High Integrity Systems Eclipse plug in for OpenRTOS, which has these features, but it doesn't seem to work with SafeRTOS.  I'm not sure if that is a CCS issue, or that SafeRTOS doesn't provide the same hooks as OpenRTOS (seems like it should, since they're essentially the same).

    -Paul

  • Paul,

    Yes the debugger can provide thread context info to Eclipse to display.  We do that for Linux: http://tiexpressdsp.com/index.php/Linux_Aware_Debug

    For BIOS we have a tool where we display all the kernel objects.

    I am not familiar with the differences between OpenRTOS and SafeRTOS, one thing to check is the Eclipse version the OpenRTOS plug-ins require.  CCSv4.x is based on Eclipse 3.2 which is a bit older so you may need to get an older version of the plug-in to work.  If installing the plug-in via update manager it will detect this but if they just have it as part of a zip it may not.

     

    John

  • I found the plug-in you mentioned.  The install doesn't do much, I had to copy the .jar file into the ccsv4\eclipse\plugins folder.  After that it showed up in CCS ok.

     

    There was some info in one of the documents that may help:

     

    2.2 REQUIRED FREERTOSCONFIG.H SETTINGS

    Each OPENRTOS project includes a header file called FreeRTOSConfig.h, in which various OPENRTOS options can be configured. Configuration options relevant to using the Eclipse STATEVIEWER plug-in are configQUEUE_REGISTRY_SIZE and configUSE_TRACE_FACILITY.

    If the version of FreeRTOS being used is older than version 5.2.0 then configUSE_TRACE_FACILITY must be set to 1. In all other cases configUSE_TRACE_FACILITY has no impact on the plug-in functionality.

    OPENRTOS includes a „queue registry‟ feature. After a queue or semaphore has been created it can optionally be added to the queue registry using the OPENRTOS vQueueAddToRegistry() API function. The plug-in will only display queues and semaphores that have been added to the registry. The number of places available in the queue registry is configured at compile time using configQUEUE_REGISTRY_SIZE. For example, to allow up to 10 queues and semaphores to be registered set configQUEUE_REGISTRY_SIZE to 10. If configQUEUE_REGISTRY_SIZE is not included in FreeRTOSConfig.h then vQueueAddToRegistry() will have no effect and the plug-in will not display any queue or semaphore information.

     

    I see now that this is based on FreeRTOS.  One thing to note is there is not a port of FreeRTOS to the TI compiler.  I don't know if that would impact things in this case since it is already in ROM.

     

    John

     

  • Yes, the linux example is what I normally expect to see in eclipse.  The question is, can this thread context info be made to work for SafeRTOS in the Stellaris cpu.  Any suggestions?

  • I'll look into those settings, not sure if they apply to SafeRTOS.  I understand that FreeRTOS is not supported by the TI compiler, but SafeRTOS certainly is, which is a subset of OpenRTOS, so I was hoping this plug-in might work with SafeRTOS and provide the state information (tasks & queues).  I'll contact high integrity systems about that. 

    In any case, at the very least, I'll really need to figure out how to get the basic thread context info, which wouldn't be supplied by this plug-in.  I appreciate your help.

    -Paul

  • To get the info to show in the debug view a DLL would have to be created in the TI debugger that is integrated into Eclipse.

    I started a thread on the SafeRTOS forum.  Hopefully they have some well defined structures that could be read to get the info.  A possibility might be to write a little script for the scripting console that would read the structures, lookup the symbols and they output the info to the console.

     

    John

  • Here is the info I received from the SafeRTOS folks:

     

    The ROM does actually contain a function with the following prototype:

    xTaskHandle xTaskGetCurrentTaskHandle( void );

    This is at address 0x020006c4 so you can call it by casting a function pointer to that address just as the other functions are accessed.  It does not appear in the official ROM map and can't be called from an ISR.

    The variable pxCurrentTCB contains the handle of the currently executing task.  This is located in RAM at address 0x20000010 and can be read directly - it is of type xTaskHandle, which is just a 32bit pointer.  It is not however intended to be accessed by application code directly!  Although there is nothing to stop you doing so if you wish.

    I don't have access to the safeRTOS header files.  Can you see what xTaskHandle looks like?  If it is a pointer to a structure it might be possible to extract the threadID and perhaps other context info.

    John

  • The SafeRTOS header files are installed as part of TI StellarisWare, under third_party/SafeRTOS.  xTaskHandle is a pointer to void, which presumably is a TCB pointer.  Looking through the header files, I don't see any definitions of a tcb.

    -Paul