Hi Daniel,
Thank you for your explanation, but I am a little confused. I am in a bare metal environment, no RTOS. Let me show you what is happening
as I step through my code.
I call my Init() function in my main, it handles all the CPU register configuration and such. It also calls my USB initialization code which
as in the example project calls the following functions:
OSA_Init();
OS_Task_create(USB_task, NULL, 4L, 4000L, "task_start", NULL);
OSA_Start();
int main(void)
{
Init();//Initialize
for (;;) {
Function call 1
Function call 2
etc...
}
Once OSA_Start(); line is executed, the software is tied here (inside fsl_os_abstraction.bm):
osa_status_t OSA_Start(void)
{
#if (TASK_MAX_NUM > 0)
g_curTask = &g_taskListHead;
for(;;)
{
if (g_curTask->p_func)
{
g_curTask->p_func(g_curTask->param);
}
g_curTask = g_curTask->next;
}
This executes the USB code which determines if a USB stick is introduced or not and then executes the fat_demo().
But if a USB stick is not introduced, if I place a breakpoint in my code say on Function call 1, it will never go there. The
program is stuck in the OSA_Start(void) function endlessly looping. I need for it to check if a USB has been introduced and
if not, then continue to Function call 1, 2, etc.., then I will call the USB call again at a later time.
Let me know if you understand?
Thank you,
Neil