Description of the steps porting primer2 to freeRTOS
____________________________________________________

1. Hardware and installed software:
___________________________________

- Circle OS version 3.7
- FreeRTOS version 5.2.0
- Primer2 development kit ( optional professional debug )
- Target STM32F103VET6 (512K flash / 64K ram)
- Raisonance Ride IDE version 7.18.0903
- Arm Rkit version 7.18.0903

- Project location \FreeRTOSV5.2.0\Demo\CORTEX_STM32F103_Primer2_GCC\
- Project name RTOSDemo
- Application name RTOSDemo.elf   

2. Prelimenary steps:
_____________________

- Unzip the Circle OS package into the freeRTOS demo directory --> \Cirlcle
- Make a copy of the "Primer2_Circle.ld" linker script and change the name to "Primer2_freeRTOS.ld"
- Change the Script file in the project script section to the new ld file
- Increase the ram size to full 64K in memory section
- Increase the flash size to full 512K in memory section
- Add a new folder "freeRTOS Core" in the project tree
- Add freeRTOS source files from the \source directory to the new folder
- Add to project include section "\FreeRTOSV5.2.0\Source\include"
- Make a new folder "freeRTOS" in the root project directory
- Copy "freeRTOSConfig.h" from the primer1 project to this new folder
- Add this new directory to the include section of the project
- Add "GCC_ARMCM3" to the project define section
- Resolve name clash in list.o module in changing the output file name for the circle list.c into
  $(OutDir)\$(NodeName)_st.o
  $(ListDir)\$(NodeName)_st.lst
- Add a new folder "freeRTOS Port" in the project tree
- Add the port.c to this new folder from the portable GCC\ARM_CM3 directory
- Add the heap_2.c file to have freeRTOS memory management
 
 This results in making the project without errors and without called freeRTOS functionality.
 
3. FreeRTOS:
____________

- This port is based upon the freeRTOS code as released in the version 5.2.0. without any modifications.
  A #define is introduced and placed in circle.h which is included in all files. Putting this define in
  comment will compile the project for the circle OS distributed by ST. Beware to take the original
  linker script "Primer2_Circle.ld" if build against the circle OS to have correct section placement.

    - freeRTOS switch define : PRIMER2_WITH_FREERTOS (added in circle.h)

- Added FreeRTOS app project folder (see comments in files):

    - timertest.c
    - ParTest.c

- Added freeRTOS Util project folder with all the strict minimum files in.

- Files from ST altered:

    - draw.c to exclude the bmp and bat symbol from ST
    - circle.h with above define symbol
    - circlestartup.c to include/exclude the interrupt handlers
    - scheduler.c to adapt the systick handlers

- Test tasks:

    - cricle handlers now in applications tick hook
    - primer2 leds blinking with different frequency
    - time, temperature and battery value printed on lcd
    - freeRTOS bmp on lcd
    - limited circle menu functionality

Limitations & known issues
__________________________

- circle OS app management is not possible
- upper left corner config icon makes primer hang
- removed timertest from primer1
- original freeRTOS directory structure is referenced without a copy of the source files
  so it could be necessary to change the path to your own freeRTOS installation path in the
  include directory section op the project (default is D:\FreeRTOSV5.2.0)

Enjoy !

Any remarks an improvements are welcome on;
guyvo67@gmail.com