Application UnisonKernel_Semaphore
----------------------------------

This application shows how to use a semaphore using POSIX API.
The application contains two threads and one interrupt handler from a timer.
One of the thread waits a semaphore in a loop. The semaphore is sent by the second
thread and the interrupt handler.


Target board: STM32F746G-DISCO
------------------------------


IDEs:
  - IAR
  - Keil
  - System Workbench (GCC)


Files description
-----------------

  ### stm32f7xx_hal_msp.c ###

    - HAL files with MSP Initialization and de-Initialization functions.
    - STM32CubeMX generated file.


  ### stm32f7xx_it.c ###

    - file with interrupts handlers for SysTick() and TIM6.
    - STM32CubeMX generated file.


  ### system_stm32f7xx.c ###

    - contains system functions for STM32F7 chip.
    - STM32CubeMX generated file.


  ### main.c ###

    - includes Unison header:
    /* USER CODE BEGIN Includes */
    #include "unison_kernel_start.h"
    /* USER CODE END Includes */

    - runs USART1 and TIM6

    - runs Unison kernel:
    /* USER CODE BEGIN 2 */
    UnisonKernel_Start();
    /* USER CODE END 2 */

    - STM32CubeMX generated file.


  ### unison_heap.c ###

    - sets heap for Unison dynamic memory functions malloc()/free(). The heap size
    depended on define "MEMSIZE_HEAP".


  ### unison_kernel_start.c ###

    - provides the function UnisonKernel_Start() which setups kernel and runs it.


  ### unison_main.c ###

    - contains two threads and a handler for TIM6 interrupt

    - the main thread Main():
      * initializes a semaphore
      * sets system time to zero
      * runs second thread Task()
      * runs interrupt for TIM6
      * shows current thread and interrupt stacks information
      * sends the semaphore each 5 second in a loop

    - the second thread Task():
      * shows current thread stack information
      * wait the semaphore in a loop and shows current time

    - the TIM6 handler HAL_TIM_PeriodElapsedCallback():
      * runs every 2 seconds
      * sends the semaphore


How to use it
-------------
  - Open your preferred toolchain 
  - Rebuild all files and load your image into target memory
  - Run the application


To modify or add/remove some hardware/software features to the application you could open
STM32CubeMX project "UnisonKernel_Semaphore.ioc" and make any changes using STM32CubeMX manual.

All non STM32CubeMX settings which was added to the application are descibed in the file
"STM32CubeExpansion_UnisonKernel_Vx.x.x\Documentation\Unison_application_making_guide.pdf"
in the chapter #2 "Tuning an application for IDE".
