FreeRTOS Porting Guide to W7500

details

This posting will talk about RTOS & FreeRTOS and guide how to port it to W7500.

RTOS

A real-time operating system or RTOS, abbreviation of Read Time Operating System, is literally an operating system for a real time application programming. It especially designed to focus on managing CPU time which is one of operating systems. RTOS make programmers possible to control higher number of priority processes. Priority of operation program might be higher than priority of system program. By minimizing critical region of system code, it can mange handling an application program request on time.

Main point of RTOS is how well you can maintain the duration time of handling application program task. The range of process time fluctuation is called Jitter. It is separated as hard and soft RTOS and former one has narrow Jitter than the latter one.

Link : https://ko.wikipedia.org/wiki/%EC%8B%A4%EC%8B%9C%EA%B0%84%EC%9A%B4%EC%98%81%EC%B2%B4%EC%A0%9C

FreeRTOS

free_rtos

FreeRTOS is one of open source RTOS that is designed to have all-in-one, simplicity, portability, conciseness. Price of core source code of operating system is under 4,000 and most of codes are built with C language which makes it very portable. It is now ported to 8 bit, 16 bit, 32 bit process such as 8051, AVR, PIC18, H8, MSP430, HCS12, PIC24, ARM Cortex-M3, ARM7, ARM9, AVR32, ColdFire, x86.

FreeRTOS core provides following functions.

  • Mutlitasking
    • Select between Preemptive & Non-preemptive
    • No limit on Task #
    • Possible to create task in a dynamical way
    • No limit on Priority #
    • Possible to assign same priority with more than 2 task (Round Robin Scheduling (RR) in this situation)
  • Co-routine
  • Message queue
  • Semaphore
  • Memory Management

FreeRTOS uses modified GPL license policy. A difference compare to the former GPL license is that the work operating by linking with FreeRTOS has no obligation to open in public. The advantage of it is that it is possible when exclusive rights of the work is need for the industrial purposes.

Link : http://www.ubinos.org/mediawiki/index.php/FreeRTOS_%EC%86%8C%EA%B0%9C


Download Free RTOS

Go to the FreeRTOS to download info, document, and source code related to FreeRTO

Folder Structure

Download FreeRTOS to check Free-RTOS-Plus folder and FreeRTOS folder. Visit http://www.freertos.org/a00017.html for the further information.

free_rtos-1

FreeRTOS folder consists of Demo and Source folders and Demo folder has example demo project exists on the basis of FreeRTOS kernel.

free_rtos-2

Source folder has FreeRTOS Kenel implemented files and Portable folder has process and IDE FreeRTOS Port files.

free_rtos-3

This posting will use port.c and portmacro.h in the portable/RVDS/ARM_CM0 folder to operate FreeRTOS using one of CortexM0 series called W7500. Additionally, Add files in the portable/MemMang folder to the poject for Memoney Management of FreeRTOS. Visit http://www.freertos.org/a00111.html for the further information about Memory Management.

Porting a Free RTOS on WIZwiki-W7500ECO

I will explain how to port Free RTOS using WIZwiki-W7500ECO board which is one of W7500 platforms. Examples are about Blinking LED1 of WIZwiki-W7500ECO board every 20ms.

Step 1 : Download W7500 Library

Go to the https://github.com/Wiznet/W7500, then download W7500 Library Code.

mbed_w7500

Step 2 : Create Keil Project for W7500

Create a folder in the directory of W7500-master\W7500x_Library_Examples\Projects\Peripheral_Examples for the project, then copy a proper file. In this posting, files in the GPIO\Blink_LED were copied into OS\FreeRTOS after making an OS\FreeRTOS folder. Originally it is general way to make a new project, but this method was used in order to use set values of the project made by WIZnet to create the project.

Open _GPIO_Blink_LED.uvproj of OS\FreeRTOS\MDK folder to check an example of turing On/Off the GPIO of W7500 seen as the following picture.

[How to set Include Path]

Since this example’s GPIO/Blink_LED and folder Depth is same, set value do not need to be changed. However, if folder Depth is different from original projects, compile doe not work. In this case, you are able to fix the probrem by setting Include Path using following method.

Select [Project]-[Options for Target], then set directory of following folder in [C/C++] tab’s Include Paths

  • \Libraries\CMSIS\Device\WIZnet\W7500\Include
  • \Libraries\W7500x_stdPeriph_Driver\inc
  • \Libraries\CMSIS\Include
  • ..\

free_rtos-4

free_rtos-5

Step 3 : Porting FreeRTOS

Copy downloaded FreeRTOS file from the Step 1 in the OS\FreeRTOS\ folder from Step 2 seen as following picture, then delete files other than files seen in the following picture.

free_rtos-6

After completing the above processes, make a FreeRTOS group on Keil project and add following files.

  • OS\FreeRTOS\FreeRTOS\croutine.c
  • OS\FreeRTOS\FreeRTOS\list.c
  • OS\FreeRTOS\FreeRTOS\queue.c
  • OS\FreeRTOS\FreeRTOS\tasks.c
  • OS\FreeRTOS\FreeRTOS\timers.c
  • OS\FreeRTOS\FreeRTOS\portable\MemMang\heap_2.c
  • OS\FreeRTOS\FreeRTOS\portable\RVDS\ARM_CM0\port.c

free_rtos-7

Create FreeRTOSConfig.h

Create blink_led_task.c

Modified main.c

Fixed Error

Above Error occured due to the duplication of PendSV_Handler and SysTick_Handler formula. To solve the problem, W7500x_it.c is changed to following one.

Step 4 : Running an example

After RTOS porting, check if example code is working fine.

출처 : Life4IoT

This posting will talk about RTOS & FreeRTOS and guide how to port it to W7500.

RTOS

A real-time operating system or RTOS, abbreviation of Read Time Operating System, is literally an operating system for a real time application programming. It especially designed to focus on managing CPU time which is one of operating systems. RTOS make programmers possible to control higher number of priority processes. Priority of operation program might be higher than priority of system program. By minimizing critical region of system code, it can mange handling an application program request on time.

Main point of RTOS is how well you can maintain the duration time of handling application program task. The range of process time fluctuation is called Jitter. It is separated as hard and soft RTOS and former one has narrow Jitter than the latter one.

Link : https://ko.wikipedia.org/wiki/%EC%8B%A4%EC%8B%9C%EA%B0%84%EC%9A%B4%EC%98%81%EC%B2%B4%EC%A0%9C

FreeRTOS

free_rtos

FreeRTOS is one of open source RTOS that is designed to have all-in-one, simplicity, portability, conciseness. Price of core source code of operating system is under 4,000 and most of codes are built with C language which makes it very portable. It is now ported to 8 bit, 16 bit, 32 bit process such as 8051, AVR, PIC18, H8, MSP430, HCS12, PIC24, ARM Cortex-M3, ARM7, ARM9, AVR32, ColdFire, x86.

FreeRTOS core provides following functions.

  • Mutlitasking
    • Select between Preemptive & Non-preemptive
    • No limit on Task #
    • Possible to create task in a dynamical way
    • No limit on Priority #
    • Possible to assign same priority with more than 2 task (Round Robin Scheduling (RR) in this situation)
  • Co-routine
  • Message queue
  • Semaphore
  • Memory Management

FreeRTOS uses modified GPL license policy. A difference compare to the former GPL license is that the work operating by linking with FreeRTOS has no obligation to open in public. The advantage of it is that it is possible when exclusive rights of the work is need for the industrial purposes.

Link : http://www.ubinos.org/mediawiki/index.php/FreeRTOS_%EC%86%8C%EA%B0%9C


Download Free RTOS

Go to the FreeRTOS to download info, document, and source code related to FreeRTO

Folder Structure

Download FreeRTOS to check Free-RTOS-Plus folder and FreeRTOS folder. Visit http://www.freertos.org/a00017.html for the further information.

free_rtos-1

FreeRTOS folder consists of Demo and Source folders and Demo folder has example demo project exists on the basis of FreeRTOS kernel.

free_rtos-2

Source folder has FreeRTOS Kenel implemented files and Portable folder has process and IDE FreeRTOS Port files.

free_rtos-3

This posting will use port.c and portmacro.h in the portable/RVDS/ARM_CM0 folder to operate FreeRTOS using one of CortexM0 series called W7500. Additionally, Add files in the portable/MemMang folder to the poject for Memoney Management of FreeRTOS. Visit http://www.freertos.org/a00111.html for the further information about Memory Management.

Porting a Free RTOS on WIZwiki-W7500ECO

I will explain how to port Free RTOS using WIZwiki-W7500ECO board which is one of W7500 platforms. Examples are about Blinking LED1 of WIZwiki-W7500ECO board every 20ms.

Step 1 : Download W7500 Library

Go to the https://github.com/Wiznet/W7500, then download W7500 Library Code.

mbed_w7500

Step 2 : Create Keil Project for W7500

Create a folder in the directory of W7500-master\W7500x_Library_Examples\Projects\Peripheral_Examples for the project, then copy a proper file. In this posting, files in the GPIO\Blink_LED were copied into OS\FreeRTOS after making an OS\FreeRTOS folder. Originally it is general way to make a new project, but this method was used in order to use set values of the project made by WIZnet to create the project.

Open _GPIO_Blink_LED.uvproj of OS\FreeRTOS\MDK folder to check an example of turing On/Off the GPIO of W7500 seen as the following picture.

[How to set Include Path]

Since this example’s GPIO/Blink_LED and folder Depth is same, set value do not need to be changed. However, if folder Depth is different from original projects, compile doe not work. In this case, you are able to fix the probrem by setting Include Path using following method.

Select [Project]-[Options for Target], then set directory of following folder in [C/C++] tab’s Include Paths

  • \Libraries\CMSIS\Device\WIZnet\W7500\Include
  • \Libraries\W7500x_stdPeriph_Driver\inc
  • \Libraries\CMSIS\Include
  • ..\

free_rtos-4

free_rtos-5

Step 3 : Porting FreeRTOS

Copy downloaded FreeRTOS file from the Step 1 in the OS\FreeRTOS\ folder from Step 2 seen as following picture, then delete files other than files seen in the following picture.

free_rtos-6

After completing the above processes, make a FreeRTOS group on Keil project and add following files.

  • OS\FreeRTOS\FreeRTOS\croutine.c
  • OS\FreeRTOS\FreeRTOS\list.c
  • OS\FreeRTOS\FreeRTOS\queue.c
  • OS\FreeRTOS\FreeRTOS\tasks.c
  • OS\FreeRTOS\FreeRTOS\timers.c
  • OS\FreeRTOS\FreeRTOS\portable\MemMang\heap_2.c
  • OS\FreeRTOS\FreeRTOS\portable\RVDS\ARM_CM0\port.c

free_rtos-7

Create FreeRTOSConfig.h

Create blink_led_task.c

Modified main.c

Fixed Error

Above Error occured due to the duplication of PendSV_Handler and SysTick_Handler formula. To solve the problem, W7500x_it.c is changed to following one.

Step 4 : Running an example

After RTOS porting, check if example code is working fine.

출처 : Life4IoT

COMMENTS

Please Login to comment
  Subscribe  
Notify of
POSTED BY