Hi:
When I recently used the MSC8157, I needed to use the SmartDSP operating system, but I encountered the following problems when using the operating system:
(a): When I run SmartDSP early, the system will be stuck in the function ‘osWaitForAllCores();’. When I redefine OS_MULTICORE = OFF, OS_MULTICORE_SYNCHRONIZATION = OFF, the system will run normally.
(b):I created a simple task under the SmartDSP operating system. The source code is as follows. The problem is that after the system initialization completes all the operations, my task will not be executed. I have seen the SmartDSP OS Usrt Guide and the SmartDSP OS API Reference. Manual two documents, and found no mistakes, please advise, thank you very much:
os_task_handle Test_Task1_Handle;
os_task_init_param_t Test_Task1_Para;
unsigned char *Test_TASK1_STACK;
#define Test_TASK1_STACK_SIZE 4096
void Test_Task1_Function(unsigned long p)
{
while(1)
{
printf("My Name is Test_Task1_Func\r\n");
osTaskDelay(500);
}
}
void Test_Task1_Create(void)
{
os_status status;
status = osTaskFind(&Test_Task1_Handle);
OS_ASSERT_COND(status == OS_SUCCESS);
Test_TASK1_STACK = osMalloc(Test_TASK1_STACK_SIZE,OS_MEM_LOCAL);
Test_Task1_Para.task_function = Test_Task1_Function;
Test_Task1_Para.task_arg = (os_task_arg)osGetDeviceID();
Test_Task1_Para.top_of_stack = (unsigned long)Test_TASK1_STACK;
Test_Task1_Para.stack_size = Test_TASK1_STACK_SIZE;
Test_Task1_Para.task_flags = 0;
Test_Task1_Para.task_priority = OS_TASK_PRIORITY_12;
Test_Task1_Para.task_name = "Test_TASK1";
Test_Task1_Para.private_data = 0;
Test_Task1_Para.init_stack = TRUE;
osTaskCreate(Test_Task1_Handle,&Test_Task1_Para);
}
void main()
{
os_status status; // The only local variable in main()
/* OS Initialization - call before any other OS API calls. */
status = osInitialize();
if (status != OS_SUCCESS) OS_ASSERT;
/* Interrupts are disabled until osStart() is called.
You must not enable interrupts at this point !!! */
/* Place any required initialization code within appInit().
Using local variables inside main() is NOT recommended, because
its stack is never restored - osStart() never returns !!! */
status = appInit();
if (status != OS_SUCCESS) OS_ASSERT;
Test_Task1_Create();
/* Start the OS with the background task. OS ticks now start.
appBackground() should not return unless there is an error. */
status = osStart(appBackground);
if (status != OS_SUCCESS) OS_ASSERT;
/* Execution reaches this point only if an error occurs. */
}
Hi, HaiFeng,
I have asked AE team, I will give you a reply shortly after I get a feedback.
BR
Xiangjun Rong
Ok, thank you very much.
Hi, HaiFeng,
This is AE team reply:
"
This is an update to your question/request:
IN SDOS, to make a task run, you need the following to trigger scheduler,
- the current running task yield itself
- interrupt happens and responed
Please check your code to ensure the above. Also you can study the SDOS basic_demo or stationary demo project
"
Hope it can help you
BR
XiangJun Rong
Hi,XiangJun:
Thanks for your help.The second question has been solved. Now I will go to the document mentioned above and try to solve the first problem. Thank you very much.