- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I am considering using FreeRTOS for my project. I will need this program to be hard real time.
My problem is, I do not know where to start. How do I port the FreeRTOS API onto PSoC Creator?
Solved! Go to Solution.
- Labels:
-
PSoC 5 Device Programming
-
PSoC 5LP
- Tags:
- freertos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to download source code of freertos and add them into your project.
1.add freertos path into your project:
2.create freertos folders:
3.add existing freertos files into folders:
4.add these code in your project
extern void xPortPendSVHandler(void);
extern void xPortSysTickHandler(void);
extern void vPortSVCHandler(void);
#define CORTEX_INTERRUPT_BASE (16)
void FreeRTOS_Start(){
/* Handler for Cortex Supervisor Call (SVC, formerly SWI) - address 11 */
CyIntSetSysVector( CORTEX_INTERRUPT_BASE + SVCall_IRQn,
(cyisraddress)vPortSVCHandler );
/* Handler for Cortex PendSV Call - address 14 */
CyIntSetSysVector( CORTEX_INTERRUPT_BASE + PendSV_IRQn,
(cyisraddress)xPortPendSVHandler );
/* Handler for Cortex SYSTICK - address 15 */
CyIntSetSysVector( CORTEX_INTERRUPT_BASE + SysTick_IRQn,
(cyisraddress)xPortSysTickHandler );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to download source code of freertos and add them into your project.
1.add freertos path into your project:
2.create freertos folders:
3.add existing freertos files into folders:
4.add these code in your project
extern void xPortPendSVHandler(void);
extern void xPortSysTickHandler(void);
extern void vPortSVCHandler(void);
#define CORTEX_INTERRUPT_BASE (16)
void FreeRTOS_Start(){
/* Handler for Cortex Supervisor Call (SVC, formerly SWI) - address 11 */
CyIntSetSysVector( CORTEX_INTERRUPT_BASE + SVCall_IRQn,
(cyisraddress)vPortSVCHandler );
/* Handler for Cortex PendSV Call - address 14 */
CyIntSetSysVector( CORTEX_INTERRUPT_BASE + PendSV_IRQn,
(cyisraddress)xPortPendSVHandler );
/* Handler for Cortex SYSTICK - address 15 */
CyIntSetSysVector( CORTEX_INTERRUPT_BASE + SysTick_IRQn,
(cyisraddress)xPortSysTickHandler );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Last time, when I ported an older version of FreeRTOS to PSoC4, it was not very easy.
So Today, I googled "FreeRTOS PSoC 5LP" and found the following nice site.
(It is in Japanese, though)
https://tshell.hatenablog.com/entry/2019/05/23/212250
So I followed the instruction in that site.
(1) Download FreeRTOS from
FreeRTOS - Free RTOS Source Code Downloads, the official FreeRTOS zip file release download
I clicked the Green Button in the FreeRTOS box.
(2) Expanded the downloaded "FreeRTOSv10.4.1.zip"
Folder "FreeRTOSv10.4.1" was created.
(3) In the Folder I digged int "FreeRTOS"
(4) I found "CORTEX_CY8C5888_PSoC_Creator_GCC" in FreeRTOSv10.4.1\FreeRTOS\Demo
(5) I double clicked the workspace
(6) Warning about the device used was obsoleted, proceeded by selecting "OK"
(7) In the PSoC Creator, I selected "Device Selector..."
(8) I selected CY8C5888LTI-LP097 for my CY8CKIT-059
(9) In the schematic, I see a lots of outdated components
(10) I selected "Update Components..."
(11) Components were updated, and the schematic seems to be sane.
(12) Pins
I only specifed
Rx_1: P12[6]
Tx_1: P12[7]
Pin_LED_0: P2[1]
Startup_Release_Switch: P2[2]
And left the rest as not "unlocked"
(13) Tera Term Log
After compiled and started the debugger, Serial port (57600) showed the following.
And according the the site referenced, this is the expected output.
So the good news is porting or getting a version of FreeRTOS to 5LP was not as difficult as I was afraid of.
And the bad (or reasonable) news is that you need to learn the manner of using this RTOS to command it for your purpose.
moto