FreeRTOS-Kernel/FreeRTOS/Demo/AVR_ATMega4809_IAR
Kody Stribrny 7d09b88e5a
Fix C source and header file license spacing (#1155)
The line 'Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.'
used to have two spaces between the first and second sentences.
This would cause the header check to fail due to the copyright regex located
ab999f9624/.github/scripts/core_checker.py (L396)
2024-01-12 16:43:31 -08:00
..
ParTest Fix C source and header file license spacing (#1155) 2024-01-12 16:43:31 -08:00
protected_io Update previous AVR ATmega0 and AVR Dx projecs + addition of equivalent projects in MPLAB.X and IAR (#180) 2020-08-06 12:37:08 -07:00
serial Fix C source and header file license spacing (#1155) 2024-01-12 16:43:31 -08:00
.gitignore Changed project AVR_Dx_IAR to use 'heap_1.c'. (#365) 2020-10-28 09:28:47 -07:00
clk_config.h Add 20Mhz support by overwriting MCLKCTRLB default register value 0x11 by 0 (#295) 2020-09-27 23:41:32 -07:00
FreeRTOSConfig.h Fix C source and header file license spacing (#1155) 2024-01-12 16:43:31 -08:00
main.c Fix formatting in kernel demo application files (#1148) 2024-01-02 11:05:59 +05:30
main_blinky.c Fix formatting in kernel demo application files (#1148) 2024-01-02 11:05:59 +05:30
main_full.c Fix formatting in kernel demo application files (#1148) 2024-01-02 11:05:59 +05:30
main_minimal.c Fix formatting in kernel demo application files (#1148) 2024-01-02 11:05:59 +05:30
readme.md Update previous AVR ATmega0 and AVR Dx projecs + addition of equivalent projects in MPLAB.X and IAR (#180) 2020-08-06 12:37:08 -07:00
regtest.c Fix C source and header file license spacing (#1155) 2024-01-12 16:43:31 -08:00
regtest.h Fix C source and header file license spacing (#1155) 2024-01-12 16:43:31 -08:00
RTOSDemo.ewd Update previous AVR ATmega0 and AVR Dx projecs + addition of equivalent projects in MPLAB.X and IAR (#180) 2020-08-06 12:37:08 -07:00
RTOSDemo.ewp Revert "Remove coroutines (#874)" (#1019) 2023-06-09 15:25:48 -07:00
RTOSDemo.ewt Revert "Remove coroutines (#874)" (#1019) 2023-06-09 15:25:48 -07:00
RTOSDemo.eww Update previous AVR ATmega0 and AVR Dx projecs + addition of equivalent projects in MPLAB.X and IAR (#180) 2020-08-06 12:37:08 -07:00

Overview

This directory contains a IAR EWAVR demo project (IAR compiler) for Atmega4809 Curiosity Nano board equipped with Atmega4809 microcontroller (48 KB Flash, 6 KB SRAM, 256 bytes EEPROM).

The project comes as three different demos, selectable by a define in the main.c file. Each demo has its own main-demo_name.c file. Follow the instructions on the RTOS port documentation page for details about how to setup the target hardware, download and execute the demo application.

Blinky Demo

#define mainSELECTED_APPLICATION 0

Blinky demos are intended for beginners. They normally create just two tasks that communicates with each other through a queue. Their functionality is contained in a single C source file called main_blinky.c.

One of the tasks repeatedly sends a predefined value to the queue with 200 ms intervals, while the other task waits for messages to be available in the queue. Once a new message is available, it toggles on board LED if the value matches the expected value.

Minimal Demo

#define mainSELECTED_APPLICATION 1

This demo includes a higher number of tasks than the Blinky demo, but the complexity is still fairly low. Whole functionality is included in the main_minimal.c file by using the following tasks:

  • integer math task (Integer.c)
  • register tasks to verify the context switch (Regtest.c)
  • polled queue tasks (PollQ.c)
  • serial communiation tasks (Serial.c)
  • check task that periodically checks the other tasks are operating without error.

This demo uses the check task to periodically inspect the standard demo tasks in order to ensure all the tasks are functioning as expected. The check task also toggles an LED to give a visual feedback of the system status. If the LED is toggling roughly every second, then the check task has not discovered any problems. If the LED stops toggling, then the check task has discovered a problem in one or more tasks.

To see the console output from serial communication tasks, serial port could be configured as:

  • baud rate 9600
  • data 8-bit
  • parity none
  • stop bits 1-bit
  • flow control none

Full Demo

#define mainSELECTED_APPLICATION 2

This demo is a comprehensive demonstration and test of a lot of FreeRTOS features, including direct task to task notifications, queues, semaphores, recursive semaphores, software timers, and more. The following tasks are created in main_full.c file:

  • register tasks to verify the context switch (Regtest.c)
  • semaphores task (Semtest.c)
  • direct task to task notification task (TaskNotify.c)
  • recursive semaphores task (Regmutex.c)
  • check task that periodically checks the other tasks are operating without error

The demo uses the check task to periodically inspect the standard demo tasks in order to ensure all the tasks are functioning as expected. The check task also toggles an LED to give a visual feedback of the system status. If the LED is toggling roughly every 3 seconds, then the check task has not discovered any problems. If the LED stops toggling, then the check task has discovered a problem in one or more tasks.

Quick start

To run this demo on AVR128DA48 Curiosity Nano platform, the following steps are required:

  • install IAR Embedded Workbench for AVR
  • open RTOSDemo.eww project file from current folder
  • select desired demo using #define mainSELECTED_APPLICATION as explained in the previous section
  • build and debug the project

References