Hi~
We run demo code[Onboard_demo], it seems abnormal.
System will be halted and QCLI_Thread isn't running when it is going to Start_onboard_demo();
-----------------------------------------------------------------------------------------------
I posted the main entry function point of this application.
{
print_banner();
qurt_thread_attr_t Thread_Attribte;
qurt_thread_t Thread_Handle;
int Result;
{
/* Start the main demo thread. */
qurt_thread_attr_init(&Thread_Attribte);
qurt_thread_attr_set_name(&Thread_Attribte, "QCLI Thread");
qurt_thread_attr_set_priority(&Thread_Attribte, PAL_THREAD_PRIORITY);
qurt_thread_attr_set_stack_size(&Thread_Attribte, PAL_THREAD_STACK_SIZE);
Result = qurt_thread_create(&Thread_Handle, &Thread_Attribte, QCLI_Thread, NULL);
if(Result != QURT_EOK)
{
PAL_CONSOLE_WRITE_STRING_LITERAL("Failed to start QCLI thread.");
PAL_CONSOLE_WRITE_STRING_LITERAL(PAL_OUTPUT_END_OF_LINE_STRING);
PAL_CONSOLE_WRITE_STRING_LITERAL(PAL_OUTPUT_END_OF_LINE_STRING);
}
Start_onboard_demo();
}
}
-----------------------------------------------------------------------------------------------
I set ecosystem to AWS IOT and run the following commad to build this application
> build.bat f 4020 2 1 1 cdb
I guessed it may be stack issues, so I try to remove either QCLI thread or Start_onboard_demo()
After that, it can run.
We would like to know if anything should be set or adjusted?? and How do we know the stack size of QCLI thread is used??
Many Thx!!
Hi ,
So you are using FreeRTOS and trying to run onboard via BLE. Right?
Thanks
Hi
We are using FreeRTOS and trying to run onboard via WIFI.
------------------------------------------------------
*The value of Onboarding Mode parameter for build command which is listed in Development Kit User Guide is different from build.bat.
In Development Kit User Guide:
Onboarding Mode : 1 WIFI , 2 BLE
In build.bat:
1 (BLE), 2 (WIFI)
------------------------------------------------------
Thx~
Hi
have you followed 3.8 FreeRTOS and QuRT of UG to generate FreeRTOs and Qurt lib?
Also I see you are using below command to build .
build.bat f 4020 2 1 1 cdb .
2 means BLE. Please use 1 for WIFI .
Thanks
Jyotiranjan
Hi
Yes, I have followed.
And, you can see the parameter is opposite in build.bat
----------------
Thanks
Btw, If it use threadx, it is ok.
Besides, I used freertos and threax respectively in Helloworld_demo.
In function App_Start, I try to created other 4 threads after creating HelloWorld_Thread.
all of stack size are 3072, and priorities are 11, 12, 13 and 14 respectively .
If I use threax, they all can be created; however, if I use freertos, some of them will return -3 (QURT_EMEM)
Does there have any functino call that we can know how many stack size of each thread is used?
Thanks
You Mean all/On board demo work fine with threadx. Issue is with only FreeRTOS? How you check stack size for now?
Thanks
Yes, On board demo work fine with threadx. Issue is with only FreeRTOS.
So It seems to be something wrong with FreeRTOS
Can you please follow below instructions in section 4.3.4( Resize application memory) from 80-YA121-142 (QCA402x(CDB2x)Programmers Guide) document and add extra 6KB for freeRTOS heap for onboard demo to successfully work when using FreeRTOS.
"FreeRTOS requires a dedicated memory pool used for allocating RTOS specific elements such as task stack. OEMs might adjust this allocation based on their needs by following the steps.
cd to "./FreeRTOS/2.0/FreeRTOS/Demo/QUARTZ" directory. Edit FreeRTOSConfig.h, change configTOTAL_HEAP_SIZE to the appropriate value.
Rebuild FreeRTOS library. Refer to QCA402x Development Kit User Guide (80-YA121-140).
cd to target/bin/cortex-m4/freertos. Edit DefaultTemplateLinkerScript.ld, change RTOS_HEAP_SIZE to match configTOTAL_HEAP_SIZE from step 1.
Build the application. The new FreeRTOS heap value is applied."
OK, I see.
Many Thanks