Jan 25, 2014
03:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 25, 2014
03:11 AM
HI all,
Is there any application sample to run un this configuration (USBVC001 with RTOS)?
If switched to RTOS (USBLD001 check box), Dave change the App Connectivity view and loads some additional apps (RTOS001 for example).
Main.c:
....
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
/* Initialization of DAVE Apps */
DAVE_Init();
/* Initialization of the USBVC001 App */
USBVC001_Init();
// start RTOS
osKernelStart();
osDelay(osWaitForever);
for (;;);
return 0;
}
in USBVC001_Init(); we get the MemManager exception.
HW: XMC4500 Relax Lite Kit V1
Dave 3.18 build 2013-09-12
USBLD001 - 1.0.12
Is there any application sample to run un this configuration (USBVC001 with RTOS)?
If switched to RTOS (USBLD001 check box), Dave change the App Connectivity view and loads some additional apps (RTOS001 for example).
Main.c:
....
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
/* Initialization of DAVE Apps */
DAVE_Init();
/* Initialization of the USBVC001 App */
USBVC001_Init();
// start RTOS
osKernelStart();
osDelay(osWaitForever);
for (;;);
return 0;
}
in USBVC001_Init(); we get the MemManager exception.
HW: XMC4500 Relax Lite Kit V1
Dave 3.18 build 2013-09-12
USBLD001 - 1.0.12
4 Replies
Not applicable
Jan 28, 2014
12:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 28, 2014
12:42 AM
Hi Tobias,
The "USBVC001_Init()" should be placed inside the thread function since it is used in RTOS environment. Here is an example,
Best regards,
Sophia
The "USBVC001_Init()" should be placed inside the thread function since it is used in RTOS environment. Here is an example,
/* Thread declaration */
void USB_Thread (void const *Argument);
int main(void)
{
DAVE_Init();
osThreadId ThreadId1;
/* Thread definition */
osThreadDef(USB_Thread, osPriorityNormal, 1, 0);
/* Thread creation */
ThreadId1 = osThreadCreate(osThread(USB_Thread),NULL);
if (ThreadId1 != NULL)
{
/* Start the OS kernel explicitly.*/
osKernelStart();
}
return 0;
}
void USB_Thread (void const *Argument)
{
…
USBVC001_Init();
…
}
Best regards,
Sophia
Jan 28, 2014
05:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 28, 2014
05:42 AM
Hi Sophia,
Thanks for help.
I tried to get your code running - but failing in osKernelStart()
Yes, the thread is created - but I do not reach it.
It seems, that the system fails on a stack overflow in HAL_CM4.s
There is the output:
It is close to (HAL_CM4.s)
VSTMDBEQ R12!,{S16-S31} /* yes, stack also VFP hi-regs */
MOVEQ R0,#0x01 /* os_tsk->stack_frame val */
MOVNE R0,#0x00
STRB R0,[R1,#TCB_STACKF] /* os_tsk.run->stack_frame = val */
STMDB R12!,{R4-R11} /* Save Old context */
STR R12,[R1,#TCB_TSTACK] /* Update os_tsk.run->tsk_stack */
PUSH {R2,R3}
BL rt_stk_check /* Check for Stack overflow */
POP {R2,R3}
Still I didn't change any other files than main.c. So I expect the reason in the DAVE framework.
Thanks for help.
BR Tobias
Thanks for help.
I tried to get your code running - but failing in osKernelStart()
Yes, the thread is created - but I do not reach it.
It seems, that the system fails on a stack overflow in HAL_CM4.s
There is the output:
It is close to (HAL_CM4.s)
VSTMDBEQ R12!,{S16-S31} /* yes, stack also VFP hi-regs */
MOVEQ R0,#0x01 /* os_tsk->stack_frame val */
MOVNE R0,#0x00
STRB R0,[R1,#TCB_STACKF] /* os_tsk.run->stack_frame = val */
STMDB R12!,{R4-R11} /* Save Old context */
STR R12,[R1,#TCB_TSTACK] /* Update os_tsk.run->tsk_stack */
PUSH {R2,R3}
BL rt_stk_check /* Check for Stack overflow */
POP {R2,R3}
Still I didn't change any other files than main.c. So I expect the reason in the DAVE framework.
Thanks for help.
BR Tobias
Attachments are accessible only for community members.
Not applicable
Jan 28, 2014
07:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 28, 2014
07:17 PM
Hi Tobias,
Sorry, I missed out two points:
1) Change the stack size to 2048 in RTOS001 RTX tab;
2) Add main USB management task "USB_USBTask()" right after your application tasks (eg. USBVC001_SendString((const char *)"Hello World");)
Attached is an example for your reference.
Best regards,
Sophia
Sorry, I missed out two points:
1) Change the stack size to 2048 in RTOS001 RTX tab;
2) Add main USB management task "USB_USBTask()" right after your application tasks (eg. USBVC001_SendString((const char *)"Hello World");)
Attached is an example for your reference.
Best regards,
Sophia
Jan 29, 2014
12:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 29, 2014
12:26 AM
Hi Sophia,
Thanks, solved!
BR Tobias
Thanks, solved!
BR Tobias