This is my sandbox for experimenting with the features offered by the AMD (Xilinx) FreeRTOS port. The main platform used is the Digilent Zybo-z7-20. The implemented system is quite simple, comprising a range of GPIO features (LEDs, buttons, switches, and test outputs for monitoring) and two UART communication channels. The IDE is Vivado/Vitis 2023.2 (Classic version). More details on the system can be found below. A list of projects is as follows (more to be added):
- Semaphore Project 1: UART command Handler
- Queue Project 1: UART Command Handler
- Semaphore/Queue Project 2: HW Tick Timers and UART Command Handler
- Notifier Project 1: UART Comms Done Notifier System
- Simple Project 1: 10ms task, 20ms task
Brief Description: Three tasks are running on the system:
- Idle
- 10ms background task
- A Command Handler task
The command handler task blocks waiting for a semaphore sent by the UART ISR. When the UART receives 64 bytes from the host software, the interrupt fires and the semaphore is sent. The command handler task is unblocked and it executes the requested command. The task then sends the command response back to the host software and returns to the blocked state. (Note that while the UART Tx interrupt fires after the response phase, it is not specifically tied to any task functionality.)
Brief Description: Four tasks are running on the system:
- Idle
- 10ms background task
- Command handler receive task
- Command handler transmit task
This project is similar to the one above, except that queues are now used in the system instead of a semaphore. The command handler Rx task blocks waiting for a queue packet, which contains the 64-bytes of data and the data source. When the UART receives the data from the host SW, the UART Rx interrupt fires and the ISR sends the packet to the command handler Rx task. This task executes the command, and sends a queue Tx packet to the command handler Tx task (which was blocked waiting for the packet). The Tx task sends the 64 bytes of data back to the host software.
Brief Description: Six tasks are running on the system:
- Idle
- 10ms background task
- Command handler receive task
- Command handler transmit task
- Hardware Timer Task 1 (75us)
- Hardware Timer Task 2 (100us)
Two hardware tick timers are added to the system in this project. The first two triple timer counter modules of TTC0 in the Zynq-7000 processor are used for HW timing: TTC0-0 is set to generate an interrupt every 75us; TTC0-1 is set to generate an interrupt every 100us. A timer task is associated with each TTC module; each task remains blocked waiting for a semaphore that is sent by the related timer ISR. When the semaphore is received, the task is unblocked and it executes before returning to the blocked state. Note that the command handler tasks are still present in the system. The HW tick timers must run at the highest priorities (relatively) if timing is the most important factor in the system.
Brief Description: Seven tasks are running on the system:
- Idle
- 10ms background task
- Command handler receive task
- Command handler transmit task
- Hardware Timer Task 1 (75us)
- Hardware Timer Task 2 (100us)
- Low priority UART Comms Done Task
In this system, a low-priority task is added as a basic demonstration of notifiers. The UART Comms Done task waits on a notifier sent by the Command handler Tx task; As the name suggests, the notifier indicates that the UART Rx-Tx transaction is complete. The notifier is set to increment every time it is sent, and so it is used to keep a count of UART transactions in the system.
Brief Description: Three tasks are running on the system:
- Idle
- 10ms Task (Toggles LED 1)
- 20ms Task (Toggles LED 2)
This simple project simply shows two tasks running, one at 10ms, the other at 20ms. It also shows how one task (Task 2) can be suspended by the other task. (SW0 on the board is used for this purpose.)
Both tasks running:
Task2 suspended: