In the UART thread I declared 0x400 (1024) so it appears I have used most of the RAM. The highwater mark of the stack usage of that thread.The priority (0-configMAX_PRIORITIES from FreeRTOSConfig.h).The state of the task (R-Running, B-Blocked, S-Suspended).Then I press ‘t’ which dumps out a table of the processes running. When I program the development kit, the LED starts blinking. * Create UART Task which will control the serial port */Ġx400, /* Task stack, allocated from heap */ UART_UartPutString("Task State Prio Stack Num\n\r") If it is a ‘t’ it calls the function vTaskList which makes a dump of the process currently running (more on this later) (lines 54-60).If it is an ‘a’ it prints out “Working” (line 51).Now you can add the UART Thread to your project. Then add a debugging UART to the schematic: I then copy the BlinkingLED project and give it the name “UART-Thread”. Once you have the blinking LED working, that means you have all of the environment setup etc… for some reason this always feels like a big step. You can see the blinking LED in the video from above. While(1) // get rid of the stupid warning * Create LED task, which will blink the LED */Ģ00, /* Task stack, allocated from heap */Ġ, /* No param passed to task function */ * Handler for Cortex SYSTICK - address 15 */ĬyIntSetSysVector( CORTEX_INTERRUPT_BASE + SysTick_IRQn,ĬyGlobalIntEnable /* Enable global interrupts. * Handler for Cortex PendSV Call - address 14 */ĬyIntSetSysVector( CORTEX_INTERRUPT_BASE + PendSV_IRQn, * Handler for Cortex Supervisor Call (SVC, formerly SWI) - address 11 */ĬyIntSetSysVector( CORTEX_INTERRUPT_BASE + SVCall_IRQn, Runs the LED_Task until the end of time, blinking the LED (lines 25-33).Installs the FreeRTOS vectors (lines 9-22).The project is straight forward, it does: I start this process by following the instruction in my previous post to create a FreeRTOS example. Issue commands via a queue between the two threads.In the upcoming articles I will add more FreeRTOS PSoC Examples: Add 2nd UART based command processor thread.In this article I will show FreeRTOS PSoC Examples: The moral of the story is never underestimate the power of the blinking LED (to figure out what is going on). (yes my office looks like a tornado hit it). Here is a video I took on Saturday in my office with three different PSoCs (PSoC 4 BLE, PSoC 4M, and PSoC 6) running FreeRTOS. But given that I don’t really know PSoC 6 yet … and I don’t really know FreeRTOS … I decided to experiment first on PSoC 4 examples first then once I understood what to with FreeRTOS, try the same things on PSoC 6. So, I decided to use FreeRTOS to try out the different features of PSoC 6. But, given the expansive capabilities of the chip, the reality is that PSoC 6 will almost certainly be programmed using an RTOS. I found myself here because I was working on BLE centrals on PSoC4, and I thought that I should try it on PSoC 6 to see how well it worked. This week I will publish several FreeRTOS PSoC examples using PSoC 4 and PSoC 6. Although in my last Article I said that I would get back to BLE Centrals this week, that turns out to not be the case because I have found myself down the FreeRTOS rabbit hole.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |