﻿/*******************************************************************************
*
* E M B E D D E D   W I Z A R D   P R O J E C T
*
*                                                Copyright (c) TARA Systems GmbH
*                                    written by Paul Banach and Manfred Schweyer
*
********************************************************************************
*
* This software is delivered "as is" and shows the usage of other software
* components. It is provided as an example software which is intended to be
* modified and extended according to particular requirements.
*
* TARA Systems hereby disclaims all warranties and conditions with regard to the
* software, including all implied warranties and conditions of merchantability
* and non-infringement of any third party IPR or other rights which may result
* from the use or the inability to use the software.
*
********************************************************************************
*
* DESCRIPTION:
*   This package contains everything needed to build and run an Embedded Wizard
*   generated UI application on a NXP IMXRT1060-EVK target.
*   This Build Environment for Embedded Wizard generated UI applications was
*   tested by using the following components:
*   - Embedded Wizard Studio V11.00
*   - Embedded Wizard Platform Package for NXP iMX_RT V11.00
*   - IMXRT1060-EVK Build Environment V11.00
*   - IMXRT1060-EVK development board
*   - MCUXpresso SDK V2.9.3
*   - GCC ARM Embedded Toolchain 10-2020-q4-major
*   - IAR Embedded Workbench 9.10.1, IAR C/C++ Compiler V9.10.1.308/W64 for ARM
*   - Keil MDK-ARM Professional Version 5.33.0.0, ARM Compiler 6.15 (armclang)
*   - MCUXpresso IDE V11.3.1 Build 5262
*
*******************************************************************************/

Getting started with IMXRT1060-EVK development board:
-----------------------------------------------------
  In order to get your first Embedded Wizard generated UI application up and
  running on your IMXRT1060-EVK target, we have prepared a detailed article,
  which covers all necessary steps.
  We highly recommend to study the following document:

  https://doc.embedded-wizard.de/getting-started-mimxrt1060-evk


Getting started with Embedded Wizard Studio:
--------------------------------------------
  In order to get familiar with Embedded Wizard Studio and the UI development
  work-flow, we highly recommend to study our online documentation:

  https://doc.embedded-wizard.de

  Furthermore, we have collected many 'Questions and Answers' covering
  typical Embedded Wizard programming aspects. Please visit our community:

  https://ask.embedded-wizard.de

  Please use this platform to drop your questions, answers and ideas.


/*******************************************************************************
* Important note:
* This Build Environment is intended to be used as template for Embedded Wizard
* GUI applications on the development board or your customer specific hardware.
* Please take care to adjust all timings and hardware configurations (e.g. system
* clock configurations, memory timings, MPU and cache settings) according to your
* needs and hardware capabilities in order to ensure a stable system.
* Please also take the hardware manufacturer's corresponding specifications,
* application notes and erratas into account.
*******************************************************************************/


Build Environment specific changes:
-----------------------------------
* Version 11.00
  - Flash download: Flashing the binary to the target is now controlled by one
    dedicated script that is used from the makefile and the other toolchains.
    The script is located in the subdirectory \Application\FlashDownload. The
    settings can be changed within the file FlashDownload.cfg.
  - Linker section definitions: The flag EW_USE_EXTERNAL_FLASH (used to activate
    the usage of an external flash) and the macros EW_FONT_PIXEL_SECTION_NAME
    and EW_BITMAP_PIXEL_SECTION_NAME have been removed from the makefiles and
    project files. Now, the linker section definitions can be done within the file
    ewconfig.h. The set of defines have been enhanced to control the location of
    all types of constant data. The following defines are supported:
    EW_USE_EXTERNAL_FLASH, EW_BITMAP_PIXEL_SECTION_NAME, EW_FONT_PIXEL_SECTION_NAME,
    EW_FONT_DATA_SECTION_NAME, EW_CONST_STRING_SECTION_NAME
  - Touch configuration and calibration: The file ewconfig.h contains now a set
    of defines to print and calibrate the touch events from the touch device.
  - The functions EwBspInitDisplay() and EwBspInitTouch() have been enhanced
    to use the size of the GUI application and display parameters.
  - ewconfig.h: A set of new macros are introduced to reduce the code size of
    the binary application: EW_DONT_USE_GRADIENTS, EW_DONT_USE_COMRESSION,
    EW_DONT_USE_NATIVE_SURFACES, EW_DONT_USE_NATIVE_SURFACES_AS_DESTINATION.
  - ewconfig.h: All macros concerning framebuffer width/height/address/size,
    double-buffer width/height/addresss/size, color depths, etc. have been
    renamed with a leading EW_ to be in line with other macros.
  - Changed from MCUXpresso SDK V2.8.2 to MCUXpresso SDK V2.9.3
  - Changed from MCUXpresso IDE V11.2.1 to MCUXpresso IDE V11.3.1
  - Test with Embedded Wizard V11.00 and iMX_RT Platform Package V11.00

* Version 10.00
  - Splitting the FlexSPI AHB buffer into two parts to share between core and PXP
  - Test with Embedded Wizard V10.00 and iMX_RT Platform Package V10.00

* Version 9.30.02
  - Adding Dashboard example.
  - Workaround for targets with write-back data cache configuration added:
    The SEMC queue allows for reordering of SDRAM operations. In some conditions,
    the reodering can cause problems that appear as reading incorrect/stale data
    from the SDRAM. Changing the BMCRn values to increase the WAGE weighting
    prevents the reordering of operations and avoids the issue.
  - Precompiled libraries are now build with single-precision FPU settings.
  - Changed from MCUXpresso SDK V2.7.0 to MCUXpresso SDK V2.8.2
  - Changed from MCUXpresso IDE V11.1.0 to MCUXpresso IDE V11.2.1
  - Test with Embedded Wizard V9.30 and iMX_RT Platform Package V9.30

* Version 9.30.01
  - Adding PulseOximeter and SmartThermostat examples.
  - DeviceDriver.c template improved to handle display update request properly.
  - Memory pool defines renamed and typos in comments fixed.
  - Changed from MCUXpresso SDK V2.6.2 to MCUXpresso SDK V2.7.0
  - Changed from MCUXpresso IDE V11.0.1 to MCUXpresso IDE V11.1.0
  - Test with Embedded Wizard V9.30 and iMX_RT Platform Package V9.30

* Version 9.30
  - The TLSF memroy manager has been removed: The Runtime Environment
    contains now an own optimized memory manager that is tailored for GUI
    applications on resource constraint embedded systems.
    The Embedded Wizard Heap Manager is now used instead of TLSF.
  - The file ewmain.c is adapted to use the new memory manager.
    For debugging purposes the new function EwVerifyHeap() is called
    before the Garbage Collector is started, to check the memory integrity.
  - The project configuration is now done within the new file ewconfig.h.
    The file ewmain.c does no more contain configuration settings.
    The makefile/project files contain only those settings which have an
    impact to the project structure or the selection of files and libraries.
  - The interface between Embedded Wizard and the underlying hardware specific
    Board Support Package has been redesigned and aligned with all other
    platforms. Please have a look to the header files within the folder
    /TargetSpecific for more details.
  - Support of multi-touch: The touch driver ew_bsp_touch.c provides now
    multi-touch events. The main loop in ewmain.c has been adapted to
    process multi-touch events.
  - The files ew_bsp_serial.c/h are renamed to ew_bsp_console.c/h
  - Changed from MCUXpresso SDK V2.6.1 to MCUXpresso SDK V2.6.2
  - Changed from MCUXpresso IDE V11.0.0 to MCUXpresso IDE V11.0.1
  - Changed to GCC ARM Embedded Toolchain 9-2020-q2-update
  - Test with Embedded Wizard V9.30 and iMX_RT Platform Package V9.30

* Version 9.20.03
  - Bugfix in ewextgfx.c for changed surface handling of 9.20.02 - possible
    access to surface flags via null pointer.

* Version 9.20.02
  - Improved managment of drawing operations done by PXP and CPU: Superfluous
    invalidation of the CPU cache or superfluous write-back of CPU cache are
    now avoided.
  - Improved handling of double-buffering: The time span between a completed
    drawing of the back-buffer and the occurence of the next V-sync can now be
    used by CPU to prepare next frame.

* Version 9.20.01
  - Changed from MCUXpresso SDK V2.5.0 to MCUXpresso SDK V2.6.1
  - Changed from MCUXpresso IDE V10.3.1 to MCUXpresso IDE V11.0.0
  - Changed to GCC ARM Embedded Toolchain 8-2018-q4-major

* Version 9.20
  - Test with Embedded Wizard V9.20 and iMX_RT Platform Package V9.20
  - The Graphics Engines for color format RGBA8888, RGB888 and RGB565 have
    been enhanced to support the new bitmap resource formats RGB565 and Index8.
  - The target specific module ew_bsp_graphics.c has been enhanced to support
    hardware accelerated drawing operations for the new source format RGB565.
  - The third-party software Xprintf is no more used and has been removed.
  - The dependency to printf() function is removed: The function EwFormat()
    does not exist anymore and has been removed from ewextrte.c. The function
    EwPrint() is now part of the RTE itself and implements a subset of the
    printf() format escape sequences (%d, %u, %f, %s, %c, %x, %X).
  - The new function EwConsoleOutput() has been added to the extern RTE
    module ewextrte.c. The function is used to print the given message on
    the console. No additional formatting, etc. is needed.
  - In case you get LCD underflows (e.g. flickering of LCD while PXP is active),
    you can increase the read priority for the LCD by modifying the NIC read_qos
    value for it. It is at 0x41044100 (register that isn’t in the header file).
    For more details see ew_bsp_display.c.
  - Changed from MCUXpresso SDK V2.4.1 to MCUXpresso SDK V2.5.0.
  - The set of provided examples has been enhanced. Please have a look into
    the subdirectory /Examples.
  - Realtime clock can be set by using new EwBspSetTime() function. RTC is
    now set to a default value during start of application (see ewmain.c).

* Version 9.10
  - Test with Embedded Wizard V9.10 and iMX_RT Platform Package V9.10
  - main.c file is now split into main.c and ewmain.c
  - New function EwPrintSystemInfo() for printing system and configuration
    information - helpful in case of any support issues.
  - The flag EW_USE_QSPI_FLASH is now replaced by EW_USE_EXTERNAL_FLASH
  - The usage of FreeRTOS is now enabled by default within GCC makefile.
  - Support of NXP Pixel Pipeline - The PXP graphics accelerator hardware is
    now used for all hardware supported fill, copy and blend operations in case
    of color format RGB565, RGB888 and RGBA8888.

* Version 9.00.03
  - Bug fix: Display start postion for color format RGBA8888 does not vary
    any more after each reset.

* Version 9.00.02
  - Improved post process scripts for projects using MCUXpresso IDE.
  - Test with MCUXpresso SDK V2.4.0.
  - Known Issues: When using color format RGBA8888, the entire screen may
    appear shifted horizontally on the display. The start position seems
    to vary after each reset.

* Version 9.00.01
  - Support for MCUXpresso IDE added.

* Version 9.00
  - Test with Embedded Wizard V9.00 and iMX_RT Platform Package V9.00
  - The main application and the makefile / project files for the supported
    toolchains are now located within the subdirectory /Application.
  - All third party software components are now located within the subdirectory
    /ThirdParty


Known Issues:
-------------
- Sometimes the redlinkserver tool cannot establish a connection with the board.
  As a result, the console will not work and the flash process will not work or
  stop unexpectedly.
  In order to get the board working please start the MCUXpresso IDE project and
  simply start the GUI Flash Tool at the right end of the tool bar. Then the
  probe discovery will detect the board correctly. After completing this step,
  the console and flash process will work as usual.
  This seems to be an issue under Windows 10.


3rdParty-Components
-------------------
The following 3rdParty-Components are used:

1. NXP SDK: ./ThirdParty/MCUXpressoSDK/SW-Content-Register.txt

2. Gnu Make - GNU General Public License v2 or later

3. Gnu GCC - GNU General Public License v2 or later

4. NXP Redlink flash utility - ./ThirdParty/MCUXpressoIDE/SoftwareContentRegister.txt
