mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-22 04:37:49 -04:00
* Added explicit cast to allow roll over and avoid integer promotion during cycles counters comparison in recmutex.c. * Fixed type mismatch between declaration and definition of function xAreSemaphoreTasksStillRunning( void ). * Added Atmel Studio demo projects for ATMega4809 and AVR128DA48. * Per https://www.freertos.org/upgrading-to-FreeRTOS-V8.html, I'm updating portBASE_TYPE to BaseType_t. Signed-off-by: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com> * Update register test for ATmega4809 - to cover r28, r29, r31. - call public API taskYIELD() instead of portYIELD(). * Update ATmega4809 readme.md to include info for serial port setup, and minor wording fix. Co-authored-by: Alexandru Niculae - M17336 <alexandru.niculae@microchip.com>
58 lines
4 KiB
Markdown
58 lines
4 KiB
Markdown
|
|
# Overview
|
|
|
|
This directory contains a Atmel Studio demo project for AVR128DA48 Curiosity Nano board (GCC compiler) equipped with AVR128DA48 microcontroller (128 KB Flash, 16 KB SRAM, 512 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
|
|
|
|
### Blinky Demo
|
|
|
|
**#define mainSELECTED_APPLICATION 0**
|
|
|
|
Blinky demos are intended for beginners. They normally create just two [tasks](https://www.freertos.org/a00015.html) that communicates with each other through a [queue](https://www.freertos.org/Embedded-RTOS-Queues.html). 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 hat 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 every 3 seconds, then the check task has not discovered any problems. If the LED is stop toggling, then the check task has discovered a problem in one or more tasks.
|
|
|
|
### 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 hat 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 every 3 seconds, then the check task has not discovered any problems. If the LED is stop 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 **Atmel Studio IDE**
|
|
- open **RTOSDemo.atsln** project file from current folder
|
|
- select desired demo using **#define mainSELECTED_APPLICATION** as explained in the previous section
|
|
- build and debug the project
|
|
|
|
|
|
# References
|
|
- [AVR128DA48 Curiosity Nano platform](https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/DM164151)
|
|
- [Atmel Studio IDE](http://studio.download.atmel.com/7.0.2389/as-installer-7.0.2389-web.exe)
|
|
- [AVR128DA28](https://www.microchip.com/wwwproducts/en/AVR128DA28), [AVR128DA32](https://www.microchip.com/wwwproducts/en/AVR128DA32), [AVR128DA48](https://www.microchip.com/wwwproducts/en/AVR128DA48), [AVR128DA64](https://www.microchip.com/wwwproducts/en/AVR128DA64) devices page
|
|
- [AVR128DB28](https://www.microchip.com/wwwproducts/en/AVR128DB28), [AVR128DB32](https://www.microchip.com/wwwproducts/en/AVR128DB32), [AVR128DB48](https://www.microchip.com/wwwproducts/en/AVR128DB48), [AVR128DB64](https://www.microchip.com/wwwproducts/en/AVR128DB64) devices page
|