- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FreeRTOS and TCPWM blocks are not working together.
Steps to reproduce:
- Create the AnyCloud_TCP_Client example using the Modus Application creator dialog.
- Create a PWM block using the Device Configurator and call it PWM1 (I used Block 23, Pin10[2] but have tried others too).
- Before the xTaskCreate and vTaskStartScheduler in main(), start the PWM1 block with
printf("============================================================\n");
printf("CE229112 - AnyCloud Example: TCP Client\n");
printf("============================================================\n\n")
//////////////////////////////////////
Cy_TCPWM_PWM_Init(PWM1_HW, PWM1_NUM, &PWM1_config);
Cy_TCPWM_PWM_Enable(PWM1_HW, PWM1_NUM);
Cy_TCPWM_TriggerReloadOrIndex(PWM1_HW, PWM1_MASK);
Cy_TCPWM_TriggerStart(PWM1_HW, PWM1_MASK);
CyDelay(1000);
///////////////////////////////////
/* Create the tasks. */
xTaskCreate(tcp_client_task, "Network task", TCP_CLIENT_TASK_STACK_SIZE, NULL,
TCP_CLIENT_TASK_PRIORITY, NULL);
/* Start the FreeRTOS scheduler. */
vTaskStartScheduler();
- Upload Code to PSoC6 PROTO 2MB
Result: Square wave appears for 1 second, then disappears.
Expected behavior: Square wave appears and stays forever.
I've also tried moving the PWM Init/Enable/Start code into the RTOS task (tcp_client_task) but doing that results in no square wave at all.
Why is FreeRTOS preventing TCPWM from working properly and how can I fix it? Thank you for you help.
Solved! Go to Solution.
- Labels:
-
PSoC 6 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @travisjayday,
I followed the steps that you have provided and I was not able to observe the fault. Can you please share the call stack when your application hits a fault?
Also, please share the main.c and design.modus file of your application.
You can also use this code example as a reference - PSoC 6 MCU: PWM Square Wave. The code example uses HAL APIs which removes the dependency on Device Configurator for PWM.
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay, when debugging, I see that it hits __WEAK void Cy_SysLib_ProcessingFault(void) at some point
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @travisjayday,
I followed the steps that you have provided and I was not able to observe the fault. Can you please share the call stack when your application hits a fault?
Also, please share the main.c and design.modus file of your application.
You can also use this code example as a reference - PSoC 6 MCU: PWM Square Wave. The code example uses HAL APIs which removes the dependency on Device Configurator for PWM.
Rakshith M B