Debugging basic BSP tasking functionality

Matthew J Fletcher amimjf at gmail.com
Tue Apr 16 11:34:17 UTC 2013


Hi,

It looks like i've got some pretty lowlevel problems with the rtl22xx_t BSP
on my hardware, could i ask for some hints on how best to investigate. I am
of course presuming this BSP is production ready, it might be rotten, does
anyone know ?

I have two symptoms.

1) RTEMS calls like rtems_task_wake_after() cause a return from a thread,
despite being wrapped in forever loops.

2) When using CONFIGURE_STACK_CHECKER_ENABLED having threads other than the
Init() and rtems_idle() threads cause the 'IDLE' thread's stack to be
reported as blown.

Now i run through boot_card() fine, task switch into the Init task, so a
task switch has occurred once ok.

An example stack blow.

BLOWN STACK!!!
task control block: 0x814C9BBC
task ID: 0x09010001
task name: 0x49444C45
task name string: IDLE
task stack area (4100 Bytes): 0x814D074C .. 0x814D1750

But my IDLE task is just a forever loop, so it seems unlikely.

See the example code following;

-------------------
#define CONFIGURE_IDLE_TASK_BODY rtems_idle

void rtems_idle (void)
{
    // power save here
    for (;;)
    {
    }
}

rtems_task test_wake_after(int arg)
{
    for (;;)
    {
        rtems_task_wake_after(arg);
    }

    rtems_task_delete(RTEMS_SELF);
}

rtems_task Init(
    rtems_task_argument ignored
)
{
    rtems_status_code status;
    rtems_id id;

    status = rtems_task_create( "wake_after",
        23,
          1024,
        RTEMS_DEFAULT_MODES,
        RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES,
        &id
    );

    status = rtems_task_start(id, test_wake_after, 100);

    rtems_task_delete(RTEMS_SELF);
}

#define CONFIGURE_IDLE_TASK_BODY rtems_idle
#define CONFIGURE_EXTRA_TASK_STACKS         (CONFIGURE_MAXIMUM_TASKS *
RTEMS_MINIMUM_STACK_SIZE)

#define CONFIGURE_MAXIMUM_DRIVERS           6

/* NOTICE: the clock driver is explicitly disabled */
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK

#define CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS
#define CONFIGURE_MAXIMUM_TASKS 40                // TX MAX_THREAD
#define CONFIGURE_MAXIMUM_TIMERS 40                // TX MAX_TIMER
#define CONFIGURE_MAXIMUM_SEMAPHORES 40            // TX MAX_MUTEX
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 40        // TX MAX_MSG_QUEUE
#define CONFIGURE_MAXIMUM_PARTITIONS 5
#define CONFIGURE_MAXIMUM_REGIONS 5
#define CONFIGURE_MAXIMUM_PORTS 0
#define CONFIGURE_MAXIMUM_PERIODS 0
#define CONFIGURE_MAXIMUM_BARRIERS 0

#define CONFIGURE_MICROSECONDS_PER_TICK   10000 /* 10 milliseconds */
#define CONFIGURE_TICKS_PER_TIMESLICE       50 /* 50 milliseconds */

#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
#define CONFIGURE_FILESYSTEM_RFS
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10

#define CONFIGURE_STACK_CHECKER_ENABLED

#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>



------------------------------


regards
---
Matthew J Fletcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20130416/8644114a/attachment.html>


More information about the users mailing list