Releases: lucasdietrich/AVRTOS
avrtos v2.1.0: Polling API
Main Features
- Polling API:
Introduced polling API allowing threads to wait on multiple kernel objects simultaneously:- New
k_poll()function to wait for events on semaphores, mutexes, FIFOs, and message queues CONFIG_POLLINGconfiguration option to enable/disable polling support- Add an example (
poll) demonstrating polling with multiple kernel objects: https://github.com/lucasdietrich/AVRTOS/blob/main/examples/poll/main.c
- New
Minor Changes
- Added pointer coloring macros for AVR architectures to embed color values in unused pointer bits:
- Exposed
z_kerandz_main_threadas external symbols for advanced use cases - Improved Dining Philosophers example for Arduino framework
Full Changelog: v2.0.0...v2.1.0
avrtos v2.0.0: Rust Experimental Support, Memory Allocators, and More
Main Features
-
Rust Support (Experimental):
Introduced experimental support for Rust, including:- Automatic bindings generation via
build.rs - Basic thread API wrappers and kernel integration
- Examples for thread creation, stdio, and memory allocation:
build rust hello world withcargo run --example hello_world --release
- Automatic bindings generation via
-
Memory Allocation API (Experimental):
- Introduced a slab allocator and helper functions
- Added bump allocator and optional
malloc-like interface (CONFIG_USE_STDLIB_HEAP_MALLOC_MAIN) - Added allocator-related samples and integration with Rust global allocator
-
Thread Join Support:
- Added support for
k_thread_join()and corresponding example
- Added support for
-
Signal Handling (Draft):
- Initial support for synchronization primitives and signals in both C and Rust
-
Standard I/O Improvements:
- Added support for
stdinwith example - Updated stdio configuration:
CONFIG_STDIO_USART(default: USART0)- Deprecated:
CONFIG_STDIO_PRINTF_TO_USART
- Added support for
Bug Fixes
- Fixed kernel panic in
mem_slabcaused by improper wake-up handling - Fixed thread creation to ensure address stability throughout thread lifetime
- Fixed warnings in slab allocator (
slist_count) - Fixed
k_mem_slab_init()return value and removed outdated functions - Fixed compilation issues due to LLVM/Rust struct handling bug (
k_timeout_t) - Corrected warnings for Arduino IDE compatibility
- Resolved issue with
z_pend_current_on()leaving expired threads in queues
Improvements
- Improved project structure and documentation
- Updated
developer.md, reformatted README with Rust details - Added debug configuration improvements and enforced formatting
- Updated
parse_size_txt.pyto support Berkeley format (GCC 14.2.0) - Adapted
avr-sizeflags based on detectedavr-gccversion - Updated code metrics script
- Updated PlatformIO configuration and targets
Minor Changes
- Removed "cc" build dependency for Rust examples
- Changed tabs to spaces across codebase
- Removed forced default of
CONFIG_KERNEL_ASSERT = 0 - Renamed
k_thread_stop()andk_stop()tok_thread_abort()andk_abort() - Added
sleep,yeet, and critical section APIs - Added
CONFIG_KERNEL_TIME_API_MS_PRECISIONand improved timer functions - Deprecated public
k_work_submittableAPI - Added internal macros like
Z_THREAD_MAIN_PRIORITYandZ_THREAD_MAIN_STACK_END_ADDR - Cleaned up dead code and removed unused file descriptor implementation
Full Changelog: v1.3.1...v2.0.0
avrtos v2.0.0: Major Update with Rust Support, Memory Allocators, and More
Main Features
-
Rust Support (Experimental):
Introduced experimental support for Rust, including:- Automatic bindings generation via
build.rs - Basic thread API wrappers and kernel integration
- Examples for thread creation, stdio, and memory allocation
- Automatic bindings generation via
-
Memory Allocation API (Experimental):
- Introduced a slab allocator and helper functions
- Added bump allocator and optional
malloc-like interface (CONFIG_USE_STDLIB_HEAP_MALLOC_MAIN) - Added allocator-related samples and integration with Rust global allocator
-
Thread Join Support:
- Added support for
k_thread_join()and corresponding example
- Added support for
-
Signal Handling (Draft):
- Initial support for synchronization primitives and signals in both C and Rust
-
Standard I/O Improvements:
- Added support for
stdinwith example - Updated stdio configuration:
CONFIG_STDIO_USART(default: USART0)- Deprecated:
CONFIG_STDIO_PRINTF_TO_USART
- Added support for
Bug Fixes
- Fixed kernel panic in
mem_slabcaused by improper wake-up handling - Fixed thread creation to ensure address stability throughout thread lifetime
- Fixed warnings in slab allocator (
slist_count) - Fixed
k_mem_slab_init()return value and removed outdated functions - Fixed compilation issues due to LLVM/Rust struct handling bug (
k_timeout_t) - Corrected warnings for Arduino IDE compatibility
- Resolved issue with
z_pend_current_on()leaving expired threads in queues
Improvements
- Improved project structure and documentation
- Updated
developer.md, reformatted README with Rust details - Added debug configuration improvements and enforced formatting
- Updated
parse_size_txt.pyto support Berkeley format (GCC 14.2.0) - Adapted
avr-sizeflags based on detectedavr-gccversion - Updated code metrics script
- Updated PlatformIO configuration and targets
Minor Changes
- Removed "cc" build dependency for Rust examples
- Changed tabs to spaces across codebase
- Removed forced default of
CONFIG_KERNEL_ASSERT = 0 - Renamed
k_thread_stop()andk_stop()tok_thread_abort()andk_abort() - Added
sleep,yeet, and critical section APIs - Added
CONFIG_KERNEL_TIME_API_MS_PRECISIONand improved timer functions - Deprecated public
k_work_submittableAPI - Added internal macros like
Z_THREAD_MAIN_PRIORITYandZ_THREAD_MAIN_STACK_END_ADDR - Cleaned up dead code and removed unused file descriptor implementation
Full Changelog: v1.3.1...v2.0.0-pre
avrtos v1.3.1 (fix arduino samples build)
avrtos v1.3.0
Key Features:
- (experimental feature) New MCP2515 CAN driver: Introduced a new CAN driver for
the MCP2515 controller,
enabling CAN bus communication over SPI. IntroduceCONFIG_DEVICE_MCP2515
configuration option to enable or disable the MCP2515 driver. - Documentation Overhaul: Improved documentation across multiple modules, including
mutexes, semaphores, signals, FIFOs, flags, standard I/O, system time, timers,
events, atomic operations, idle thread, and various kernel headers. - Kernel State Structure: Introduced the
z_kernelstructure to centralize all
kernel state variables. - Thread Sleep Improvement: Reworked the
z_pend_current()function and modified
k_sleep()to utilize it. - Semaphore Enhancement: Added
k_sem_cancel_wait()function to allow cancellation
of threads waiting on a semaphore. - Renamed macros:
- Configuration Options Renaming
- Renamed several configuration macros for better consistency and clarity:
CONFIG_KERNEL_DEBUGtoCONFIG_KERNEL_SYSCLOCK_DEBUG=0CONFIG_KERNEL_TIME_SLICE_TICKStoCONFIG_KERNEL_TIME_SLICE_USK_EVENTS_PERIOD_TICKStoZ_EVENTS_PERIOD_TICKSK_TIMERS_PERIOD_TICKStoZ_TIMERS_PERIOD_TICKS
- Renamed several configuration macros for better consistency and clarity:
- SPI Driver Update: Renamed
spi_mode_ttospi_role_tand introduced a new
spi_mode_tfor better clarity in the SPI driver.
- Configuration Options Renaming
Minor changes:
- New Sample: Introduced a
hello-worldsample to help new users
get started quickly. - Function Relocation: Moved uptime functions to the
systime.cfile. - UART Configuration: Changed the default UART baud rate to 115200 bps for
consistency across the platform. - QEMU Configuration: Defined
icount autoin QEMU settings. - Makefile Upload Behavior: Adjusted the Makefile to flash the most recently
built sample when uploading
Bug fixes:
- I2C Driver Frequency Calculation Fix: Corrected the
FREQ_CALCmacro to ensure
accurate frequency settings in the I2C driver. - Timer Driver Function Correction: Fixed
ll_timer16_start()and introduced
ll_timer16_get_tcnt(). - Workqueue Module Macro Fix: Fixed the
K_WORK_DELAYABLE_INITmacro and
reintroducedz_delayable_work_trigger()to restore delayable workqueue functionality. - Kernel Synchronization:
- Scheduler Lock Improvement: Modified the kernel to lock the scheduler only
if it is not already locked, preventing potential deadlocks.
- Scheduler Lock Improvement: Modified the kernel to lock the scheduler only
Full Changelog: v1.2.1...v1.3.0
avrtos v1.2.1
Key features:
- I2C:
- Introduce function
i2c_master_write_read()enabling to write and
read data in a single transaction. - Rename
i2c_master_transmit())toi2c_master_write(). - Rename
i2c_master_receive()toi2c_master_read(). - Add option to configure the speed of the I2C bus on initialization.
- Introduce function
Minor changes:
- Introduce
CONFIG_KERNEL_REENTRANCYconfiguration option to enable/disable
reentrancy support for kernel objects, such as mutexes and sched lock/unlock. - Change code style, update
.clang-formatand format the codebase. - Improve stack sentinel verification by introducing a thread monitoring mecanism.
- Introduce
CONFIG_THREAD_MONITORandCONFIG_THREAD_MAIN_MONITORconfiguration
options to enable/disable thread monitoring. - Introduce
CONFIG_THREAD_STACK_SENTINEL_AUTO_VERIFYconfiguration option to
enable/disable automatic stack sentinel verification. - Improve
timerssubsystem.
Bug fixes:
- Fix returned error code in
i2c_master_write()andi2c_master_read(). - Fix
K_MSECmacro with big values ofCONFIG_KERNEL_SYSCLOCK_PERIOD_US. - Fix
K_WORK_DELAYABLE_INITmacro.
Full Changelog: v1.2.0...v1.2.1
avrtos v1.2.0
Key Features:
- I2C: Introduced a comprehensive I2C driver, and a minimal TCN75 device driver.
- SPI Driver Refactor: Enhanced the SPI driver by introducing the
spi_regsintermediate structure, which holds SPI registers. - Work Queue: Added support for delayable work queue items, with a sample demonstrating this feature.
Minor Changes:
- Stored MCUSR at startup using the
CONFIG_KERNEL_MINICORE_SAVE_RESET_CAUSEoption. - Introduced new configuration options:
- Management of reset cause with
CONFIG_KERNEL_MINICORE_SAVE_RESET_CAUSEandCONFIG_KERNEL_CLEAR_WDT_ON_INIT. - Addition of an idle hook through
CONFIG_IDLE_HOOK. - Enabling of the delayable work feature with
CONFIG_WORKQUEUE_DELAYABLE. CONFIG_SERIAL_AUTO_INIT.- Banner configuration options
CONFIG_AVRTOS_BANNER_ENABLEandCONFIG_AVRTOS_BANNER. - Various options for the I2C driver.
- Management of reset cause with
- Updated samples and documentation.
- Removed unused USART functions and eradicated obsolete code.
- Moved assembly files to
src/arch. - Improved overall error code returns and extended support for
CONFIG_KERNEL_ARGS_CHECK.
Bug Fixes:
- Fixed
CONFIG_KERNEL_AUTO_INITwith the Arduino framework by utilizing theinitVariant()function.
Documentation and Samples:
- Enhanced documentation.
- Added new samples demonstrating various features:
MCP3008andTCN75driver samples.- Arduino sample
MinimalExample.
Full Changelog: v1.1.0...v1.2.0
avrtos v1.1.0
Main features:
- SPI: Added SPI drivers for master and slave with full support for atmega328p
and atmega2560. - SPI: Added two samples to demonstrate communication between master and slave
(with data rate and error measurement). - DevOps: Added Dockerfile and Jenkinsfile for CI/CD.
Bug Fixes:
- Corrected bad characters in a preprocessor #error message.
- Resolved anomalies in the implementation of k_flags_notify() consequently,
refined the flags sample. - IRQ are now always enabled when exiting k_thread_stop(), this adjustment
ensures threads can be safely resumed using k_thread_start(). - Fixed a bug in QEMU preventing to use all timers (patch submitted and attached
here).
Improvements:
- Improved time functions: introduced
k_waitallowing to wait for a specific
time in a particular mode. Added support for millisecond precision in time API
through CONFIG_KERNEL_TIME_API_MS_PRECISION. - Updated and improved documentation.
- Optimized headers inclusions.
Minor changes:
- Introduced K_TICKS to declare timeouts in ticks.
- Introduced macros: FEATURE_TIMER_COUNT and FEATURE_USART_COUNT to ascertain if
an example can be built for a certain toolchain. - Enhanced disassembly script for PlatformIO.
- k_work_submittable removed from public API, but k_workqueue_create was added
to the Arduino keywords list. - Added sample for testing a single timer.
- Enhanced cmake targets with better ninja support, making ninja the default
generator. - Introduced a script for computing code metrics.
- Dead code was purged.
- Help added for thread-ev-spawn example.
- Defined internal macros: Z_THREAD_MAIN_PRIORITY and
Z_THREAD_MAIN_STACK_END_ADDR. - Eradicated unused/unfished file descriptor features (fd.c/fd.h).
- Eliminated /______/ code boundaries.
Full Changelog: v1.0.0...v1.1.0
avrtos v1.0.0
AVRTOS is a real-time operating system (RTOS) designed specifically for 8-bit AVR microcontrollers. The project aims to provide an efficient and highly configurable RTOS solution for AVR-based systems. Fully C/C++ compliant, AVRTOS is compatible with the AVR-GCC toolchain, Arduino and PlatformIO frameworks.
Key Features:
- Cooperative and preemptive threads
- Round-robin scheduling without priority support
- Configurable system clock
- Synchronization objects (mutexes, semaphores, workqueues, etc.)
- Drivers for UART, timers, GPIO, and external interrupts
- Thread sleep and scheduler lock/unlock
- Runtime object creation
- Thread canaries and sentinel stack protection
- Events and timers
- Atomic API, logging subsystem, and Uptime API
- Various data structures
- Thread naming, pseudo random number generator, and debug/utils functions
Supported AVR Architectures:
- AVR5: Tested on ATmega328p (Arduino PRO)
- AVR6: Tested on ATmega2560 (Arduino Mega2560)
Full Changelog: https://github.com/lucasdietrich/AVRTOS/commits/v1.0.0
Full Changelog: https://github.com/lucasdietrich/AVRTOS/commits/v1.0.0