Version 8.1.1, 2025-10-08
Bug Fixes:
QP/C++ source:
QP/C++ examples:
- improved and generalized batch scripts to automatically run tests on the host and various embedded targets (directoryexamples/qutest/auto_run).
- redesigned static analysis example for MISRA compliance checking (directoryexamples/arm-cm/dpp_nucleo-u545re/static_analysis).
QP/C++ tests:
- redesigned unit tests for state machines to improve consistency between QHsm/QMsm implementations and between QP/C and QP/C++ (test groupsTUN_QP_qep_hsm andTUN_QP_qep_msm).
- added regression unit test forbug #393 (testTUN_QP_qep_hsm_04)
- Remarks
- Full contents of directorytests is not provided in the open-source QP/C++ distribution and is available in theQP/C++ Extras.
QP/C++ static-analysis:
- redesigned MISRA compliance checking for QP/C++ Framework and QP/C++ Applications with PC-Lint-Plus (filesqpcpp.lnt andoptions.lnt in directorystatic-analysis/pclp)
- Remarks
- Full contents of directorystatic-analysis is not provided in the open-source QP/C++ distribution and is available in theQP/C++ Extras.
Version 8.1.0, 2025-09-30
This release makes major improvements in three areas: standard compliance (MISRA-C++:2023,HIS complexity and quality metrics), test coverage (lines of code, MC/DC), and certifiability of QP/C++ (by supplyingevidence of compliance). Here are the highlights of this release:
- Achieved and demonstratedMISRA-C++:2023 compliance of QP/C++ source code and provided procedures, tools, and specific configurations to extend this compliance toQP Application code. Theevidence for compliance is provided in the newly added sub-directorystatic-analysis.
- Achieved and demonstrated100% code lines test coverage (in the platform-independent QP/C++ code only at this time). The compliance is demonstrated in the newly added sub-directorytests.
- Achieved and demonstrated100% Modified Condition/Decision Coverage (MC/DC) (in the platform-independent QP/C++ code only at this time). This gold standard of test coverage has been verified with GCC 14.2 (available in QTools v8.0.3 and newer), which now supports MC/DC diagnostics (see the video"How to REALLY do MC/DC with gcc"). Theevidence for the coverage is provided in the newly added sub-directorytests.
- Achieved and demonstrated compliance withHIS complexity and quality metrics. The compliance is demonstrated in theSoftware Metrics Report.
QP/C++ source:
- refactored and partially redesigned all QP/C++ modules (including QS, QV, QK, and QXK) for compliance with MISRA-C++:2023.
- refactored and partially redesigned all QP/C++ modules (including QS, QV, QK, and QXK) to achieve thequality metrics, such as:
- McCabe cyclomatic complexity (v(G) HIS metrics) not exceeding 15 for all functions across all QP/C++ software modules
- number of paths (PATHS HIS metrics) not exceeding 99 for all functions across all QP/C++ software modules
- number of statements (STMT HIS metrics) not exceeding 55 for all functions across all QP/C++ software modules
- depth of nesting of a function (LEVEL HIS metrics) not exceeding 4 for all functions across all QP/C++ software modules
- number of return statements (RETURN HIS metrics) not exceeding 1 (single point of return) for all functions across all QP/C++ software modules
- source comments to achieve the recommended (COMF HIS metrics) above 0.2 (20%).
- removed thevolatile storage class from most of the classes in QP/C++. Scrutiny of thevolatile use in QP/C++ determined that, in most cases, it only unnecessarily prevented compiler optimization (see also article"Why the volatile type class should not be used"↑).
- replaced several inline functions (especially those with conditional logic) with the out-of-line implementations (in the .cpp files). This refactoring was done to better support the provability of 100% code coverage and MC/DC.
- redesigned theQP::QEvt class for more efficient verification via Duplicate Inverse Storage (DIS) invariant, which is performed in the SafeQP/C++ edition (but must be fully compatible with QP/C++). Specifically, allQP::QEvt attributes fit in 32 bits (std::uint32_t), withQP::QEvt::sig occupying 16 bits (64K signal space).
- Note
- The size of the event signal is no longer configurable (via theqp_config.hpp header file). The macroQ_SIGNAL_SIZE is no longer used and is deprecated (it has been removed from theqp_config.hpp header files in QP/C++ ports and examples).
- added templatesQP::dis_update() andQP::dis_verify() for updating and verifying the Duplicate Inverse Storage (DIS), respectively. These templates have been exposed in the public QP/C++ interface for managing the DIS invariants in the QP Application level consistently with the QP Framework.
- added functions to check the current use of event queues (QP::QEQueue) and memory pools (QP::QMPool). These functions were also used to support QP/Spy queries of event queues, active objects, memory pools, and event pools.
- redesigned the dual-mode QXK real-time kernel component to reduce cyclomatic complexity for compatibility with the adapted HIS quality metrics.
- Remarks
- Thepreemptive dual-mode QXK real-time kernel component is provided in theQP/C++ Extras, which are not included in the GPL distribution of QP/C++, but are available to commercial licensees and for evaluation.
- redesigned the target-resident QS software tracing component to reduce cyclomatic complexity for compatibility with the adapted HIS quality metrics.
- Remarks
- The target-residentQS software tracing component is provided in theQP/C++ Extras, which are not included in the GPL distribution of QP/C++, but are available to commercial licensees and for evaluation.
- redesigned global and local QS filters to improve efficiency on 32-bit CPUs.
- redesigned setting current-objects in QS-RX.
- redesigned querying current-objects in QS-RX. Added generic queries forall AO's event queues and all Event Pools in the system. Such generic queries are useful duringtesting (e.g., to verify no event leaks at the end of various tests.)
- improved consistency between QS and the QUTest test scripts in setting up global/local QS filters and querying various objects.
QP/C++ ports:
- removed configuration macroQ_SIGNAL_SIZE fromqp_config.hpp header files (size ofQP::QEvt::sig no longer configurable).
- removed calls toQP::QF::bzero() fromQP::QF::init() implementations in all ports. Clearing static variables is guaranteed by the C++ standard and manual zeroing of selected variables was only needed in non-compliant startup code. Such startup code should be made compliant (to clear the .BSS section).
- added definition of the macrosQF_EPOOL_USE_(),QF_EPOOL_FREE_(), andQF_EPOOL_MIN_() to ports that useQP::QMPool forQP event pools (mostQP ports do)
- added definition of macroQ_ASSERT_STATIC(expr_) to all QP/C++ ports as the C++11 static assert facility:static_assert((expr_), "QP static assert")
- modified the FreeRTOS port (directoryqpcpp/ports/freertos) to store the FreeRTOS task handle, which is then available to the applications. (Feature requested by users, who run FreeRTOS on multicore SoCs).
QP/C++ examples:
- removed obsolete configuration macroQ_SIGNAL_SIZE from theqp_config.hpp header files in all examples
- replaced deprecated QS global filter settings (inbsp.cpp files) fromQS_ALL_RECORDS to the newQS_GRP_ALL setting consistent with the QUTest testing harness.
- replaced deprecated QS local filter settings (inbsp.cpp files) fromQS_AP_ID to the newQS_ID_APP setting consistent with the QUTest testing harness.
- removed examples forcmsis-packs because they were not compatible with the current QP/C++ version (they had to be compatible with the QP/C++ version in the explicitly specified cmsis-pack).
- added directorystatic-analysis to the exampleqpc/arm-cm/dpp_nucleo-u545re. This directory illustrates static analysis (with PCLP) of theQP Application code.
3rd_party:
- updated uC-OS2 to version 2.93.01 and modified the uC-OS2 ports to GNU-ARM for the latest GCC 14.3 (to avoid errors "dangerous relocation: unsupported relocation")
QP/C++ static-analysis:
This release adds a new directorystatic-analysis, which contains the configurations and automation scripts for checking MISRA-C++:2023 compliance of the QP/C++ source code as well as QP/C++ Applications by means of thePC-Lint-Plus static analysis tool (PCLP)↑.
- Note
- Full MISRA compliance without anydeviations is unrealistic and was never intended due to many reasons, including the rule ambiguity, the context-sensitive interpretation of rules, rule overlap, and conflicts with other standards, such as functional safety goals. Instead, MISRA compliance means that all rules are checked and any deviations are understood, documented, and justified in a well-defined deviation process (called"Guideline Enforcement Plan (GEP)"). TheMISRA-C++:2023 Compliance Report (unique identifier DOC_MISRA_QPCPP), available in theSafeQP/C++ Certification Kit↑, documents theQP Framework's compliance using such a well-defined deviation process. Among others, that document providesDeviation Permits for MISRA-C++:2023 rule violations inQP Applications that are caused by theQP Framework design tradeoffs. TheDeviation Permits play a critical role in enabling practical MISRA compliance inQP Applications by providing a structured, auditable way to legitimately bypass MISRA rules or directives in thespecific, well-defined contexts without compromising safety, security, or maintainability.
The content of thestatic-analysis directory is described below:
qpcpp/+---static-analysis/ | diag.log // PCLP diagnostic output from the last run (evidence) | metrics_file.log // file metrics report from the last run (evidence) | metrics_func.log // function metrics report from the last run (evidence) | +---pclp/ (*EXTRA*) // analysis with PC-Lint-Plus | au-ds.lnt // Dan Saks' recommendations for placing 'const' and 'volatile' | au-misra-cpp2.lnt // PCLP MISRA-C++:2023 (MP2) confiuration for rules checking | co-gnu_arm.bat // script to generate configuration for GNU-ARM toolset | co-gnu_arm.h // generated PCLP header file for GNU-ARM (14.3 at this time) | co-gnu_arm.lnt // generated PCLP configuration file for GNU-ARM (14.3 at this time) | co-mingw32.bat // script to generate configuration for MinGW32 toolset | co-mingw32.h // generated PCLP header file for MinGW32 (14.2 at this time) | co-mingw32.lnt // generated PCLP configuration for MinGW32 (14.2 at this time) | make.bat // script to run the PCLP analysis | metrics_file.py // Python script to generate file metrics report from PCLP data | metrics_func.py // Python script to generate function metrics report from PCLP data | options.lnt // PCLP configuration with Deviation Records in QP source code | qpcpp.lnt // PCLP configuration with Deviation Permits in QP applications | qp_config.hpp // QP compile-time configuration used for "linting" QP source code | std.lnt // PCLP standard configuration used for "linting" QP source code | +---qk/ | qp_port.hpp // "QK port" for "linting" QK kernel code | qs_port.hpp // "QS port" for "linting" QK kernel code | +---qv/ | qp_port.hpp // "QV port" for "linting" QV kernel code | qs_port.hpp // "QS port" for "linting" QV kernel code | \---qxk/ qp_port.hpp // "QXK port" for "linting" QXK kernel code qs_port.hpp // "QS port" for "linting" QXK kernel code
- Note
- Directories marked with(*EXTRA*) are not provided in the GPL distribution of QP/C++, but are available to commercial licensees and for evaluation (see gs_extra).
- Remarks
- To run the static analysis diagnostics with the provided configuration and scripts, you need thePC-Lint-Plus static analysis tool (PCLP)↑, which is a commercial product ofVector Informatik↑.
QP/C++ tests:
This release adds a new directorytests, which contains the unit and integration tests of the QP/C++ source code, including test reports that demonstrate theclaimed test coverage.
The content of thetests directory is described below:
qpcpp/+---tests/ +---auto_run/ | run_host.bat // automation script to run all tests on the host | run_nucleo-u545re.bat // automation script to run all tests on NUCLEO-U545 target | | // unit test (TUN) reports (host and embedded target) | TUN_QP_qep_hsm.host // test report from the indicated unit test on the host | TUN_QP_qep_hsm.trg // test report from the indicated unit test on the target | . . . | TUN_QP_qutest.host | TUN_QP_qutest.trg | | // integration test (TIN) reports (embedded target only) | TIN_QP_mem.trg // test report from the indicated test on the target | TIN_QP_qk_sched.trg // test report from the indicated test on the target | TIN_QP_qv_sched.trg // test report from the indicated test on the target | TIN_QP_qxk_mutex.trg // test report from the indicated test on the target | TIN_QP_qxk_sched.trg // test report from the indicated test on the target | | // unit tests (TUN) (host and embedded target) +---TUN_QP_qep_hsm/ (*EXTRA*) // unit tests (TUN) for the qep_hsm module | +---src/ // code for exercising the module under test | | tstsm.cpp // QM-generated state machine implementation | | tstsm.hpp // QM-generated state machine interface | | tstsm.qm // QM model to generate code | | tstsm_sf.cpp // QM-generated state machines for Safety Functions | | tstsm_sf.hpp // QM-generated state machines interface | \---test/ | | Makefile // makefile to build & run tests on the host | | nucleo-u545re.mak // makefile to build & run tests on NUCLEO-U545 | | test_fixture.cpp // QUTest fixture | | TUN_QP_qep_hsm.py // QUTest script for main functionality | | TUN_QP_qep_hsm_sf.py // QUTest script for Safety Functions | | +---TUN_QP_qep_msm/ (*EXTRA*) // unit tests (TUN) for the qep_msm module | ... +---TUN_QP_qf_act/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_actq/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_defer/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_dyn/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_mem/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_ps/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_qact32/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_qact64/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_qeq/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_qmact/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qf_time/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... +---TUN_QP_qutest/ (*EXTRA*) // unit tests (TUN) for the qf_act module | ... | | // integration tests (TIN) (embedded target only) +---TIN_QP_mem/ (*EXTRA*) // integration tests (TIN) for memory protection | \---test_mpu/ +---TIN_QP_qk/ (*EXTRA*) // integration tests (TIN) for QK kernel | \---test_sched/ +---TIN_QP_qv/ (*EXTRA*) // integration tests (TIN) for QV kernel | \---test_sched/ +---TIN_QP_qxk/ (*EXTRA*) // integration tests (TIN) for QXK kernel | +---test_mutex/ | \---test_sched/
- Note
- The test directories marked with(*EXTRA*) are provided as theQP/C++ Extras, which are not included in the GPL distribution of QP/C++, but are available to commercial licensees and for evaluation. Also, to run the provided tests (for theQUTest trace-based testing framework↑), you need the target-residentQS software tracing component, which is also absent from the GPL distribution of QP/C++, but is available to commercial licensees and for evaluation (seeQP/C++ Extras).
Test coverage evidence:
The sub-directorytests/auto_run contains the test logs from the most recent run, which provideevidence for 100% lines of code and100% MC/DC coverage. These logs have been generated by theGCOV utility from the GCC output on the host. The following listing shows an annotated example of the generated log (fileTUN_QP_qep_hsm.host):
File '../../../src/qf/qep_hsm.cpp'Lines executed:100.00% of 182 // <== 100% lines coveredBranches executed:100.00% of 152Taken at least once:100.00% of 152Calls executed:100.00% of 242Condition outcomes covered:100.00% of 152 // <== 100% MC/DC coveredCreating 'qep_hsm.cpp.gcov'... (qutest log)
Version 8.0.4, 2025-06-11
The main purpose of this release is to improve the consistency and testability of all Safety Functions (implemented inQP with various assertions). Selected Safety Functions have been adapted from the SafeQP/C++ framework to this open-source QP/C++ framework edition to improve its robustness.
QP/C++ source:
- qsafe.h (FuSa Subsystem): introduced new form of "local assertions" (e.g.,Q_ASSERT_LOCAL(),Q_INVARIANT_LOCAL()), which test local function variables and can do it safely outside of a critical section. Only after detecting failure, these macros establish a critical section and callQ_onError().
- Added new macroQF_CRIT_EST() to establish critical section. This critical section is only for calling the error handlerQ_onError(), which never returns (Q_NORETURN), so the critical section is never exited.
- Applied the new local assertions in the hierarchical state machine implementations (qep_hsm.c and qep_msm.c)
- In QHsm and QMsm implementations, introduced invariant assertions to check that event dispatching always starts in a stable state configuration.
- InQP::QHsm and QMsm implementations, introduced explicit loop bounds (invariant assertions).
- InQP::QHsm implementation improved the performance by eliminating some calls to the state handlers while exiting the transition target to the transition source.
- InQP::QMPool implementation (used for QF event pools) introduced invariant assertions to check the integrity of the pool and its internal linked list of free blocks. Specifically, the linked list is now protected by duplicate inverted storage capable of detecting memory overruns (e.g., from one event to the next) and double-free of memory blocks.
- InQActive::publish_() implementation, introduced explicit loop bound invariant.
- InQTimeEvt::tick_() implementation, introduced explicit loop bound invariant.
- Improved encapsulation in theQP::QActive implementation by making all internal attributes private, but granting friendship to framework classes and functions.
- Converted QS interface from a namespace to a class, which allows granting friendship to the QS class from variousQP classes (needed for testingQP internals).
- Improved data hiding in the QS software tracing implementation.
- In QS, added pre-defined trace recordQS_QF_ACTIVE_DEFER_ATTEMPT
- In QP-Stub for QUTest added rigorous treatment of critical sections with assertions.
- Corrected several instances of type-casting for MISRA:C++ 2023 compliance.
QP/C++ ports:
- added definition of the macroQF_CRIT_EST() to all ports
- modified QActive::stop() implementation in various ports to unsubscirbe from all events only when pub-sub has been actually initialized (to avoid an assertion when it was not).
- removed the "dummy system calls" implementation from the GNU-ARM Cortex-M ports and moved it into the separate filesyscalls.c
QP/C++ examples:
- modified Makefiles in examples with GNU-ARM to use thesyscalls.c file and thus avoid linker warnings generated by the new GNU-ARM linker for missing system calls.
Version 8.0.3, 2025-04-07
QP/C++ source:
- added implementation ofQP::QActive::getQueueMin() (bug#383)
- in all built-in real-time kernels (QV, QK, and QXK) moved theQP::QF::onStartup() callbackafter the kernel initialization (such asQV_START(),QK_START(), andQXK_START()). This allowsQP::QF::onStartup() to override the settings from the kernel initialization (e.g., the default interrupt priorities).
- updated licensing comments in the QP/C++ source code.
- removed explicit version number from the source code comments to reduce the churn when no changes are introduced at a given version.
- made minor changes in function argument names andconst temporary variables for better MISRA:C++2023 compliance.
QP/C++ ports:
- modifed ARM Cortex-M ports with the GNU-ARM compiler to include dummy definitions of thestdio functions because the new GNU-ARM linker (14.2) reports warnings that the following functions are "not implemented and will always fail":
- _close()
- _lseek()
- _read()
- _write()
- Note
- If these dummy definitions are unwanted (e.g., because these stdio functions are actually used), the definitions provided in the ports can be suppressed by the macroQF_NDUMMY_SYS.
QP/C++ examples:
- upated all GNU linker scripts (*.ld files) for the new GNU-ARM linker (14.2) to provide the(READONLY) designation for readonly sections.
- Note
- This feature is supported in GCC11 and newer, but isNOT supported in GCC10 or earlier.
- updated FreeRTOS examples to the new FreeRTOS v11.2.0
- improved exampleqpcpp/examples/posix-win32/calc2 (Calculator without sub-machine and without repetitions in theoperand state)
- improved examplesqpcpp/examples/arm-cm/real-time_nucleo-c031c6 that demonstrate real-time performance of the QV and QK kernels
Version 8.0.2, 2025-01-20
This QP/C++ release marks the creation of the separateSafeQP/C++ edition focused on safety-critical applications requiring high integrity levels and specific Safety Functions. The Safety Functions causing overhead (e.g., MPU memory separation and duplicate inverse storage) have beenremoved from this QP/C version and moved to the "SafeQP/C++" edition.
- Note
- QP/C++ 8.0.2 API remains backwards compatible with the previous releases 8.0.0/8.0.1. QP/C++ API is also shared with the SafeQP/C++ edition.
QP/C++ source:
- removed support for memory isolation with MPU (Memory Protection Unit)
- removed Safety Functions requiring redundancies, such as
- Duplicate Inverse Storage
- Fixed upper loop bounds
QP/C++ examples:
- improved the "Blinky" examples for ARM Cortex-M
- added new examples for STM32Cube (directory@qpx/examples/stm32cube)
Bug Fixes:
Version 8.0.1, 2024-12-17
Bug Fixes:
QP/C++ ports:
- as part of the fix for bug #369, the critical section policy in QP/C++ ports to ARM Cortex-M has been redesigned (native ports to QV, QK, and QXK kernels). Specifically, the PRIMASK/BASEPRI policy is no longer tied to the ARM architecture (ARMv6-M vs. ARMv7-M+). Instead, the policy is controlled by theQF_USE_BASEPRI macro in theqf_config.h header file. If this macro is defined, BASEPRI is used and the value of theQF_USE_BASEPRI macro determines the BASEPRI threshold for "kernel aware" ISRs. IfQF_USE_BASEPRI is not defined, PRIMASK is used insted.
- modified critical section exit in QP/C++ port to ARM Cortex-R (ports/arm-cr), GNU-ARM (bug #376).
QP/C++ examples:
- updated all examples to use the newqp_config.hpp header file (withQF_USE_BASEPRI and other structural improvements).
- modified QUTest examples (examples/qutest/ directory) to pass command-line parameters to the test fixtures when compiled for the host. This is part of the bug fix#375 (QUTest script runner doesn't pass arguments to host executable).
Version 8.0.0, 2024-10-31
The main highlights of this milestone QP/C++ release are:
- Completed the implementation of all identifiedSafety Requirements for the functional safety of the QP/C++ Framework according to [IEC 61508-3:2010]. (This effort has been ongoing since QP/C++ release 7.0.0)
- Re-designed various functional areas to improve thesystematic software capability of QP/C++ Framework to achieve SIL-3. The most important change here isremoval of sub-machines and the related elements to reduce the cyclomatic complexity for testability, as identified in theQP/C++ Software Hazard and Risk Analysis. (This change corresponds to the matchingQM version 7↑, which also removed the sub-machines feature.)
- Due to the growing non-compliance with the GPL as well as infringement on thedual-licensing model of QP frameworks↑, the following QP/C++ components have beenremoved from the open-source GPL distribution and are now consideredQP/C++ Extras:
- QS target-resident software tracing component
- QXK dual-mode kernel
QP/C++ Extras available upon request:
qpcpp/// qpcpp installation directory
|
+---include/
| qs.hpp// QS target-resident software tracing public header file
| qs_pkg.hpp// QS target-resident software tracing package-scope header
| qxk.hpp// QXK dual-mode real-time kernel header file
|
+---src/
| |
| +---qs/// QS target-resident software tracing component implementation
| | qs.cpp
| | qs_64bit.cpp
| | qs_fp.cpp
| | qs_rx.cpp
| | qutest.cpp
| |
| \---qxk/// QXK dual-mode component implementation
| qxk.cpp
| qxk_mutex.cpp
| qxk_sema.cpp
| qxk_xthr.cpp
|
\---ports/
+---arm-cm/
| +---qxk/
| | +---armclang/
| | | qxk_port.cpp
| | | qp_port.hpp
| | | qs_port.hpp
| | |
| | +---gnu/
| | | qxk_port.cpp
| | | qp_port.hpp
| | | qs_port.hpp
| | |
| | \---iar/
| | qxk_port.cpp
| | qp_port.hpp
| | qs_port.hpp
| |
| \---qutest/
| qp_port.hpp
| qs_port.hpp
|
+---posix-qutest/
| qp_port.hpp
| qs_port.hpp
| qutest_port.cpp
| safe_std.hpp
|
\---win32-qutest/
qp_port.hpp
qs_port.hpp
qutest_port.cpp
safe_std.hpp
- Attention
- TheQP/C++ Extras will be provided to allcommercial QP/C++ licensees (upon request↑) and will also bereadily available for evaluation (upon request↑).
QP/C++ source code:
- Simplified theQP::QMsm implementation by removing the code for sub-machines, sub-machine states, entry-points, and exit-points.
- Re-designed and added the Fixed Upper Loop Bound monitoring to all not explicitly bounded loops in the QHsm and QMsm implementations.
- Re-designed transition-to-history handling inQP::QHsm andQP::QMsm, and particularlysoftware tracing of such transitions (to achieve identical trace behavior inQP::QHsm andQP::QMsm implementations).
- Re-designed self-monitoring ofQP::QEvt instances by replacing the Memory Marker with Duplicate Inverse Storage (DIS) for the volatile QP::QEvt::evtTag_ member. Made corresponding changes to verify the DIS invariants forQP::QEvt instances throughout the code.
- Added Duplicate Inverse Storage (DIS) monitoring to the volatile members ofQP::QEQueue and active object queue. Added code to update and verify the DIS invariants with assertions.
- Added Duplicate Inverse Storage (DIS) monitoring to the volatile members ofQP::QMPool. Added code to update and verify the DIS invariants with assertions.
- Added Duplicate Inverse Storage (DIS) monitoring to the volatile members ofQP::QTimeEvt. Added code to update and verify the DIS invariants with assertions.
- Improved the code for the Safety Functions related to memory isolation between software components by means of the MPU (Memory Protection Unit). Specifically, ensured that the mode changes between System and Application access rights are perfectly balanced. Also, added mode changes in the startup phase (changed for the ARMv8-M MPU that requires non-overlapping MPU regions).
- Re-designed the automatic initialization of dynamic events ("RAII" for dynamic events). Specifically, when the macroQEVT_PAR_INIT (previously macroQEVT_DYN_CTOR) is defined, the dynamic allocation automatically calls the member functioninit() (previously the constructor) that must be provided in the event class (subclass ofQP::QEvt). This release introduces function templates for allocating dynamic events (QP::QF::q_new() andQP::QF::q_new_x()). The macrosQ_NEW() andQ_NEW_X() remain for backwards compatibility, but aredeprecated in favor of the function templates.
- Re-designed the target-info QS trace record (QS::QS_TARGET_INFO) to report both theQP version number andQP release date. This was necessary for the license management introduced inQSpy 8.0.0↑.
QP/C++ ports:
- Changed all QP/C++ ports to mandate providing theqp_config.hpp header file in all QP/C++ applications. This avoids a whole class of potential defects caused by inconsistent compile-time options in different software builds. (NOTE: Compile-time configuration fileqp_config.hpp has been introduced in the earlier QP/C++ release, but it was optional and controlled by the QP_CONFIG macro. Nowqp_config.hpp is obligatory.
- Attention
- This change impactsall existing QP/C++ applications, which now must provide theqp_config.hpp file. The defaultqp_config.hpp header file can be copied from theqpcpp/ports/config directory.
- Fixed a bug in the QK and QXK ports to ARM Cortex-M to correctly handle configuration with an external IRQ instead of the default NMI.
QP/C++ examples:
- Addedqp_config.hpp files to all examples.
- Added examples for the STM32 NUCLEO-U545RE board (ARM Cortex-M33), which is now the primary embedded target for QP/C++.
- Added examples ofintegration testing with QUTest in the directoryqpcpp/examples/qutest/integration_tests.
- Added examples fortest automation on the host as well as an embedded target (the STM32 NUCLEO-U545RE) in the directoryqpcpp/examples/qutest/auto_run.
- Removed examples for the MPU and moved them to theSafeQP Certification Kits. These examples have been improved and extened for the ARMv8-M MPU available in the NUCLEO-U545RE board.
Bug Fixes:
Version 7.3.4, 2024-03-21
Bug Fixes:
QP/C++ source code:
- modifiedqv.cpp (fix for bug#355)
- modifiedqk.cpp (fix for bug#355)
QP/C++ ports:
- updated Cmake support (e.g., filesCMakeLists.txt, etc.)
Version 7.3.3, 2024-03-01
The main highlights of this release are:
- cleaned up of numerous spelling mistakes and typos in QP/C++ source code and documentation
- separated theqpcpp/examples sub-directory as aGit submodule qpcpp-examples to allow external contributions to examples
- bug fixes
QP/C++ source code:
- hardened theQP::QHsm andQP::QMsm implementations by adding explicit loop limits to prevent "malformed" state machines from crashing the event processor. Instead, added assertions if the loop limits are ever exceeded (see bug#351).
- changed the design ofQP::QEvt constructors for dynamic events–feature enabled by the macro QEVT_DYN_CTOR. See also discussion aroundbug#349
- changed semantics ofQP::QS::rxParse() to be called outside of critical section.
- added critical sections to QS-RX processing.
- addedQP::QS::setCurrObj() for QS software tracing (see bug#350).
QP/C++ ports:
- changed QUTest ports to General-Purpose OSes (posix-qutest and win32-qutest) NOT to use any console services (see bug#353).
- changed QP/C++ ports to General-Purpose OSes (posix, posix-qv, win32, and win32-qv) to provide console services only conditionally (when macroQF_CONSOLE is defined)
QP/C++ examples:
- consistently changed allbsp.cpp files (Board Support Packages) to callQP::QS::rxParse() outside critical sections.
- consistently changed all DPP examples to demonstrate the new implementation of "constructors for dynamic events".
- modified examples for posix-win32 to define the macroQF_CONSOLE when they actually use the console services.
- modified examples for MPU (examples/arm-cm/dpp_ek-tm4c123gxl_mpu andexamples/arm-cm/dpp_nucleo-c031c6_mpu) to configure the MPU for the Idle thread, so that the QS-RX access is allowed.
Bug Fixes:
Version 7.3.2, 2023-12-13
This maintenance release adds a minor design change to theQP::QAsm base class and corrects a few issues discovered in QP/C++ 7.3.1.
QP/C++ source codes:
- added virtual functionQP::QAsm::isIn() to theQP::QAsm base class
- added implementation of theQP::QHsm::isIn() virtual override to theQP::QHsm base class. In the process, fixed a bug in that implementation introduced by adding Duplicate Inverse Storage in theQP::QAsm::m_temp attribute.
- added implementation of theQP::QMsm::isIn() virtual override to theQP::QMsm base class
- deprecated the QP::QMsm::isInState() function, which should be now replaced with the virtual call
- changed the semantics of theQP::QS::onFlush() callback (software tracing), which is now NOT allowed to disable interrupts or use critical sections. This is necessary for avoiding nesting ofQP critical sections, whenQP::QS::onFlush() is used insideQ_onError() handler (to trace the error).
Ports:
- removed critical sections from theQP::QS::onFlush() implementations in POSIX and Win32 ports (filesqs_port.cpp).
Examples:
- removed interrupt disabling and critical sections from theQP::QS::onFlush() implementations in all BSP files (bsp.cpp).
- cleaned up the KEIL-uVision and IAR-EWARM project files that still contained old QP/C++ port header files (e.g.,qep_port.hpp,qf_port.hpp,qk_port.hpp,qv_port.hpp, andqxk_port.hpp). These files (consolidated and renamed toqp_port.hpp) were not actually used to build the projects, but their presence was confusing.
Version 7.3.1, 2023-12-05
The focus of this release continues to be improving the support forfunctional safety standards. This release adds several mechanisms to theQP Functional Safety (FuSa) Subsystem to mitigate various potential hazards.
QP Functional Safety (FuSa) Subsystem:
- added assertions to critical sections in the QP/C++ (in ports to: ARM Cortex-M, POSIX, POSIX-QV, WIN32, and WIN32-QV) to ensure that:
- critical sections insideQP never nest
- allQP critical sections are "balanced" meaning that every entry to a critical section is matched by exactly one exit from critical section.
- added Duplicate Inverse Storage protection to all internal variables in the QV and QK kernels;
- added explicit numerical loop limits for internal loops that traverse linked lists (e.g., time-event lists) or bitmasks (e.g., subscribers in pub-sub event delivery)
QV kernel:
- Added functions to disable/enable the QV scheduler (QP::QV::schedDisable() andQP::QV::schedEnable()). These functions are intended for situations where a CPU-intensive AO does not wish to be activated until the scheduler is re-enabled (typically in the next clock tick). Such scheduling might improve the timeliness of higher-priority AOs.
Ports:
- Redesigned the critical section implementation in ports to: ARM Cortex-M, POSIX, POSIX-QV, WIN32, and WIN32-QV to be based on functions rather than inline macros. This was needed to add the assertions mentioned above. (NOTE this redesign has NO impact on the applications)
- Changed ports to POSIX (POSIX and POSIX-QV) to use only non-recursive mutex for critical sections. This is done after ensuring that the critical sections never nest, so the simple, fast andportable non-recursive mutex is sufficient.
- Added templates of theQP configuration file (qp_config.hpp) to the ARM Cortex-M ports (in theqpcpp/ports/arm-cm/<qv|qk|qxk>/config directories.
- Modified ports to 3rd-party RTOSes (embOS, FreeRTOS, ThreadX, uC-OS2, Zephyr) to allow setting the RTOS-native AO priority as the second parameter of theQ_PRIO() macro.
Examples:
- Added "real-time" exampleqpcpp/examples/arm-cm/real-time_nucleo-l053r8 that demonstrates various scheduling policies of periodic and sporadic tasks. This includes multi-stage tasks and time-triggered scheduling under the QV kernel.
Version 7.3.0, 2023-09-12
The main focus of this QP/C++ release is improving the support forfunctional safety standards, such as IEC 61508 for electrical systems, and related IEC 62304/FDA510(k) for medical devices, IEC 60335 for household appliances, DO-178B/C for airborne systems.
QP Functional Safety (FuSa) Subsystem: This release adds QP Functional Safety Subsystem (QP FuSa), which is an expansion of the assertion-based programming extensively used in the QP Frameworks from the beginning. TheQP FuSa Subsystem consists of the following parts:
- Software assertions as a recommended technique (called Failure Assertion Programming (FAP) in IEC 61508)
- Software Self-Monitoring (SSM), which encompasses such techniques:
- Duplicate Inverse Storage for critical variables
- Memory Markers for critical objects (e.g., events)
- Memory Isolation by means of Memory Protection Unit (MPU)
Certification Kit
- Expanded traceability and improved the use of Unique Identifiers (UIDs)
Source Code:
- Removed header file "qassert.h" and moved the assertions to the file "qsafe.h", which now is part of theQP Functional Safety (FuSa) Subsystem.
- RenamedQ_onAssert() callback toQ_onError() and changed its semantics, which now involves a critical section (interrupts disabled). Specifically, theQ_onError() is always invoked inside a critical section.
- Changed the macro for disabling theQP FuSa Subsystem from #Q_NASSERT toQ_UNSAFE (disablingQP FuSa Subsystem isNOT recommended, especially in safety-related projects).
- Added the classQP::QAsm (abstract state machine) as the abstract base class (ABC) for state machine implementations. This ABC removes the coupling between the QHsm-style and QMsm-style state machine implementation strategies.
- RedesignedQP::QEvt class to support RAII (Resource Acquisition Is Initialization) for events, including dynamically allocated events
- Added a Memory Marker to all events (in the QEvt.evtTag_ attribute).
- Removed default constructor from QEvt class
- Added a constexpr QEvt constructor to theQP::QEvt base class. This constructor encapsulates the Memory Marker.
- Added overloaded QEvt constructor for dynamic events (enabled by macro QEVT_DYN_CTOR).
- Modified macrosQ_NEW() andQ_NEW_X() for the case when macro QEVT_DYN_CTOR is defined
- Removed option for adding virtual destructor and any other virtual functions to theQP::QEvt base class asunsafe. Removed macros #Q_EVT_XTOR and #Q_EVT_VIRTUAL.
- Re-designed the internals of the framework for Memory Isolation by dynamically adjusting memory settings (e.g., by dynamically reconfiguring the MPU). Among others, this required removing virtual functions for posting events from the QActive base class.
- Modified QP/C++ source code for better compliance with AUTOSAR-C++:14.
- Added traceability links to the AUTOSAR-C++ deviations in source code comments.
- Modified the behavior ofQP::QXSemaphore in the QXK kernel, which now behaves like semaphore in embOS/uC-OS2 rather then a semaphore in FreeRTOS.
- Added Duplicate Inverse Storage to the memory pools (QP::QMPool). Specifically, all the pointers in the link-list of the free blocks in the pool are now guarded with Duplicate Inverse Storage. This doubles the minimum size of the free block from one totwo pointers.
- Added Duplicate Inverse Storage to the subscriber lists (::QSubscrList). This doubles the size of the size ofQP::QSubscrList.
- Added Duplicate Inverse Storage to the ready-sets of the QV, QK, and QXK kernels.
- Introduced new macros for Memory Isolation:
Ports:
- Redesigned and simplified the port structure. Consolidated multiple include files (e.g., qep_port.hpp, qk_port.hpp, etc.) withqp_port.hpp. This reduced the number of header include file levels from 5 to 3.
- Added optionalQP configuration fileqp_config.hpp, which can be used for compile-time configuration of the QP/C++ framework for specific application without changing the official port. (Requires command-line option QP_CONFIG).
- Replaced the macro QF_CRIT_STAT_TYPE with QF_CRIT_STAT and changed the semantics of the macros for specifying critical sections in all existingQP ports. The macrosQF_CRIT_ENTRY()/QF_CRIT_EXIT() no longer take the status parameter:
- Modified the ARM Cortex-M ports (qpcpp/ports/arm-cm) to support Memory Isolation by means of the MPU (configurable by the macrosQF_MEM_ISOLATE, QF_MEM_SYS(), and QF_MEM_APP()).
- Removed QP/C++ port to Qt
Examples:
- Re-designed the sample application code and QM models (for Blinky, DPP, etc.) to present a new "modern" way of structuring and organizing QP/C++ applications.
- Modified the BSPs (Board Support Packages) in examples (mostly for ARM Cortex-M) to define the functionassert_failed(), which is now consistently called by fault handlers in the startup code.
- Added new examples for the affordable STM32C0 MCUs
- qpcpp/examples/arm-cm/dpp_nucleo-c031c6
- Added new examples for Memory Isolation with the MPU:
- qpcpp/examples/arm-cm/dpp_nucleo-c031c6_mpu - use of MPU in ARM Cortex-M0+
- qpcpp/examples/arm-cm/dpp_ek-tm4c123gxl_mpu - use of MPU in ARM Cortex-M4F
- Removed calls toQ_onAssert() from all example startup code and replaced it with calls toassert_failed(). This is for consistency and interoperability with existing libraries (e.g., STM32Cube) and for adding flexibility in defining error handling forhardware exceptions.
- Removed examples for Qt
- Note
- This change impacts most existing examples because it is now necessary to defineassert_failed() in the applications (typically in the Board Support Package). The typical definition ofassert_failed() is to callQ_onError().
Documentation:
- Reorganized the QP/C++ documentation according to the new Documentation Management Plan.
- Removed the Doxygen documentation from the source code and placed it in the separate directoryqpcpp/doc. This separation of concerns significantly reduces the need to change (and re-certify!) the QP/C++ source code just to update the documentation. This is part of the new Configuration Management Plan.
Bug Fixes:
Version 7.2.1, 2023-01-15
QP/C++ Source Code:
Ports:
- Fixed problems in QK ports for ARM Cortex-M: in case a regular IRQ is used for returning to the thread context. The port didn't handle correctlyQK_USE_IRQ_NUM above 32.
- Fixed problems in QXK ports for ARM Cortex-M: in case a regular IRQ is used for returning to the thread context. The port didn't handle correctlyQK_USE_IRQ_NUM above 32.
Bug Fixes:
- Attention
- This bug in QXK affects releases QP/C++7.1.0 through7.2.0
Version 7.2.0, 2023-01-06
QP/C++ Source Code:
- Note
- It is no longer necessary to generate QS function dictionary forQP::QHsm::top() in the application (although it is still allowed, but wasteful).
Ports:
- ports/arm-cm added setup of the FPU (if configured) to all built-in kernels (QV, QK, QXK) and toolchains (ARMCLANG, GNU-ARM, IAR).
- ports/arm-cm all ports now clear the FPCA bit in the CONTROL register (if FPU configured) right before starting the interrupts. That potentially saves the stack space (MSP) for the automatically reserved FPU context.
- Note
- This change means that the applications no longer need to setup the FPU, which was done typically in the BSP.
- ports/posix added configuration macroQS_CTR_SIZE 4U, to allow QS trace buffers > 64KB (see alsofeature#195)
- ports/win32 added configuration macroQS_CTR_SIZE 4U, to allow QS trace buffers > 64KB (see alsofeature#195)
- ports/esp-idf fixed compilation error caused by obsolete macroQF_PTR_RANGE_()
- ports/sample added a sample QP/C port for reference and documentation of all available configuration options.
- zephyr updatedqf_port.hpp to include<zephyr/kernel.h> rather than<zephyr/zephyr.h> (see alsobug#321)
Examples:
- examples for QV: added callbackQF_onContextSw()
- examples for QK, QXK: replaced callbacksQK_onContextSw()/QXK_onContextSw() withQF_onContextSw()
- examples/arm-cm removed setting up the FPU from the BSPs (the FPU is now setup in the ports).
- examples/arm-cm added setting up the MPU (Memory Protection Unit) to catchNULL-pointer dereferencing and other incorrect memory access.
Testing:
- changed the QUTest assertion handlerQ_onAssert() (filequtest.cpp) to reset the target rather than wait for user commands. This allows proper assertion handling even inside exception handlers, where the target really cannot handle interrupts (which were needed for reception of commands). This change matches the updated policy ofassertion failures inQUTest 7.2.0.
- examples for QUTest (examples/qutest andtest directories): adjusted makefiels to invoke thequtest.py utility with the newcommand-line parameters.
- modified the test fixtures to use "enum dictionaries" for commands
- added exampleexamples/qutest/start_seq that demonstrates testing of start sequences.
Bug Fixes:
Feature Requests:
Version 7.1.3, 2022-11-18
Bug Fixes:
- This release fixesbug#317 in QK kernel
Source
- The fileqstamp.cpp has been copied from theinclude/ folder tosrc/qs/. This makes it easier to build SPY configuration. (The fileqstamp.cpp has been left in theinclude/ folder for backwards compatibility).
Ports
- This release removes theQP libraries from theWindows ports
- CMakeLists.txt file in the zephyr port has been modified to usezephyr_library_named(qpcpp) instead ofzephyr_library()
Examples
- This release changes all examples forWindows (Makefiles for GCC and project files for Visual Studio) to build the QP Framework from sources rather than usingQP libraries. This slightly extends the first build of the application, but avoids any problems with library incompatibilities (e.g., 32-bit/64-bit compilers used to build the application vs. theQP libraries).
- updated examples for emWin Embedded GUI (for emWin v6.28)
- updated examples for MSP430
Documentation
- Modified thedoxygen/ folder for generation of QM Manual in LaTeX (enables generation of PDF)
Licensing
- This release removes theQM-EVAL-QPC.qlc file from theLICENSES folder. This "QM License Certificate" is no longer needed for QM 5.2.3, where "QM License Certificates" are no longer needed for generating QMsm-style state machines.
Version 7.1.2, 2022-10-07
This release improves preemption-threshold scheduling (PTS) in QK kernel, especially the generation of the software tracing information about the scheduler activity. Also, PTS has been removed from the QXK kernel because of the inherent complexity of that kernel.
Additionally, the default forQF_TIMEEVT_CTR_SIZE has been increased from 2 to 4 bytes. This increases the default dynamic range for QTimeEvt counters to 32-bits.
Source
- Modified QK_sched_() and QK_activate_()
- Modified QXK_sched_() and QXK_activate_()
- Added QXK_contextSw() to handle context switching (generation of software tracing information and invoking of the QXK_onContextSw() callback, if configured
- increased default forQF_TIMEEVT_CTR_SIZE 4
- changed inclusion guards in the QP/C++ header files (e.g.QF_HPP ->QP_INC_QF_HPP_) for compliance with the updated Quantum Leaps coding standard and to make the names more unique.
Ports
- Modified QXK ports (assembly) to call QXK_contextSw()
- Added port to RISC-V with the non-preemptiveQV kernel
Testing
- Added new directoryqpcpp/test/ forsystem-level testing of QP/C itself.
- Added new tests for QK:qpcpp/test/qk
- Added new tests for QXK:qpcpp/test/qutest/qxk
- Note
- Theqpcpp/test/ directory is planned to contain a growing number of system-level tests, which are based on QUTest, butwithout the QP-stub. The tests take advantage of the new QUTest configuration, where the QP-stub is NOT included (because the actual QP Framework is linked). This configuration is activated by defining macroQ_UTEST=0.
- Attention
- Most tests provided in theqpcpp/test/ directory run only on embedded targets and cannot run on the host machine.
Version 7.1.0, 2022-08-30
This QP/C++ release introducespreemption-threshold scheduling (PTS) for the preemptive QK and QXK kernels. Specifically, it is now possible to limit preemption of a given QActive/QXThread by giving it both the QF-priority and preemption-threshold.
The following diagram shows the relationship between the "QF-priority" and "preemption-threshold" (see alsoQP::QPrioSpec):

- Note
- For backwards-compatibility, ::QPrioSpec data type might contain only the "QF-priority" component (and the "preemption-threshold" component left at zero). In that case, the "preemption-threshold" will be assumed to be the same as the "QF-priority". This corresponds exactly to the previous semantics of AO priority.
Source
- modified the QP/C code for preemption-threshold
- improved QS tracing of Scheduler activities in QK and QXK
- improved implementation of QXSemaphore and QXMutex in QXK
Ports
- Modified QK and QXK ports to ARM Cortex-M for preemption-threshold and for handling the context-switch callback
- Updated Zephyr port and examples for Zephyr 3.1.99
Examples
- AddedQ_PRIO() macro for setting QF-priority and preemption-threshold to various examples (in calls to QAcive::START())
- increased size of the main stack in most examples from 1024 to 2048 bytes. This is to prevent stack overflow that was observed with the lower limit.
Testing
- modified QUTest to also allow testing of the QP Framework itself.
Version 7.0.2, 2022-08-12
Bug Fixes:
Ports Modified QK and QXK ports to ARM Cortex-M
- qpcpp/ports/arm-cm/qk
- qpcpp/ports/arm-cm/qxk
Modified Zephyr port
- moved the port from the usual location inqpcpp/ports/zephyr up a level toqpcpp/zephyr. This was done to make QPCPP into an externalZephyr module, which has to comply with the Zephyr specification.
Examples (ARM Cortex-M):
- qpcpp/examples/arm-cm/dpp_efm32-slstk3401a/qk provided examples of configuring either NMI or IRQ for Cortex-M4 (ARMv7m)
- qpcpp/examples/arm-cm/dpp_efm32-slstk3401a/qxk provided examples of configuring either NMI or IRQ for Cortex-M4 (ARMv7m)
- qpcpp/examples/arm-cm/dpp_nucleo-l053r8/qk provided examples of configuring either NMI or IRQ for Cortex-M0+ (ARMv6m)
- qpcpp/examples/arm-cm/dpp_nucleo-l053r8/qk provided examples of configuring either NMI or IRQ for Cortex-M0+ (ARMv6m)
Examples (Zephyr):
- qpcpp/examples/zephyr/blinky - modified to use the new Zephyr port
- qpcpp/examples/zephyr/dpp - modified to use the new Zephyr port and to demonstrate QSPY software tracing.
Version 7.0.1, 2022-07-31
This release is the first one that contains the completeQM model of the QP/C++ framework (in the fileqpcpp/qpcpp.qm). This model is then used togenerate all QP/C++ source code:
The QM model of QP/C++ explicitly captures thelogical design of the framework, which is then mapped to the preexistingphysical design. Thelogical design, which consists of packages (often associated with namespaces), classes, types, and macros traces explicitly to theSoftware Architecture Specification (SAS) and is easier to manipulate and refactor.
Source Code Changes:
- The whole QP/C++ source code is now generated from theqpcpp.qm model.
- Refactored classes with only static members (QF, QV, QK, QXK, QS) intonamespaces. This allows the namespaces to be extended in theQP ports.
- Refactored:
- QF::publish_() -> QActive::publish_()
- QF::psInit() -> QActive::psInit()
- QF::tickX_() -> QTimeEvt::tick_()
- Note
- The old APIs (QF::PUBLISH(), QF::TICK_X(), QF::psInit()) are still provided, but are tagged asdeprecated.
- Moved package-scope header files qf_pkg.hpp andqs_pkg.hpp from theqpcpp/src directory toqpcpp/include. This allows the build process to specify only theqpcpp/include directory to build applications and QP/C++ source code. Previously, the build process had to specify additionallyqpcpp/src, but this is no longer needed.
- Note
- This change allowed all provided examples to be simplified by removing theqpcpp/src include directory from the various project files.
Adapted QP/C++ source code to avoid warnings from the new C++20 standard about: "compound assignment with 'volatile'-qualified left operand is deprecated".
Ports/Examples:
- Removed port and examples for the older ARM7/ARM9
- Added port to theZephyr RTOS
- Added examples for the Zephyr RTOS
- redesigned QP/C++port to FreeRTOS, seeqpcpp/ports/freertos
- slightly improved QP/C++port to ThreadX, seeqpcpp/ports/threadx
Improved Documentation: The Doxygen documentation has been re-structured and improved. Also the more attractive styling of the HTML has been applied.
Version 7.0.0, 2022-04-30
This major focus of this release is the adaptation of the code and documentation to better support safety certification (seeQP Certification Pack)
Modified QP/C++ source code:
- updated QP/C++ source code for AUTOSAR:C++14
- made the compliant with the updated "Quantum Leaps Embedded C/C++ Coding Style (QL-C/C++:2022)"
- added traceability links between QP/C++ source code and requirements, architecture, design, and MISRA deviation permits.
- modified the top-level file comments now have standard-compliant license specification (SPDX-License-Identifiers). This allows QP/C++ to be included in automatic generation of Software Bill Of Materials (SBOM).
Modified QP/C++ ports:
- modified the QK and QXK ports to ARM Cortex-M to allow compile-time selection between using either NMI or an unused IRQ (via macro QK_USE_IRQ_HANDLER) as a mechanism to return to the thread mode
- removed unusedARM_ARCH symbol from Makefiles for GNU-ARM
- fixed the following bugs in QXK port to ARM Cortex-M
Modified GitHub repository:
- removed the3rd_party directory from theqpcpp GitHub repository to avoid tracking changes caused by updates to the 3rd-party components. (The QP/C++ releases still have the3rd_party directory, because it is needed for building the examples).
Added/Modified examples:
- modified examples for ARM Cortex-M7 (to integrate better with STM32CubeH7)
- added examples for ARM Cortex-M33 (for STM32 NUCLEO-L552ZE and STM32CubeL5)
- addedqutest examples for Unity (comparison between Unity and QUTest)
Modified QP/C++ documentation:
- restructured the Doxygen documentation for traceability
- added theQP/C++ Tutorial
- added the QP Certification Pack
- Remarks
- TheQP Certification Pack is still work in progress in this release, but the remaining work is limited to documentation only and no code restructuring is anticipated for that.
Version 6.9.3, 2021-04-12
Feature Requests:
The feature has been implemented by means of the "sender" parameter of thePUBLISH() macro, which must now be a pointer to a struct that has theprio member. This design enables applying QS local filter to theprio as the QS-Id. This works for publishing events from active objects. For publishing events outside active objects (e.g., from ISRs), the header fileqs.h provides a typeQP::QSpyId, which should be used to define QS ID variables to be used as "sender" inPUBLISH().
- Note
- This change only affects the Spy build configuration, where the QS software tracing instrumentation is enabled.
This feature request is now implemented uniformly in all QP-ports to 3rd-party RTOSes by means of the genericQP APIQP::QActive::setAttr(). Specifically, theQP port will allow you to set the thread name by callingQP::QActive::setAttr() before calling QACTIVE_START().
Bug Fixes:
Source code changes:
Modified QP/C ports:
- qpcpp/ports/arm-cm/ - fixedbug#298
- qpcpp/ports/embos/ - implementedfeature#185
- qpcpp/ports/threadx/ - implementedfeature#185
- qpcpp/ports/ucos2/ - implementedfeature#185
- qpcpp/ports/win32/ - added QSpy64 (64-bit) build configuration to the Visual Studio project
- qpcpp/ports/win32-qv/ - added QSpy64 (64-bit) build configuration to the Visual Studio project
- qpcpp/ports/win32-quit/ - added "port" used for "QP Unit Internal Testing" (QUIT)
Updated examples:
- all examples usingPUBLISH() - adjusted thesender parameter of the macro to have theprio member
- qpcpp/examples/arm-cm/ - fixedbug#298 (added calls toQV|QK|QXK_ARM_ERRATUM_838869())
- qpcpp/examples/qutest/self_test/test/ - added examples of the Python include files (*.pyi) for the newinclude command.
- qpcpp/examples/arm-cm/dpp_efm32-slstk3401a/win32-gui/ - corrected handling of user-drawn buttons inbsp.cpp
- qpcpp/examples/arm-cm/game_efm32-slstk3401a/win32-gui/ - corrected handling of user-drawn buttons inbsp.cpp
Updated 3rd-Party Components:
- qpcpp/3rd_party/threadx to version 6.1.6 (latest open source version fromGitHub )
Version 6.9.2, 2021-01-18
The main purpose of this release is a redesign of the QS-RX (software tracing input) to implement the feature request #187:
Additionally, as part of the re-design of the internal QS-RX implementation, this release fixes the bug #287 ("QP::QS::rxGetNfree() returns too low value", see the "Bug Fixes" section)
Additionally, this release introduces a new virtual functiongetStateHandler() in theQHsm base class. This is part of the fix for bug #290 ("QView query object state reports wrong state with QMsm strategy", see the "Bug Fixes" section)
Source code changes:
The introduction of theQHsm::getStateHandler() virtual function involves the following code changes:
The redesign of QS-RX implementation involves the following code changes:
Modified QP/C++ ports:
- qpcpp/ports/embos/ - added missingnoexcept specifiers
- qpcpp/ports/freertos/ - added missingnoexcept specifiers
- qpcpp/ports/threadx/ - added missingnoexcept specifiers
- qpcpp/ports/uc-os2/ - added missingnoexcept specifiers
- qpcpp/ports/qt/ - added missingnoexcept specifiers
- qpcpp/ports/posix/ - modified to take advantage of the QS-RX direct byte ordering
- qpcpp/ports/posix-qutest/ - modified to take advantage of the QS-RX direct byte ordering
- qpcpp/ports/posix-qv/ - modified to take advantage of the QS-RX direct byte ordering
- qpcpp/ports/win32/ - modified to take advantage of the QS-RX direct byte ordering
- qpcpp/ports/win32-qutest/ - modified to take advantage of the QS-RX direct byte ordering
- qpcpp/ports/win32-qv/ - modified to take advantage of the QS-RX direct byte ordering
Updated examples:
- qpcpp/examples/performance/dpp_efm32-slstk3401a - adjustedapp_cfg.h file for uC/OS-II
- qpcpp/examples/workstation/calc fixed minor bug in the calculator
Bug Fixes:
Updated 3rd-Party Components:
- qpcpp/3rd_party/CMSIS to version 5.7.0
- qpcpp/3rd_party/FreeRTOS to version 10.4.3 (202012LTS released December 2020)
Version 6.9.1, 2020-09-28
The main purpose of this release is a redesign of theQS Local Filter (see alsofeature request #127). This new design supports filtering onmultiple active objects (as well as other objects in the Target memory), as opposed to filtering just one such object at a time. The main use case for this redesign of QS LocalFilter is an application, where some active objects are very "noisy", and would overwhelm your trace. The new QS LocalFilter allows you to selectively silence the "noisy" active objects and let all the others through.
The new QS LocalFilter is based on "QS-IDs" associated with various objects in the Target memory. The QS-IDs are small integer numbers, such as the unique priorities assigned toQP Active Objects, but there are more such QS-IDs, which you can assign to various other objects through the macroQS_BEGIN_ID(). Then, you can setup the QS LocalFilter to trace only a specific QS-IDs or whole groups of QS-IDs by means of the macroQS_LOC_FILTER() or remotely via the QS-RX channel.
Source code changes:
The redesign of the QS LocalFilter impacts the QS trace instrumentation in QP/C++: both thepre-defined QS trace records and theapplication-specific trace records. The changes to the pre-defined records are confided to the QP/C++ source code and are transparent to the application developers. However, the changes to the application-specific trace records require adjusting existing applications as follows:
- Note
- The macroQS_BEGIN_ID() assigns the specified QS-ID number to the app-specific record, which can be subsequently filtered by the new QS LocalFilter. The old macro QS_BEGIN(), with the old LocalFilter interface, is still available, but isdeprecated and not recommended.
The following macros aredeprecated:
- macro QS_FILTER_SM_OBJ() does nothing in QP/C++ 6.9.1
- macro QS_FILTER_AO_OBJ() does nothing in QP/C++ 6.9.1
- macro QS_FILTER_MP_OBJ() does nothing in QP/C++ 6.9.1
- macro QS_FILTER_EQ_OBJ() does nothing in QP/C++ 6.9.1
- macro QS_FILTER_TE_OBJ() does nothing in QP/C++ 6.9.1
- macro QS_FILTER_AP_OBJ() still works for QS_BEGIN()
- macro QS_FILTER_ON() still works, but usesQS_GLB_FILTER() internally
- macro QS_FILTER_OFF() still works, but usesQS_GLB_FILTER() internally
- macro QS_BEGIN() still works, but uses the old "AP-OBJ" pointer
The following APIs have beenchanged:
- QHsm::init() now takes extraqsId parameter
- QHSM::dispatch() now takes extraqsId parameter
- QMPool::get() now takes extraqsId parameter
- QMPool::put() now takes extraqsId parameter
- QEQueue::post() now takes extraqsId parameter
- QEQueue::postLIFO() now takes extraqsId parameter
- QEQueue::get() now takes extraqsId parameter
- Note
- The API changes arenot backwards-compatible and require adjusting existing QP/C++ applications.
Additionally, this release introduces the new pre-defined QS record #QS_QF_NEW_ATTEMPT, which is generated whenQ_NEW_X() fails to allocate a dynamic event. Also, this releasereverses the order of the pre-defined QS records #QS_QF_NEW and #QS_QF_MPOOL_GET. This was necessary if the dynamic allocation is allowed to fail, because onlyafter attempting to allocate a memory block, the QF::newX_() function can generate either #QS_QF_NEW or #QS_QF_NEW_ATTEMPT.
- Note
- The reversal of #QS_QF_NEW and #QS_QF_MPOOL_GET trace records has implications for the existingQUTest test scripts, where the order of expectations for "QF-New" and "MP-Get" needs to be reversed as well.
Additionally, this release modifies the QXK source code, so that theQActive.m_prio attribute is the fixed priority assigned inQP::QActive::start(), whileQActive.m_dynPrio is the "dynamic" priority that can be changed when a QXK extended thread acquires amutex.
Updated Ports:
- all ARM Cortex-M ports (added workaround for theARM Erratum 838869)
- all QK ports (because of the changed QMPool::get() / QMPool::put() interface)
- all QXK ports (because of the changed QMPool::get() / QMPool::put() interface)
- embOS port (because of the changed QMPool::get() / QMPool::put() interface)
- FreeRTOS port (because of the changed QMPool::get() / QMPool::put() interface)
- ThreadX port (because of the changed QMPool::get() / QMPool::put() interface)
- uC/OS-II port (because of the changed QMPool::get() / QMPool::put() interface)
- posix, posix-qv (because of the changed QMPool::get() / QMPool::put() interface)
- win32, win32-qv (because of the changed QMPool::get() / QMPool::put() interface)
Feature Requests:
Bug Fixes:
Version 6.9.0, 2020-08-21
The main purpose of this release is to adjust the QP/C++ RTEF to the changes and improvements introduced inQTools 6.9.0. Specifically, QP/C++ now includes examples for the newQView Visualization & Monitoring as well as adjustments for the new version ofQUTest Unit Testing.
Source code changes:
Added new #QS_QF_RUN trace record toQS software tracing, which is now generated in all QP/C++ ports upon the entry to QF::run(). This trace record marks the end of the application startup, at which time all theQS dictionaries are typically produced.
Also, added the information about the targetendianness to the #QS_TARGET_INFO QS trace record.
- Note
- The addition of the #QS_QF_RUN trace record affects only theSpy build configuration and is hasno impact on the Release or Debug build configurations.
Updated Ports:
- All QP/C++ ports to 3rd-party RTOSes (embOS, FreeRTOS, ThreadX, uC/OS-II) and OSes (POSIX, POSIX-QV, WIN32, WIN32-QV) have been updated to generate the #QS_QF_RUN trace record.
- The POSIX and POSIX-QV ports have been updated to add the call topthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) (see alsobug#276)
- The MSP430 ports have been extended for the GNU-MSP430 compiler, so that they now work with IAR-MSP40, TI-MSP40 and GNU-MSP430 toolchains.
Updated Examples:
- AllQUTest examples (qpcpp\examples\qutest directory) have been modified to use the new location of thequtest.py Python module. Also, all QUTest examples that use theon_reset() callback have been modified to callexpect_run().
- Note
- The #QS_QF_RUN record is now generated inQUTest unit testing, which requires adjustments in the existingtest scripts. Specifically, the test scripts that provide their ownon_reset() callback must now also callexpect_run().
- ARM Cortex-M examples for STM32 NUCLEO-L053RE (qpcpp\examples\arm-cm\dpp_nucleo-l053r8) and NUCLEO-L152RE (qpcpp\examples\arm-cm\dpp_nucleo-l152re) have been modified to support bi-directional QSPY communication. These examples now include the QView demos.
- Added examples of newSequence Diagram Generation in QSPY 6.9.0
- The example projects for MSP430 now contain theccs-ti andccs-gnu directories, for the TI-MSP430 and GNU-MSP430 toolchains, respectively.
Bug Fixes:
Version 6.8.2, 2020-07-17
Source code changes:
- Cleaned up the code to remove violations of AUTOSAR-C++ rules
- Changed casts of type(void)xxx intostatic_cast<void>(xxx). This is done to avoid static analysis warnings about "C-style casts"
- Added suffixes 'U' to unsigned integer literals
- Changedqxk_xthr.cpp to use the QP::TE_IS_LINKED constant instead of a "magic" number 0x80U.
- Fixed errors in the Doxygen documentation, such as: missing documentation for parameters, wrong parameter names, unresolved references, etc.
- Applied new, clearer styling to the Doxygen documentation.
- Changed the QS trace record name QS_QF_ACTIVE_POST_FIFO toQP::QS_QF_ACTIVE_POST and QS_QF_EQUEUE_POST_FIFO toQP::QS_QF_EQUEUE_POST. This refactoring now better matches the QP/C++ APIPOST() and QEQueue::post().
Updated Ports:
- enabledQACTIVE_CAN_STOP in the ports: Win32, Win32-QV, Win32-QUTEST, POSIX, POSIX-QV, and POSIX-QUTEST.
- port to uC/OS2 has been adapted to the new uC/OS2 v2.93.00 (recently released by Silicon Labs under the open source Apache 2.0 license).
Updated Examples:
- ModifiedMakefiles for the workstation examples to add the-no-pie linker option only whenGCC_OLD environment variable is NOT defined. This is to accommodates older POSIX platforms with older GCC distribution.
- Modified all ARM-KEIL uVision projects for ARM-CLANG to use the startup code in the ARM-ASM syntax.
- New uC/OS-II example uc-os2_dpp_nucleo-l053r8 (Cortex-M0+)
- Removed uC/OS-II example for the STM32-NUCLEO-L152RE (Cortex-M3)
- Added QM model files:workstation/defer/defer.qm andworkstation/reminder2/reminder2.qm
Updated QUTest examples to generate code-coverage information:
- ModifiedMakefiles in QUTest examples (directoryexamples\qutest) to generatecode-coverage information. Specifically, when theGCOV environment variable is defined, theMakefiles generate code-coverage information forGCOV.
- Note
- The GCOV code-coverage generation is currently available only on the hosts.
Updated 3rd-Party Components:
- CMSIS from 5.6.0 to 5.7.0
- uC/OS-II from 2.92.10 to 2.93.00 (open source Apache 2.0 license)
Bug Fixes:
Version 6.8.1, 2020-04-04
Bug Fixes:
Also, this release updates the QP/C++ ports and examples for workstations (Windows and POSIX) by consistently applying the "safe" versions of services from<stdio.h> and<string.h>. The "portable" versions of these services are defined as macros in thesafe_std.h header file and include the following services:
- MEMMOVE_S() ->memmove_s()
- STRCPY_S() ->strcpy_s()
- STRCPY_S() ->strcpy_s()
- STRCAT_S() ->strcat_s()
- SNPRINTF_S() ->_snprintf_s()
- PRINTF_S() ->printf_s()
- FPRINTF_S() ->fprintf_s()
- FREAD_S() ->fread_s()
- FOPEN_S() ->fopen_s()
- LOCALTIME_S() ->localtime_s()
These "safe" functions are mapped to the best approximation of these services available on a given platform. For example,STRCPY_S() is mapped tostrcpy_s() on Windows andstrcpy() on POSIX (Linux/MacOS/etc.).
Finally, this release improves the comments in the QF::stop() function. The comments now make it very clear that after calling QF_stop() the application must terminate and cannot continue. In particular, QF::stop() isnot intended to be followed by a call to QF::init() to "resurrect" the application. The previous comments apparently were confusing and some developers attempted to "restart" a running application, which led to system crashes.
Version 6.8.0, 2020-03-21
This release updates the QP/C++ source code from C++98/03 to theC++11 Standard. Specifically, the following C++11 features are now used.
Source Code Changes:
- C++11 function specifiers:noexcept,override,=delete
- constexpr for compile-time constants
- typed enums
- using instead oftypedef
- new style initializers{...}
- #include <cstdint> instead of<stdint.h>
- std::uint8_t, etc. for integer types defined in<cstdint>
- nullptr instead ofstatic_cast<void *>(0) or similar
- Note
- This switch to the newer C++11 Standard requires compiling QP/C++ and the application-level code according to C++11 or newer standards.
Also, the PC-Lint-Plus "port" (qpcpp\ports\lint-plus) in this QP/C++ release has been changed to check theAUTOSAR:C++14 rules, instead of MISRA:C++08. This is because the older MISRA:C++ rule checker assumes C++03 standard, which is inadequate for checking C++11 or newer C++ standards.
Other changes in QP/C++ source code:
- Deprecated macros for coding state machines the "old" way with theme-> pointer, such asQ_TRAN(),Q_SUPER(),QM_TRAN(),QM_SUPER(), etc. These macros have been moved to the backward-compatibility layer in theqpcpp.hpp header file (compatibility before version 6.8.0).
- Note
- The only recommended way of coding state machines with QP/C++ is the "new" method, where state-handler functions are members of the state machine class, so theme-> pointer is not needed (see alsoVersion 6.5.0, 2019-03-30).
- Fixed inconsistencies betweenQP API declarations in the.hpp files and definitions in the.cpp files, such as different parameter names in declarations and definitions.
- Removed a lot of excessive type casting of compile-time constants, such asstatic_cast<uint8_t>(0), which is now coded simply as0U
- IntroducedQ_NORETURN macro forQ_onAssert(), which can (if defined) inform the compiler thatQ_onAssert() does not return. This can potentially improve the code generation and can improve diagnostics generated by the compiler.
- Moved many QS facilities for internal use fromqs.hpp toqs_pkg.hpp. These are mostly facilities related to internal QS implementation as well as pre-defined QS trace records, which are only used insideQP and are not needed in the QP Applications.
- Removed all pre-conditions fromQP::QActiveDummy::start() function inqutest.cpp. This is to allow starting dummy AOs the exact same way as the real counterparts (e.g., with stack storage, whichQP::QActiveDummy does not really need).
Updated 3rd-Party Components:
- FreeRTOS from 10.2.1 to 10.3.0
- SEGGER embOS from 4.34.1 to 5.06.1
- SEGGER emWin from 5.32 to 6.10
- Removed TI-RTOS
Updated Examples:
Converted all the examples for ARM-MDK from compiler-5 (RVDS) to the new ARM Compiler-6 (ARM-clang). The examples for ARM Compiler-6 are located in thearmclang sub-directories.
- Note
- The older ARM Compiler-5 does not support the C++11 standard, and consequently it cannot compile QP/C++ code.
- Removed the ports and examples for ARM Compiler-5.
- Removed support for the TI-RTOS, both in the ports and examples.
Bugs Fixes:
Version 6.7.0, 2019-12-30
The main purpose of this release is providing support for thePC-Lint-Plus static analysis tool and improved compliance with MISRA-C++:2008 (see also feature request#169). Specifically, the QP/C++ source code and some examples have been adjusted to comply with MISRA-C++:2008 rules, with all deviations captured in the PC-Lint-Plus configuration files. These PC-Lint-Plus configuration files have been provided in the new "port" to PC-Lint-Plus in the directory qpcpp/ports/lint-plus/.
- Note
- The support for the older PC-Lint 9.x and the older MISRA-C:2004 has been dropped to avoid confusion and conflicts with the newer PC-Lint-Plus.
This release also includes the offline documentation forthis particular version of QP/C++ (in thehtml/ folder). To view the offline documentation, open the filehtml/index.html in your web browser. (The online HTML documentation for thelatest version of QP/C++ remains located at:https://www.state-machine.com/qpcpp/ )
The backwards-compatiblity layer forQP 4.x has been removed. Among others, the macros Q_ROM and Q_ROM_VAR are no longer defined.
Also, this release updates the Windows-GUI examples with the QWIN Prototyping Toolkit to work with the latest Visual Studio 2019 and specifically with the Resource Editor now available. Specifically here, the Game-GUI example (qpcpp\examples\arm-cm\game_efm32-slstk3401a\win32-gui) and the DPP-GUI example (qpcpp\examples\arm-cm\dpp_efm32-slstk3401a\win32-gui) have been updated to build with the Visual Studio 2019.
Bugs Fixes:
Version 6.6.0, 2019-10-31
The main purpose of this release is the change in distribution of the QP/C++ framework, which is now bundled together with the other QP Frameworks (QP/C and QP-nano) as well as QM, and the QTools collection into "QP-bundle". This "QP-bundle" provides a single, streamlined and simplified download and installation of all QP Frameworks and all the accompanying tools.
This release brings also the following changes:
- changed all C++ header file names from "*.h" to "*.hpp"
- Note
- The change means that the QP/C++ applications now should include "qpcpp.hpp" instead of "qpcpp.h". The latter file is still provided for backwards-compatibility, but it will be phased out in the future.
- changed inclusion guards in header files from "..._h" to "..._HPP" in all uppercase
- removed "//" (double slash) from all comments for compliance with the MISRA-C:2012 required Rule 3.1. (The "//" sequence was used in the URLs, such as "http://...").
- changed the type of the last parameter in QHsm::init() from "QP::QEvt const *" to "void const *"
- shiftedQP::QS_USER from 70 to 100 and made the freed-up records reserved
- changed the QS_Ux_RECORDS groups to partition user records 100-124.
- removed Tcl test scripts from QUTest examples
- fixedbug#248 Compilation error for the Q_EVT_CTOR configuration with QXK
Version 6.5.1, 2019-05-24
This release fixes the following bugs in the QP/C++ code supportingQUTest unit testing:
Also, this release extends theMakefiles in theqpcpp\examples\qutest directory to provide thedebug target. Also, this release extends theqpcpp\examples\qutest\blinky example with projects to build/debug this example with Visual C++ (on the host) and with ARM-KEIL on embedded target (EK-TM4C123).
Finally, this release adds ports and examples for PIC32 with MPLAB-X/XC32 toolchain.
Version 6.5.0, 2019-03-30
This release brings new, much more natural and convenient way of implementing state machines in QP/C++, in which state-handler functions are regularmembers of the state machine class. This means that state-handlers have direct access to all class members via the implicitthis pointer,without the need to use the "me->" pointer.
- Note
- The previous "me-> pointer" state machine implementation style is still supported in QP/C++ for backwards compatibility with the existing code, but it isnot recommended for new designs.
- Remarks
- This "no me-> pointer" state machine implementation is supported in theQM model-based design tool starting fromQM 4.5.0.
This release comes with several models forQM 4.5.0, which demonstrate how to use this state-machine implementation style from QM.
Additionally, this release changes the APIQTimeEvt::ctr() to QP::QTimeEvt::currCtr(). This is to avoid name shadowing with thectr variables, which is not compliant with MISRA.
Additionally, the examples forcalc1 andcalc1_sub (with QM 4.5.0 models) have been extended to properly handle the operator precedence (multiplication and division have higher precedence than addition and subtraction).
Finally, this release adds the examplestart-stop located in the directoryqpcpp/examples/freertos/arm-cm/start-stop_nucleo-h743zi/ for theQP port to FreeRTOS, which demonstrates how to dynamically start and stop active objects multiple times during the lifetime of the application. (NOTE: Starting and stopping active objects dynamically is generally not recommended, but the example has been requested by a commercial customer.)
Version 6.4.0, 2019-02-10
This release brings the following changes:
- removed QActive::stop()
- modified examples for ThreadX to define BSP_TICKS_PER_SEC as TX_TIMER_TICKS_PER_SECOND instead of a hardcoded value
- modified examples for uC/OS-II to define BSP_TICKS_PER_SEC as OS_TICKS_PER_SEC instead of a hardcoded value
- modified qassert.h to work correctly when assertions are disabled with #Q_NASSERT and also updated the QP/C++ source code to build correctly without assertions
- improved the QXK semaphores to handle correctly the maximum number of tokens
- reduced the size of QPSet in caseQF_MAX_ACTIVE does not exceed 8 or 16.
- improved performance of the QF_qlog2() algorithm whenQF_MAX_ACTIVE does not exceed 8 or 16.
- modified Makefiles for workstations (Windows and POSIX) to use compiler options -std=c99 for C and -std=c++11 for C++ as well as -pedantic option.
- fixed examples for MSP430 with CCS and added QUTest support for MSP430.
Version 6.3.8, 2018-12-31
The main purpose of this release is the update theMakefiles that use theGNU-ARM Embedded Toolchain to match the recent update inQTools for Windows 6.3.8. Specifically, allMakefiles in theexamples directory have been updated to use the GNU-ARM toolchain located inqtools\gnu_arm-none-eabi and use the tools prefixarm-none-eabi-.
- Note
- TheMakefiles that use the GNU-ARM included in this release requireQTools for Windows version 6.3.8 or newer and willNOT work with the older QTools collection.
Version 6.3.7, 2018-11-20
The main goal of this release is to provide Python test scripts that match the newly re-designed Python support for theQUTest unit testing harness (see QTools6.3.7). Specifically, the Python tests scripts (*.py files) in theqpcpp/examples/qutest directory) have been all upgraded to the new syntax and format. Also, all the makefiles in that directory have been modified to execute Python test scripts by default, and Tcl test scripts only when the argumentSCRIPTS=tcl is specified.
- Note
- The new scripting interfacequtest.py is now the primary supported QUTest scripting interface. The older interfaces, such as TCL ("qutest.tcl") and "qspypy" are consideredobsolete and arenot recommended for writing new test scripts.
The second change in this release is updating theQP ports to Win32 and POSIX to eliminate the obsolete functiongethostbyname() and replacing it withgetaddrinfo(). This change has ripple effects on Windows, because it requires linking with "ws2_32" library, instead of "wsock2". All affectedMakefiles in theqpcpp\examples directory have been updated to link the newer "ws2_32" library.
Finally, this release updates the internal implementation of QXK functionQXThread::post_() for software tracing and testing with QUTest.
Version 6.3.6, 2018-10-20
This release brings important changes and improvements to the unit-testing support forQUTest. Specifically, a new "dummy" active object classQP::QActiveDummy for testing has been added. Instances of this "dummy" AO can be now used as test-doubles for active objects that are recipients of events directly posted by the active object under test (AOUT). This, in turn, eliminates the need to alter the existing event-posting implementation, so that more of the actualQP code can be used in theQP test-stub (qutest.c).
- Note
- The QUTest projects that are builtQP from sources need to include theqf_time.cpp file.
As a consequence of the changes in theQUTest support, theQUTest examples have been re-designed and improved. Here, the most important changes include the new code organization, which reflects the customary separation of the code-under-test (CUT) from the code for testing. Also, the tests based on the"TDD book" by James Grenning have been replaced with fully functional tests based on theUnity testing framework. This is to directly compare the traditional approach (Unity) with QUTest.
The next change related to unit testing is addingQP::QS_RX_QUERY_CURR facility to QS-RX (software tracing input channel) and the replyQP::QS_QUERY_DATA to the QS output channel. These two extensions allow you to query the status of the "current object" inside the target. The most important example is querying the current state-machine object (QP::SM_OBJ), which returns thecurrent state.
- Note
- The new "query" facilities in QP/C++ match the latest additions to theQSPY host application.
Also this release addsQS dictionary generation for all registered event pools. The generated object dictionaries areEvtPool1 for pool-1,EvtPool2 for pool-2, etc.
- Note
- Applications no longer need to generate QS object dictionaries for the event pool storage buffers, such assmlPoolSto[], etc.
Another big change in this release is re-designing of the examples for workstations (previouslywin32,win32-qv,posix andposix-qv). All these types of examples have been consolidated in the exampes/workstation folder, where the providedMakefiles have been extended to be cross-platform so that they work on Windows, Linux, and MacOS without changes.
To facilitate the creation of truly portable, cross-platform examples, the existing QP ports to Windows/POSIX have been augmented with abstractions for portable console access. Also, theQS software tracing support via TCP/IP has been now added to the ports themselves. This means that applications no longer need to repeat the code for QS callbacks in the BSP implementation.
Finally, this release fixes a bug in thePOSIX-QV port, where the internal condition variableQV_condVar_ has not been initialized.
Version 6.3.4, 2018-08-10
This release adds new APIQP::QTimeEvt::wasDisarmed() for checking the status of aQP::QTimeEvt object after it has been disarmed. Specifically, the status of the last call toQP::QTimeEvt::disarm() is kept inside the time event object and can be subsequently checked with theQP::QTimeEvt::wasDisarmed() API. This new function is designed to be used directly as a guard condition on the timeout event, as described in thePSiCC2 book, Section 7.7.3 "Arming and Disarming a Time Event" on page 359. TheQP::QTimeEvt::wasDisarmed() has a side effect of setting the "was disabled" status, so the guard evaluates to 'true' the next time it is checked.
Version 6.3.3a, 2018-07-16
This release adds Python test scripts to the QUTest examples (folderqpcpp/examples/qutest). Specifically, the makefiles have been augmented to accept symbolSCRIPT=py, in which case the Python test scripts (*.py) are used instead of the default Tcl test scripts (*.tcl).
- Remarks
- This release does not change any QP/C++ APIs, QP/C++ implementation, ports, or other examples.
Version 6.3.3, 2018-06-22
This release fixes the following bugs:
Also, this release demonstrates the new features of QM 4.3.0 in several example models (qpcpp/examples/ directory).
Finally, this release updates3rd_party/CMSIS/Include to the latest version from GitHub.
Version 6.3.2, 2018-06-20
This release fixes the following bugs:
Also, this release improves the QUTest DPP example (directoryqpcpp/examples/qutest/dpp) by demonstrating the proper use ofQS_TEST_PAUSE() and the corresponding test scripts. This example now matches theQUTest documentation of this feature.
Finally, this release modifies the QP/C++ ports to POSIX and POSIX-QV by allowing to configure the p-thread priority of the ticker thread. This is achieved by adding atickPrio parameter to theQF_setTickRate() function. (NOTE this modification will require changing existing QP Applications for POSIX or POSIX-QV that callQF_setTickRate().
Version 6.3.1, 2018-05-24
This release migrates theQUTest examples toQM 4.2.1, which now can generateQS_FUN_DICTIONARY() records automatically. This release also adds a generic, simple blinky example for QUTest located inexamples/qutest/blinky. Also, this release fixes theQF_INT_DISABLE() /QF_INT_ENABLE() macros in the QUTest ports to use theQP namespace. Without this fix, the code fails to compile when the directive "using namespace QP" is not used.
Also, this release adds the missing QS macroQS_SIG() to produce symbolic signal output fromapplication specific QS records.
Finally, this release adjusts the code inqs_rx.cpp to use QF_EVT_REF_CTR_INC_() instead of accessing the event's reference counter directly. This direct access fails in case, when event constructors are configured (Q_EVT_CTOR is defined). In that case, theQP::QEvt class protects the reference counter, so it cannot be accessed directly. This option is currently used only in the QP/C++ port to Qt.
Version 6.3.0, 2018-05-10
The main purpose of this release is fixing the sub-machine support in the QP/Spy build configuration. Specifically, this release fixes the following bug:
- Attention
- This release matchesQM 4.2.0.
Additionally, the release contains some re-factoring of the QS-RX input channel.
Version 6.2.0, 2018-03-16
The main purpose of this release is extednding the functionality of theQUTest unit testing for QP/C++ applications. Specifically, this release adds support for testing ofself-posting of events in active objects, which is an essential element in theReminder andDeferred Event design patterns. To implement this new feature, the QS-RX (QS receive channel) has been extended by a small scheduler that processes all secondary events gnenerated by dispatching, posting, or publishing events (only active when theQ_UTEST macro is defined). Also, the implementation of the target resident QUTest components (filesrc/qs/qutest.cpp andsrc/qf/qf_actq.cpp) have been modified to allow posting of events during unit testing.
Additionally, the release adds standard QS trace records (theqs.h header file) for event deferring and recalling (::QS_QF_ACTIVE_DEFER andQP::QS_QF_ACTIVE_RECALL) as well as recall-attempt (::QS_QF_ACTIVE_RECALL_ATTEMPT). Also standard QS trace records have been added for creating/deleting new event references (::QS_QF_NEW_REF andQP::QS_QF_DELETE_REF, respectively). To make room for these new records, the following rarely-used records have been removed: QS_QF_ACTIVE_ADD, QS_QF_ACTIVE_REMOVE, QS_QF_EQUEUE_INIT, and QS_QF_MPOOL_INIT. The global filter settings in the QS_filterOn() and QS_filterOff() functions have been updated to the augmented and re-organized QS trace records.
- Note
- Because of the changes in the standard QS trace recods, this release requires the matchingQSPY 6.2.0 or later. Also, because of the changes this release might break some existing QUTest unit test scripts, which need to be re-adjusted to the new trace records.
Additionally, this release improves support for tracing and unit-testing embedded POSIX targets, such as embedded Linux, or OSes/RTOSes with the POSIX compatibility layer. Specifically, the POSIX ports (qpcpp/ports/posix/ andqpcpp/ports/posix-qutest) no longer produce libraries. Instead all examples for POSIX (qpcpp/examples/posix/ andqpcpp/ports/qutest) build the QP/C framework directly from the sources, which promotes consisentcy in the toolchain and options used. For unit testing,posix.mak makefiles have been added for projectsqpcpp/examples/qutest/dpp andqpcpp/examples/qutest/self_test. These makefiles support remote testing of embedded POSIX targets over TCP/IP, where the POSIX target runs only the test fixture, but the host (e.g., Windows host) executes both the QSPY host application and runs the QUTest scripts. The previous makefiles for POSIX have been renamed toposix_host.mak, because they are intended to use POSIX as ahost, as opposed to atarget.
Also, this release adds new QUTest exampes, which illustrate:
- event deferral (qpcpp/examples/qutest/defer)
- dispatching/posting events with parameters (qpcpp/examples/qutest/evt_par).
Additionally, this release updates the QP/C++ ports to win32-qv and posix-qv to allow a "tickless" mode, where the "tickerThread" is not created. This mode is set by configuring the system clock tick rate to 0 (QF_setTickRate(0)).
Finally, this release phases out theqp_port.h header file. If any of your projects still includes this file, please replace it with the qpc.h header file.
Version 6.1.1, 2018-02-18
The main purpose of this release is adding the context-switch callbacks to the preemptive QK and QXK kernels. The QK_onContextSw() and QXK_onContextSw() callback functions provide a mechanism to perform additional custom operations when QK/QXK switches context from one thread to another. To avoid extra overhead when this functionality is not needed and for backwards-compatiblity with the existing applications, the callbacks are enabled only when the macros #QK_ON_CONTEXT_SW (for QK) and #QXK_ON_CONTEXT_SW (for QXK) are defined. These macros can be defined either directly in command-line for the compiler, or in the QK/QXK port files (qk_port.c for QK and qxk_port.c for QXK). Examples for the context-switch callbacks have been provided for for the NUCLEO-L053R8 (Cortex-M0+) and the NUCLEO-H743ZI (Cortex-M7).
Also, this release changes the ARM Cortex-M ports for the IAR-ARM toolchain in that it replaces the assembly modules with the equivalent C implementation. This change enables using the configuration macros #QK_ON_CONTEXT_SW (for QK) and QXK_ON_CONTEXT_SW (for QXK) in the ports. All existing example projects for IAR-ARM have been updated to use theq(x)k_port.c files instead ofq(x)k_port.s files.
Also, this release adds new project files for the Atollic TRUEstudio for STM32. The TRUEstudio projects (Eclipse) have been added for the NUCLEO-L053R8 (Cortex-M0+) and the NUCLEO-H743ZI (Cortex-M7).
Also, this release updates the CMSIS to version 5.3.0 (seeqpcpp/3rd_party/CMSIS
Finally, this release fixes the following bug:
- bug#203 QXK: precondition in QXSemaphore::wait() incorrectly handles the scheduler lock"</a>@section qpcpp_6_1_0 Version 6.1.0, 2018-02-04The main purpose of this release is adding the support for the <a href="https://developer.arm.com/products/software-development-tools/compilers/arm-compiler" ><strong>ARM Compiler 6 (ARM-Clang)</strong></a>, which is a C/C++ toolchain for ARM processors based on the modern <a href="https://clang.llvm.org/" >Clang frontend</a> and the <a href="https://llvm.org/" >LLVM framework</a>. This release adds the ARM-Clang ports and examples for all built-in kernels (QV, QK, and QXK) for the ARM Cortex-M CPU cores.This release also adds support for the STM32H7 high-performance Cortex-M7 with the <strong>double-precision FPU</strong> (FPv5-DP-D16-M). Specifically, this release provides examples for the <a href="http://www.st.com/en/evaluation-tools/nucleo-h743zi.html" >NUCLEO-H743ZI board</a> (Cortex-M7 with FPv5-DP-D16-M). The @ref arm-cm_dpp_nucleo-h743zi "examples for NUCLEO-H743ZI board" include all built-in kernels with ARM-CLANG, ARM-KEIL, GNU-ARM, and IAR-ARM. Additionally the NUCLEO-H743ZI examples also include the QP FreeRTOS with ARM-KEIL, GNU-ARM, and IAR-ARM.Also, this release changes the ARM Cortex-M ports for the GNU-ARM toolchain in that it replaces the assembly modules with the equivalent C implementation. This change enables using wider range of GNU-ARM toolchain distributions, such as GNU-ARM Linaro, which had trouble with the assembly modules, but compiles correctly the C modules. All related GNU-ARM example projects have been modified to use the new C-ports.Also, this release fixes build problems with IAR EWARM caused by the CMSIS v5.1.1, where the IAR C++ compiler failed to compile the CMSIS "mpu_armv7.h" header file. The problem was caused by the <tt>restrict</tt> keyword, which was supported by default in the IAR C compiler, but was <strong>not</strong> supported by default by the IAR C++ compiler. The fix was to add explicit compiler option <tt>--enable-restrict</tt> to all IAR projects for Cortex-M processors.Also, this release updates the existing projects for the Code Composer Studio (CCS) to CCSv7. All existing CCS projects for the EK-TM4C123GXL (TivaC LauchPad) and LaunchXL2-TMS57012 (Hercules) boards have been upgraded and tested.Also, all examples for MSP430 with CCS have been updated to CCSv7 and re-tested on the supported boards.@section qpcpp_6_0_4 Version 6.0.4, 2018-01-10The main purpose of this release is the provision of the official @ref freertos "QP/C++ port to FreeRTOS" (version 10). The QP/C++ port to FreeRTOS is completely generic and should work on any CPU supported by FreeRTOS. The port comes with the following examples (see examples/freertos/):- @ref freertos_dpp_ek-tm4c123gxl "DPP on EK-TM4C123GXL (ARM Cortex-M4F)" with ARM-KEIL, GNU-ARM and IAR-ARM toolchains.- @ref freertos_dpp_stm32f746g-disco "DPP on STM32F746G-Discovery (ARM Cortex-M7)" with ARM-KEIL, GNU-ARM and IAR-ARM toolchains.This release also replaces assembly with C implementation in the ARM-KEIL ports or the QK and QXK kernels to Cortex-M to take advantage of the <tt>__asm</tt> functions. (NOTE: this change has impact on the existing QP/C++ applications that use the ARM-KEIL toolchain and the QK or QXK kernels.)Additionally, this release modifies all IAR-ARM example projects by adding compiler option "--enable_restrict". This option is necessary to compile the CMSIS header file "mpu_armv7.h" under the IAR C++, where the "restrict" keyword is not supported by default.Additionally, this release fixes some problems with the native examples for STM32F4 and STM32F7 boards.Additionally, this release adds a generic function QP::QActive::setAttr() to set thread attributes in various QP ports to 3rd-party RTOSes. This function is then used in the @ref embos "embOS port" and the @ref uc-os2 "uC/OS-II port".Finally, this release fixes the following bug in the @ref threadx "ThreadX port":- <a href="https://sourceforge.net/p/qpc/bugs/197/" >bug#197 "Problems with scheduler locking in QP/C/C++ ports to ThreadX"</a>@section qpcpp_6_0_3 Version 6.0.3, 2017-12-12Changes since version 6.0.1:- fixed <a href="https://sourceforge.net/p/qpc/bugs/193/" >bug#193 "QXK: context switch from extended to basic thread fails"</a>- replaced attributes of QP::QActive and QP::QEQueue classes from type <tt>uint_fastX_t</tt> to <tt>uintX_t</tt>. For the ARM Cortex-M port, these changes reduce the memory footprint of each QP::QActive instance from 50 to 38 bytes (25% improvement).- improved the performance of the ARM Cortex-M0/M0+ ports, which do not support the CLZ (count leading zeros) instruction. All QP ports to Cortex-M0/M0+ (qv, qk and qxk) now contain hand-optimized assembly implementation of the LOG2 (log-base-2) function. The implementation executes only in 14 machine instructions and uses only 16-byte look-up-table (LUT). This replaces LOG2 implementation based on a 256-byte LUT.- changed the interrupt disabling policy in ARM Cortex-M ports back to "unconditional interrupt disabling", which is simpler and faster than "saving-and-restoring interrupt status".- added a port to ARM Cortex-M with the LLVM compiler (currently only for the dual-mode QXK kernel). Unlike the other ARM Cortex-M ports, the port to LLVM uses the "saving-and-restoring interrupt status" interrupt disabling policy (explicit request from a commercial customer).- removed ARM Cortex-M port and examples for the TI-ARM compiler. (Projects for the TI CCS can use the GNU-ARM toolchain and the existing GNU-ARM ports).- Added the DPP-COMP example (Dining Philosophers Problem) with the "Orthogonal Component" state pattern located in <tt>qpcpp/examples/win32/dpp-comp</tt>. This example demonstrates also a partitioned QM model into external packages for the Container (Table active object) and the Components (Philo active objects).@noteThis release does not change any of the QP/C++ APIs.@section qpcpp_6_0_1 Version 6.0.1, 2017-12-10The main focus of this release is to fix the remaining problems with transitions out of eXit-Points in sub-machines. Specifically, this release modifies the QMsm-based state machine implementation strategy (file src/qf/qep_msm.cpp to properly handle transitions from eXit-Points to Entry-Points and to History connectors in sub-machines. These changes are part of fixing the following bugs reported for QM:- <a href="https://sourceforge.net/p/qpc/bugs/190/" >bug#190 "Exit-Point segment targeting History doesn't work
- bug#189 "Exit-Point segment targeting an Entry-Point to sub-machine state doesn't work"
Additionally, this release fixes the following bug in transitions to "shallow history":
The bug#191 is fixed by modifying the function QMsm::childStateObj() inqep_msm.cpp to return the parent state in the corner case when the current state is the parent state.
- Note
- This QP/C++ 6.0.1 release is the minimum version required in the upcoming QM 4.1.0. This is because QM 4.1.0 assumes the modified QMsm-state machine implementation strategy in order to properly handle the various transitions out of eXit-Points in sub-machine states.
Additionally, this release changes the QXK implementation still related to thebug#186 "QXK: Extended thread context switch causes assertion in PendSV_Handler". Specifically, the case of context switching away and back to the same thread (which can arise under specific interrupt preemption scenarios) is now handled as a simple return from PendSV. The QXK scheduler has been modified to set the "next" thread pointer to NULL when it detects switching back to the "current" thread.
Version 6.0.0, 2017-10-13
This release fixes two bugs found in the QXK kernel:
- bug#185 "QXK: PendSV_Handler uses inconsistent stack frames for saving and restoring AO for Cortex-M0(+)"
- bug#186 "QXK: Extended thread context switch causes assertion in PendSV_Handler"
Additionally, this release includes a workaround for abug indetified in the GNU-ARM toolset. This problem affected the ARMv6-M architecture (Cortex-M0/M0+/M1) and manifested itself in generation of incorrect code for theQP critical section at certain gcc optimization levels (such as -O). This bug was first discovered and filed asbug#184. The bug affected the GNU-ARM ports to all built-in kernels QV, QK, and QXK.
- Note
- This release no longer contains the directoryqpcpp/source, which was scheduled to be phased out in QP5. In QP6 the source code is found only in theqpcpp/src directory.
Version 5.9.9, 2017-09-29
This release implements the feature request#132 "Extend the QXK mutex to support also simple operation without the priority-ceiling protocol".
- Note
- This release is completely backwards-compatible with theprevious QP/C++ release 5.9.8.
Specifically, theQP::QXMutex class has been extended as follows:
- a mutex initialized with ceiling==0 (seeQP::QXMutex::init()) means "no ceiling", so such mutex will NOT use the priority-ceiling protocol.
- in this case the mutex will NOT require a unique priority level
- in this case the mutex will not change (boost) the priority of the holding thread in theQP::QXMutex::lock() operation.
- in this case the mutex will still support nesting of locks (as before), up to 255 levels of nesting.
- when initialized withceiling>0,QP::QXMutex WILL use the priority-ceiling protocol, as before. It will require that the ceiling priority be unique and not used by any other thread or mutex. In other words, the previous functionality remains unchanged.
Version 5.9.8, 2017-09-15
This release fixes the QXK kernelbug#182 " Inconsistent QXThread::post_() behavior with respect to the 'margin' parameter".
Also, the pre-condition assertion in the function QF::newRef_() (filesrc/qf/qf_dyn.cpp) has been modified to allow creating event references only for dynamic events(e->poolId_ == 0).
Modified ARM Cortex-M examples with the GNU-ARM toolset to be compatible with C++ RTTI and C++ Exception handling, as follows:
- removed definitions of_init() and_fini() from the GNU-ARM startup code for all supported boards in the3rd_party directory
- added the empty definitions of_init() and_fini() tomini_cpp.cpp in the3rd_party/gnu_cpp directory
- Modified all GNU-ARM linker scripts (.ld files) to add the following symbols:
__exidx_start = .; .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } >RAM __exidx_end = .;Provided C++ example with RTTI and Exception handling in the directory:examples/arm-cm/dpp_efm32-slstk3401a/qxk/gnu_with-rtti
Version 5.9.7, 2017-08-18
The main focus of this release are new requested features for the dual-mode QXK kernel:
Additionally, this release adds also the non-blocking QXSemaphore::tryWait() operation.
In the process of re-implementing theQP::QXMutex, the previouis non-blocking priority ceiling mutex has been replaced with an equivalent selective QXK scheduler locking up to the specified ceiling priority. Specifically, this feature has been implemented with two new operations QXK::schedLock() and QXK::schedUnlock().
For consistency, the non-blocking mutex of the QK kernel has been also replaced by the operations QK::schedLock() and QK::schedUnlock().
All related QXK and QK examples have been updated to use the selective scheduler locking instead of the mutex. The new blocking QXK mutex has been demonstrated in the following updated examples:
- arm-cm_dpp_efm32-slstk3401a
- arm-cm_dpp_ek-tm4c123gxl
- Attention
- The changes toQP::QXMutex in QXK and the now obsolete QMutex in QKbreak backwards-compatiblity with the existing code that relies these features. In the existing code, the mutexes should be replaced with selective scheduler locking.
- Also, the blocking APIs with timeouts, such as QXMutex::lock(), QXSemaphore::wait(), QXThread::delay(), and QXThread::queueGet() no longer require the lasttickRate parameter. This alsobreaks backward-compatiblity with the existing code that uses these operations.
This release also updates CMSIS to version 5.1.0 (3rd_party/CMSIS).
This release also adds theAPI Reference section to the QP/C++ documentation.
Version 5.9.6, 2017-08-04
The main focus of this release are improvements to the "dual-mode" QXK kernel. Specifically, this release implements thefeatrue request #128 "QP Semaphore Max Value Setting" for QXK. This feature changes the QXK functionQP::QXSemaphore::init(), which now takes additional parametercount. This parameter specifies the maximum allowed count for the semaphore (e.g., count of 1 makes the semaphore a binary-semaphore).
- Note
- This change does NOT break any existing code, because the additional parameter has a default value (0xFFFF).
This release also fixes a bug inside the assertions inQP::QXSemaphore::signal(), where the check for the extended-thread is performed.
Also, this release adds assertions to the QXK code, which ensure that any available blocking calls can only be made from extended-threads and not from basic-threads (active objects) or ISRs.
Also, this release adds protection in the IRQ priorities initialization in QK/QV/QXK for ARM Cortex-M3/M4/M7, so that the number of IRQs is extracted from bits 0-2 of the ICTR register (INTLINESNUM).
Finally, this release consistently changes all example projects (for all toolchains) to use thesrc directory for QP/C++ source code, instead of thesource directory. The source/ directory is now truly obsolete, but is still provided in this release for backwards compatibility with user projects.
Version 5.9.5, 2017-07-20
This release fixes the following bugs:
- bug#178 "GNU-ARM compiler reports "Error: unaligned opcodes..." in startup code for QP/C/C++/nano examples". The bug fix entails modifying the startup code for the GNU-ARM compiler in the3rd_party directory. Specifically, the proper alignment directives have been added to the inline assembly in the exception handlers.
- bug#179 "Assertion ID 210 fires when signaling on a QXK semaphore"
This release fixes the naming problem of the startup code for the STM32F7-Discovery board (in the3rd_party/stm32f7-discovery/gnu/ and arm/ directories), where the startup code was renamed fromstartup_stm32f4xx.c/s tostartup_stm32f746xx.c/s. The change has been also made in the example projects for the STM32F7-Discovery board (for ARM-KEIL and GNU-ARM toolsets).
Finally, this release modifies the example code (mostlybsp.cpp files) so that the Q_DEFINE_THIS_FILE() macro is used consistentlyoutside a namespace at the top of the file scope.
Version 5.9.4, 2017-07-07
This release adds Thread-Local Storage (TLS) feature for the dual-mode QXK kernel (see qxk_tls).
Version 5.9.3, 2017-06-19
This release implements the feature request#126 "Allow non-assertingevent allocation for zero-margin allocations". Specifically, callingQ_NEW_X() orQP::QActive::post_() with themargin argument of zero will no longer assert if the allocation/posting fails.
Version 5.9.2, 2017-06-05
This release adapts the Makefiles for GNU-ARM to the new location of the GNU-ARM toolset, which is now included in the QTools Collection (v 5.9.1) for Windows.
Also, this release improves the flash loading scripts for the JLink hardware debugger (for GNU-ARM projects for the EFM32-SLSTK3401A board). Specifically, the JLink configuration file for flash download is generated by the flash batch script based on the command-line parameter (the binary file to load into the flash). This eliminates the need to manually maintain JLink configuration files.
Also, this release adds bi-directional QP/Spy to the embOS example project for the STM32F4-Discovery board.
Also, this release adds GNU-ARM port to uC/OS-II and adds GNU-ARM example project for the EK-TM4C123GXL board.
Finally, this release implements the feature request #125 "Include QPCDemo application for STM32F4 processor without RTOS" (seehttps://sourceforge.net/p/qpc/feature-requests/125/ ). The DPP demo for the STM32F4-Discovery board has been added in the directory: qpc/examples/arm-cm/dpp_stm32f4-discovery . This demo includes QV, QK and QXK kernels and ARM-Keil, GNU-ARM, and IAR-ARM toolsets. The demos support bi-directional QP/Spy.
Version 5.9.1, 2017-05-26
This release fixes the following bug:
- Note
- The bug only affects sub-machines and does not affect any other aspects of QMsm-style state machines.
Also, this release changes the organization of the QP/C++ source code to make it more friendly for the Eclipse CDT, as proposed in thefeature request #123 "Eclipse-friendly source directory structure for QP/C/C++". Specifically, the QP/C++ source code is now provided in theqpc/src/ directory with the following structure:
qpcpp/ +-source/ - existing source directory with "flat" structure | (for backwards-compatibility) +-src/ - new source directory grouped by functionality +-qf/ - core framework (QEP + QF) +-qk/ - QK kernel +-qv/ - QV kernel (only one file qv.c) +-qxk/ - QXK kernel +-qs/ - QS software tracing +-qf_pkg.h +-qs_pkg.h +-qxk_pkg.h
- Note
- The originalqpcpp/source directory is still provided for backwards compatibility with the existing QP/C projects. This directory will be phased out in the future QP/C++ releases. Please use the new source code structure provided in theqpcpp/src directory.
Version 5.9.0, 2017-05-19
The main purpose of this milestone QP/C++ release is to provide support for the powerfulUnit Testing Framework calledQUTest (pronouncedcutest). QUTest is the fundamental tooling for Test-Driven Development (TDD) of QP/C++ applications, which is a highly recommended best-practice. This release introduces changes in the QS-RX (receive) channel and adds several new callbacks.
- Note
- The signature of the QS::onCommand() has changed and the function now takes 3 arbitrary 32-bit parameters instead of one. This introduces backwards-incompatibility with previous code that used QS::onCommand().
This release also changes the critical section for QP/C++ ports to ARM Cortex-M in that the policy of "save and restore interrupt status" is used. This policy permits nesting of critical sections, which was requested by customers.
Additionally, this release changes the selective interrupt disabling for ARM Cortex-M3/4/7 (with the BASEPRI register) to address the hardware problem on ARM Cortex-M7 core r0p1 (ARM-EPM-064408, errata 837070). TheQP ports to ARM Cortex-M3/4/7 now implement the workaround recommended by ARM, which is to surround MSR BASEPRI with the "CPSID i"/"CPSIE i" pair. This workaround works also for Cortex-M3/M4 cores.
New ports:
- ports/win32-qutest folder contains port to QUTest for Windows
- ports/posix-qutest folder contains port to QUTest for POSIX (Linux)
- ports/arm-cm/qutest folder contains port to QUTest for ARM Cortex-M
New examples:
- examples/qutest/dpp folder contains the QUTest DPP test for various platforms (Win32, EFM32-SLSTK3401A and EK-TM4C123GXL)
- examples/qutest/qhsmtst folder contains the QUTest test for the QHsmTst state machine (structural test)
- examples/qutest/qmsmtst folder contains the QUTest test for the QMsmTst state machine (structural test)
- examples/qutest/self_test folder contains the QUTest self-test for various features of QUTest
Updates of 3rd_party software:
- the 3rd_party/CMSIS folder has been updated to CMSIS 5.0.2.
- the 3rd_party/embOS folder has been updated to embOS 4.34.1
Finally, this release fixes the following bugs:
- bug#162 "QF critical sections require modification for M7 core"
Version 5.8.2, 2017-02-08
This release adds examples for the ARM Cortex-M7 CPU. Specifically, the release contains the standardDining Philosophers Problem (DPP) examples for the STM32F746G-Discovery board, all built-in kernels (QV, QK, and QXK), and ARM-KEIL, IAR EWARM, GNU-ARM toolsets.
To provide examples for STM32F746G-Discovery board, the release now provides the folder3rd_party/stm32f7-discovery with the support code for the STM32F7xx MCUs, which contains parts of STM32CubeF7 library.
Also, the3rd_party/CMSIS folder now provides the new CMSIS V5.0.1.
Also, the file3rd_party/gnu_cpp/mini_cpp.cpp has been updated to provide compatibility with the latest GNU-ARM (gcc 6.2.0).
Finally, this release fixes the following bugs:
- bug#159 QP/C/C++ Win32 ports don't work on all x86 CPUs
- bug#157 In QPC ucosii port, conversion of AO's priority to OS task priority is incorrect.
- bug#152 Typo (qpcpp/ports/arm7-9/qk/gnu/qk_port.s:42) prevents compilation
- bug#151 QTicker compile error when #Q_EVT_CTOR is defined
- bug#154 qspy.c parses history transitions incorrectly
Version 5.8.1, 2016-12-16
This release is in response to a recent finding that manyQP users of the ports to ARM Cortex-M3/M4 forget to explicitly set their interrupt priorities, as described in the AppNote"Setting ARM Cortex-M Interrupt Priorities in QP 5.x".
Specifically, this release improves safety ofQP ports to ARM Cortex-M3/M4, by initializing the interrupt priorities to a safe default in a generic, portable way. ThisQP port includes such a fix for QV/QK/QXK ports to ARM Cortex-M3/M4.
Additionally, this release introduces the newQP::QTicker class, which is an efficient active object specialized to process QF system clock tick at a specified tick frequency [0..QF_MAX_TICK_RATE]. Placing system clock tick processing in an active object allows you to remove the non-deterministicTICK_X() processing from the interrupt level and move it into the thread-level, where you can prioritize it as low as you wish.
Changes in detail:
- modified the QV, QK, and QXK source code to call QV_init(), QK_init(), and QXK_init(), respectively.
- modified the ARM Cortex-M ports of QV, QK, and QXK to initialize priorities all exceptions and IRQs to the safe value QF_BASEPRI.
- Note
- The QV port now has a newqv_port.cpp module that needs to be added to the build.
- added declaration of theQP::QTicker class to qf.h
- added implementation of theQP::QTicker class toqf_actq.cpp
- modified the following examples to demonstrate the use of theQP::QTicker:
- qpcpp/examples/arm-cm/dpp_efm32-slstk3401a/qk
- qpcpp/examples/arm-cm/game_efm32-slstk3401a/qv
- qpcpp/examples/arm-cm/game_efm32-slstk3401a/qk
- added the header filecmsis_ccs.h to qpcpp/3rd_party/CMSIS/Include directory (used in the examples for the Code Composer Studio). The file has been dropped during the upgrade to CMSIS 5.0.1, because it is not part of the standard distribution.
Version 5.8.0, 2016-11-30
The main purpose of this milestone QP/C++ release is to finally provide the baseline framework fully compatible with the upcoming QM 4.0.0.
This release changes the class hierarchy so thatQP::QHsm becomes the base class ofQP::QMsm andQP::QActive. Also,QP::QActive becomes the base class ofQP::QMActive, which reverses the changes introduced in version 4.1.
The modified class hierarchy better reflects the fact thatQP::QHsm state machine implementation strategy is simpler and supports less functionality than the more advancedQP::QMsm strategy. For example, only theQP::QMsm class fully supports sub-machines and sub-machine states that are the main feature of QM 4.x. This clean progression of supported functionality from subclasses to superclasses allows QM to easier check and enforce that advanced features are not generated for subclasses that don't have the required capabilities. (With previous class hierarchy withQP::QMsm as the base class all subclasses, includingQP::QHsm, would technically inherit the advanced functionality, which is not the case).
- Note
- The changes in QP/C++ 5.8.0 might occasionally require changing existing QP/C++ applications by changing the type of pointers toQP::QMsm with pointers toQP::QHsm or pointers toQP::QMActive withQP::QActive, because of the reverse superclass-subclass relationship between these classes.
Also, this release changes the implementation of the QV, QK, and QXK kernels in that the ready-set representing active threads is cleared onlyafter completion of the RTC-step, not when the last event is removed from the corresponding event queue. In case of the QXK kernel this change fixes the high-prioritybug#147. But even in case of the QV and QK kernels, where this behavior didn't lead to any bugs, the policy better reflects the semantics of the ready-set.
This release also updates the CMSIS interface included in the 3rd_party/CMSIS folder to the latest CMSIS-5.
All examples and QM models have been updated to the new upcoming QM 4.0.0. All these models require QM 4.x.
Finally, the complete list of bugs fixed in this release is as follows:
- bug#147 "QXK: PendSV_error is triggered on special conditions"
- bug#144 "Obsolete Win32 API in qwin_gui.c"
- bug#124 "Windows port now cause memory leakage"
Version 5.7.4, 2016-11-04
This release fixes the following bugs:
Version 5.7.3, 2016-10-07
This release addsQP ports to the TI-RTOS kernel (SYS/BIOS) with TI-CCS and IAR EWARM toolsets. Examples are provided for the EK-TM4C123GXL (TivaC LaunchPad) in the directory:
qpcpp/examples/ti-rtos/arm-cm/dpp_ek-tm4c123gxl
NOTE: The examples require a separate installation of the TI-RTOS (file tirtos_tivac_setupwin32_2_16_01_14.exe)
Also, this release fixes the following bugs:
- bug#140 (PendSV_Handler() exception stacked PC not halfword aligned).
- bug#142 (PendSV_restore_ex may not be able to enable interrupt before returning to task).
Version 5.7.2, 2016-09-30
This is the first production release of the "dual-mode" QXK kernel. "Dual-mode" QXK means that QXK supports both basic-threads (BC1 class from the OSEK/VDX RTOS specification) as well as extended-threads (EC1 class from the OSEK/VDX RTOS specification. In other words, QXK executes active objects (basic threads) like the QK kernel using the single stack (Main Stack on ARM Cortex-M), but can also execute traditionalblocking threads (extended threads).
Only the extended threads (QP::QXThread class) need their private stack spaces and the overhead of the full context switch. The basic threads (QP::QMActive andQP::QActive classes) run efficiently using the main stack with much lower context switch overhead.
The QXK examples have been updated for more thorough demonstration of the QXK features. The QXK examples are available in the following directories: dpp_efm32-slstk3401a, dpp_ek-tm4c123gxl, and dpp_nucleo-l053r8.
This release also changes the internal QK implementation to match the terminology applied in the QXK kernel (e.g., QK_sched_() has been renamed to QK_activate_() and QK_schedPrio_() to QK_sched_()). These changes fall into the category of refactoring and have no impact on the API or performance.
Finally, this release improves the implementation of scheduler locking in publish-subscribe event delivery.
Version 5.7.0, 2016-08-31
This release adds support for sub-machines and sub-machine states for reusing pieces of state machines (an advanced UML concept) to the QMsm-state machine implementation strategy. This feature is to match the upcoming QM 4.0.0.
Also, this release adds support for the ARM Cortex-R processor. Specifically, the release contains a generic port to ARM Cortex-R with the IAR and TI-CCS toolsets and examples for the TI Hercules TMS570LS12x safety MCU (LAUNCHPADXL2-TMS57012).
Also, this release changes once more the QK port to ARM Cortex-M, to reduce the interrupt latecy. This has been achieved by shortening the critical section in the PendSV exception. Also, this QK port to Cortex-M no longer uses the NMI exception.
Also, this release changes slightly the QXK port to ARM Cortex-M, where again the critical section in PendSV has been slightly shortened.
Finally, this release replaces all absolute paths with relative paths in all CCS-Eclipse project files (for TivaC, Hercules, and MSP430).
Changes in detail:
- Modifiedqep_msm.cpp to correct the support for sub-machines and sub-machine states
- Added new port to ARM Cortex-R in the directory ports/arm-cr
- Added examples for ARM Cortex-R in the directory examples/arm-cr
- Modified the ARM Cortex-M QK ports (ARM-KEIL, GNU, IAR, and TI)
- Modified the ARM Cortex-M QXK ports (ARM-KEIL, GNU, IAR, and TI)
Version 5.6.5, 2016-06-06
This release adds support for the new board: EFM32-SLSTK3401A (Pearl Gecko Starter Kit from Silicon Labs). This board replaces the Stellaris EK-LM3S811 board, which has been discontinued. (The Stellaris EK-LM3S811 board had been used in the "Fly 'n' Shoot" game example accompanying the PSiCC2 book).
This release also introduces a new version of the QWIN GUI Toolkit in the Windows prototypes for the "Fly 'n' Shoot" game and the DPP-GUI version (seehttps://www.state-machine.com/products/index#QWIN).
Additionally, this release also includes the QP/C integration with the emWin emgedded GUI from SEGGER, which is also the same product as uC/GUI distributed by Micrium (exa_emwin).
Finally, this release comes with updated project files for TI Code Composer Studio (both for ARM Cortex-M and for MSP430).
This release fixes the following bugs:
- bug#130 (POSIX port stop->start leads to reuse of sestroyed mutex).
- bug#131 (QP::QF::newRef_() increments reference counter without QF_CRIT_ENTRY_()).
Version 5.6.4, 2016-04-25
This release fixes a serious Bug #128 (https://sourceforge.net/p/qpc/bugs/128 ) in the QK port to ARM Cortex-M introduced back inQP 5.6.1
Version 5.6.3, 2016-04-12
This release fixes a serious Bug #127 (https://sourceforge.net/p/qpc/bugs/127 ) in the QK preemptive scheduler introduced inQP 5.6.2.
Version 5.6.2, 2016-03-31
The main purpose of this release is to introduceatomic event multicasting, meaning that event publishing to all subscribers is now protected from preemption. This eliminates potential for re-ordering of events under preemptive kernels (such as QK, QXK, or 3rd-party RTOSes), when events are published from low-priority AOs and some higher-priority subscribers can preempt multicasting and post/publish events of their own (before the original event is posted to all subscribers).
The atomic event multicasting is implemented by means of selective scheduler locking–very much like a priory-ceiling mutex. During event multicasting the scheduler gets locked, but only up to the highest-priority subscriber to a given event. The whole point here is that active objects with priorities above such "priority ceiling" arenot affected. Please see the discussion thread:
https://sourceforge.net/p/qpc/discussion/668726/thread/c186bf45
This release also changes the implementation of the priority-ceiling mutex in the preemptive built-in kernels: QK and QXK. Specifically, the implementation now re-uses the selective scheduler locking mechanism. In this new implementation, the QXMutex of the QXK kernel is much more efficient and lightweight, but itcannot block while holding a mutex.
Finally, this release changes theQP ports to 3rd-party RTOSes by performing any RTOS operations (like posting events to message queues) outside critical sections. Also the ports have been augmented to support scheduler locking (this feature depends on what's available in the specific RTOSes).
Changes in detail:
- Added scheduler locking to QF::publish_() inqf_ps.cpp. This feature is added in a portable way, via macros QF_SCHED_STAT_TYPE_,QF_SCHED_LOCK_() andQF_SCHED_UNLOCK_(), which need to be implemented in everyQP port.
- Modified QV kernel to provide (dummy) implementation of selective scheduler locking.
- Modified QK kernel to implement selective scheduler locking via modified priority-ceiling mutex QMutex.
- Modified QXK kernel to implement selective scheduler locking via modified priority-ceiling mutex QXMutex.
- Modified embOS port to provide (global) scheduler locking, which affects all priorities, because that's all embOS supports. Also, modified the embOS port to perform event posting outside the QF critical section.
- Modified uC/OS-II port to provide (global) scheduler locking, which affects all priorities, because that's all uC/OS-II supports. Also, modified the uC/OS-II port to perform event posting outside the QF critical section.
- Modified ThreadX port to provide selective scheduler locking, by means of "priority-threshold" available in ThreadX. Also, modified the ThreadX port to perform event posting outside the QF critical section.
- Changed the ThreadX example to run on ARM Cortex-M4 board (STM32DiscoveryF4), instead of Win32 emulation (see qpcpp/examples/threadx/arm-cm/dpp_stm32f429-discovery).
- Modified the Win32 port to provide (global) scheduler locking, which is implemented by Win32 critical section.
- Fixed Bug#122 (QP didn't initiate some internal variables)https://sourceforge.net/p/qpc/bugs/122/ by adding explicit clearing of allQP variables in QF::init().
- Modified the POSIX port to dummy-out scheduler locking. This means that this port currently does NOT lock scheduler around event publishing. (At this point it is not clear how to implement POSIX scheduler locking in a portable way.)
- Modified QK and QXK examples in qpcpp/examples/arm-cm/dpp_ek-tm4c123gxl to demonstrate the usage of the new priority-ceiling mutexes.
- Fixed the 3rd-party file startup_stm32l32l1xx.c to include exceptions for Cortex-M3 (MemManage_Handler, BusFault_Handler, and UsageFault_Handler).
- Updated the 3rd-party files for the EK-TM4C123GXL board (TivaC LaunchPad).
- Modified Makefiles for the EK-TM4C123GXL board with GNU-ARM toolset to define the symbol TARGET_IS_TM4C123_RB1 for compatibility with the updated 3rd-party files.
- Implemented Feature Request #110 as well as the duplicate Request #62 by adding function QMActive::flushDeferred()
Version 5.6.1, 2016-01-01
This release is the first official (production) release of the new blocking QXK kernel ("eXtended Quantum Kernel"). QXK is a small, preemptive, priority-based,blocking kernel that provides most features you might expect of a traditional blocking RTOS kernel.
QXK has been designed specifically for applications that need to mix event-driven active objects with traditional blocking code, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software. The QXK kernel is integrated tightly and optimally with the rest of theQP. It reuses all mechanisms already provided inQP, thus avoiding any code duplication, inefficient layers of indirection, and additional licensing costs, which are inevitable when using 3rd-party RTOS kernels to run QP/C++ applications.
- Note
- The QXK documentation is available in the QP/C Reference Manual at qxk
Additionally, this release removes the macros Q_ROM, Q_ROM_BYTE, and Q_ROM_VAR from the QP/C++ code. These macros have been necessary for odd Harvard-architecture 8-bit CPUs (such as AVR, 8051) to place constant data in ROM. As QP/C++ stopped supporting those CPUs, the non-standard extensions could be removed from the QP/C++ code base.
Additionally, this release re-designs the priority-ceiling mutex in the QK kernel, which now works the same as the mutex of the new QXK kernel. Also, the QK ports to ARM Cortex-M no longer need or use the SVC_Handler (Supervisor Call). This is done to make the QK ports compatible with various "hypervisors" (such as mbed uVisor or Nordic SoftDevice), which use the SVC exception.
Finally, this release modifies the GNU-ARM ports of QK for ARM Cortex-M, to use the __ARM_ARCH macro to distinguish among different architectures (ARCHv6 vs ARCHv7).
Changes in detail:
- Added new header files for QXK: qxk.h, and qxthread.h.
- Added new source files for QXK:qxk.cpp,qxk_mutex.cpp, qxk_pkg.h,qxk_sema.cpp,qxk_xthr.cpp.
- Added QXK ports to ARM Cortex-M for ARM-KEIL, GNU-ARM, IAR, and TI-ARM toolsets (see qpcpp/ports/arm-cm/qxk)
- Added QXK examples for ARM Cortex-M (in qpcpp/examples/arm-cm/dpp_ek-tm4c123gxl/qxk and qpcpp/examples/arm-cm/dpp_nucleo-l053r8/qxk) for all supported toolsets.
- Removed Q_ROM, Q_ROM_BYTE, and Q_ROM_VAR from the QP/C++ code.
- Added Q_ROM, Q_ROM_BYTE to the compatibility-layer in qpcpp.h.
- Removed ports and examples for the following 3rd-party RTOSes: CMSIS-RTX and FreeRTOS, as QXK provided all the features found in those kernels and is recommended over those kernels.
- Removed AVR ports and examples.
- Re-designed the QK priority-mutex in files qk.h and qk_mutex.cpp.
- Provided QK mutex examples in qpcpp/examples/arm-cm/dpp_ek-tm4c123gxl/qk and qpcpp/examples/arm-cm/dpp_nucleo-l053r8/qk.
- Updated Makefiles for GNU-ARM to use the __ARM_ARCH macro for defining the ARM architecture.
- Updated CMSIS from 4.2 to 4.3 in qpcpp/3rd-party/CMSIS
- Added error directives to source files from different built-in kernels (QV, QK, and QXK) to generate meaningful error messages when these files are mixed in one project. For example, a project based on QK will report errors when source files for QV or QXK are included in it.
- Corrected example projects for the ARM Cortex-M with TI/CCS toolset
Version 5.5.1, 2015-10-05
The purpose of this release is to improve the AAPCS compliance of the ARM Cortex-M port to the QK preemptive kernel. Specifically, the PendSV handler in assembly did not always maintain the 8-byte stack alignment, which is required by AAPCS. This version corrects the stack misalignment in the qk_port.s files for all supported ARM compilers (ARM-Keil, GNU, and IAR). All these ports should also be ready for ARM Cortex-M7.
Version 5.5.0, 2015-09-28
The main purpose of this release is the extension of the QS software tracing system to bi-directional communication with embedded Targets. Specifically, the QS-RX (receive channel for QS) has been added with the following capabilities:
- Set global QS filters inside the Target
- Set local QS filters inside the Target
- Inject an arbitrary event to the Target (direct post or publish)
- Execute a user-defined callback function inside the Target with arguments supplied from QSPY
- Peek data inside the Target and send to QSPY
- Poke data (supplied from QSPY) into the Target
- Execute clock tick inside the Target
- Request target information (version, all sizes of objects, build time-stamp)
- Remotely reset of the Target
This QP/C++ version complements the recent release of Qtools 5.5.0, where the QSPY host application (https://www.state-machine.com/qspy ) has been extended with a UDP socket, which is open for communication with various Front-Ends (GUI-based or headless). An example Front-End written in Tcl/Tk called "QSpyView" has been developed to demonstrate all the features. The example application located in the directory qpcpp/examples/arm-cm/dpp_ek-tm4c123gxl/qspy contains customization of the "qspyview" script for the DPP application. Please refer to the documentation of this example (https://www.state-machine.com/qpcpp/arm-cm_dpp_ek-tm4c123gxl.html ) for more information.
Also, this release adds a state machine operation for implementing the shallow history mechanism. The operation is called "childState", because it computes a child state of a given parent, such that the child belongs to the same state hierarchy as the current state.
Also, this release fixes problems with QP/C++ examples for Qt. The Qt project files have been modified to build QP/C++ from sources rather than usingQP as a library.
Finally, this release fixes bugs #110 and #115 reported against QP/C++ on SourceForge.net.
Changes in detail:
- Modified the QS software tracing component to add new functionality, such as the QS-RX input channel. Also added new trace records.
- Added file "qstamp.cpp" (in the qpcpp/include/ folder) to provide time-stamp of the application build.
- Added function QMsm::childStateObj() to the QMsm class and QHsm::childState() to the QHsm class. These functions have been added to support the shallow-history mechanism.
- Modified all example projects (qpcpp/examples/ folder) to include the "qstamp.cpp" file and force its re-compilation for each new build, so that every build has an up-to-date and unique time stamp.
- Extended the DPP on TivaC LauchPad example (directory qpcpp/examples/arm-cm/dpp_ek-tm4c123gxl/) to demonstrate QS-RX (QS receive channel).
- Provided example of customizing the "QSpyView" Tcl/Tk script for the DPP application in the directory qpcpp/examples/arm-cm/dpp_ek-tm4c123gxl/qspy/
- Modified all examples (qpcpp/examples/ folder) to call theQS_ASSERTION() macro to theQ_onAssert() callback function.
- Modified the startup code (in the qpcpp/3rd_party/ folder) for ARM Cortex-M to invoke theQ_onAssert() callback from the assert_failure() exception handler. This is to allow application-level code to defineQ_onAssert() for each specific project.
- Replaced deprecated registers in TM4C (TivaC) projects (SYSCTL->RCGCGPIO rather than the deprecated SYSCTL->RCGC2).
- Fixed bug #110 "QF::init() failed to initialize the last entry inactive_[] array"
- Fixed bug #115 "QMsm::isInState() implementation missing"
Version 5.4.2, 2015-06-06
The main focus of this release is to improve the support for "dual targeting" of QP/C++ applications, which is developing of deeply embedded code as much as possible on the desktop OS, such as Windows. Experience shows that "dual targeting" dramatically improves productivity of embedded systems developers, perhaps more than any other technique.
This release makes it possible to use exactly thesame application code, main function, and the Board Support Package interface (bsp.h) on both deeply embedded target and on Windows. The only differences between these targets can be completely encapsulated in the Board Support Package implementation (bsp.cpp).
The support for "dual targeting" in this QP/C++ release works both for Win32 console and Win32 GUI applications. The Win32-GUI support enables developers to easily emulate the front-panels of the embedded devices, with LCD-screens (graphical and segmented), LEDs, buttons, switches, sliders, etc.
Changes in detail:
- Modified the QP/C++ ports to Windows (bothWin32 API (Multithreaded) andWin32-QV (Single Threaded)) so that they support both Win32 console and Win32-GUI applications. The newly introduced pre-processor #WIN32_GUI macro is now required to use the Win32-GUI facilities.
- Added portable "safe" macros from<stdio.h> and<string.h> to the QP/C++ ports to Windows. These macros encapsulate the differences between Microsoft Visual C++ and other compilers (such as MinGW).
- Simplified the structure of the QP/C++ Windows ports by eliminating one level of directories for the compilers used. Both VC++ and MinGW builds can now be run in the same port directory.
- Modified the QF::stop() function in the QP/C++ port toWin32-QV (Single Threaded), so that it unblocks the QV event-loop and thus lets the application terminate.
- Modified all examples for Windows to use the new port structure.
- Improved all Makefiles (for the MinGW toolset) in all Windows examples, to make them easier to adapt to custom applications, both Win32 console and Win32 GUI.
- Moved several examples from theexamples/win32/ and examples/win32-qv directories toexamples/arm-cm/ directory with native embedded examples for ARM Cortex-M. This co-location of the Win32 emulation with the embedded code running on the actual board demonstrates better the "dual targeting" development approach.
- Updated all Windows examples to the latestQP API by compiling the code with the macroQP_API_VERSION set to 9999 (latest API without backwards compatibility)
- Improved the PC-Lint support for checking the application-level code located in inexamples/arm-cm/dpp_ek-tm4c123gxl/lint
Version 5.4.1, 2015-05-21
This release changes the active object class hierarchy so thatQP::QMActive is now more fundamental and is the base class forQP::QActive. (PreviouslyQP::QMActive was a subclass ofQP::QActive). The newly added documentation section about QP/C++ Design shows the current class hierarchy.
- Note
- Because the typesQP::QMActive and QActive are equivalent in QP/C++, this change has minimal impact on the applications, but it is now more correct to use QMActive as the base class for all "opaque" active object pointers.
Also, this release brings several cosmetic improvements:
- All QM models have been saved with QM 3.3.0, which means that they will not open with QM 3.2.x or earlier QM versions.
- Theqpcpp/ports/arm-cm/qk/gnu/qk_port.s ARM Cortex-M port to QK with GNU has been modified to use the CMSIS-compliant symbol __FPU_PRESENT instead of the FPU_VFP_V4_SP_D16 symbol.
- All Makefiles for the GNU toolset have been cleaned up, whereas any/ (back-slash) characters in the paths have been repalced with/ (forward-slash) characters. Also all these Makefiles have been updated to provide the __FPU_PRESENT to C/C++ and assembler when the hardware FPU is used.
- The file display drver for the EK-LM2S811 board locate atqpc/3rd_party/ek-lm3s811/display96x16x1.c has been modified to fix the problem with incorrect hardware delay with the GNU compiler at higher levels of optimization. The in-line assembly for the GNU compiler has been updated such that the delay loop cannot be "optimized away".
- Several README files have been updated.
Version 5.4.0, 2015-05-14
This release changes the basic philosophy of distributing the QP Frameworks bycombining the "QP/C++ Baseline Code" with all currently available "QP/C++ Development Kits" (QDK/C++). This is done to eliminate any potential mistakes in downloading and installing separate pieces of code.
Additionally, this release changes the basic philosophy of building your embedded applications with the QP/C++ framework. Starting with this release, allexamples for embedded boards include the QP/C++ framework assource code within the projects, instead of statically linking with a QP/C++ library. (NOTE: It is still possible to use QP/C++ as a library, but you need to build such libraries yourself, as they are no longer provided in the QP/C++ distribution.)
The move to building QP/C++ from sources ensures the consistent toolset version and compiler options applied to the application code as well as the QP/C++ framework code. (NOTE: The QP/C++ examples for "big operating systems", likeWindows orLinux, still use QP/C++ as a pre-compiled library that is statically linked with the application code.)
This release also changes the active object class hierarchy so that QMActive is now more fundamental and is the base class for QActive. (Previously QMActive was a subclass ofQP::QActive). The newly added documentation section about QP/C++ Design shows the current class hierarchy.
- Note
- Even though the QP/C++ source has been re-packaged in this release, the changes have minimal impact on the existing QP/C++ applications. The biggest difference is that "opaque" pointers to active objects derived from QMActive now need to be also typed QMActive (as opposed to QActive), because QMActive is no longer a subclass of QActive and the automatic upcast no longer applies.
The changes in basic approach to distributing and building the framework have also the following ripple effects:
- The QP/C++ source code has been simplified and has been re-packaged into a much smaller number of source files. The whole QP/C++ source code now resides in the singlesource
folder. Additionally, the source code files have now theread-only protection to prevent inadvertent changes to the QP/C++ source code that is part of your projects.
- It is no longer necessary to define theQPCPP environment variable to build the QP/C++ examples. All directories and files referenced by example projects arerelative to the project folder. This change reflects the fact that most development tools add source files to the project using relative paths (and now the projects contain QP/C++ source code, not just theQP library).
- The QP/C++Ports
folder has been reorganized to contain all currently available QP/C++ ports. The ports are organized into three categories:native QP/C++ ports ("bare-metal"),ports to 3rd-party RTOSes, and ports to big operating systems (Windows and Linux).(NOTE: the ports are now documented in the thisQP/C++ Reference Manual. Each port sub-directory contains aREADME link to the corresponding page in the online documentation)
- The QP/C++Examples
folder has been reorganized to reduce the repetitions and contains all currently available QP/C++ examples. The folder includes four categories of examples:native QP/C++ examples ("bare-metal"),examples for 3rd-party RTOSes, examples for big operating systems (Windows and Linux), and examples for 3rd-party Middleware. As mentioned before, all example projects for embedded systems use QP/C++ as source code and not as a library. The examples folder has been expanded to contain all currently available QP/C++ examples, many of them are new in this release. (NOTE: the currently available examples are now documented in theQP/C++ Reference Manual. Each example sub-directory contains aREADME link to the corresponding page in the online documentation)
- A new 3rd_party
folder created to contain the Third-Party code used in the QP/C++ ports and examples, such as MCU register files, low-level startup code, device drivers, etc. The 3rd_party folder avoids the need to repeat such code in every project. Also, the separation of the Third-Party components helps to clearly indicate code that comes from various sources, and to which Quantum Leaps, LLC expressly makesno claims of ownership. The Third-Party software components included in this "3rd_party" folder are licensed under a variety of different licensing terms that are defined by the respective owners of this software and are spelled out in the README.txt or LICENSE.txt files included in the respective sub-folders.
- This release also comes with the much expanded onlineQP/C++ Reference Manual, which is cross-linked with the ports and examples.
Changes in detail:
- Renamed the "Vanilla" scheduler to the QV non-preemptive kernel for symmetry with the QK preemptive kernel. Renamed QF::onIdle() callback to QV::onIdle().
- Removed class QFsm (which is now deprecated). Legacy state machines coded in the "QFsm-style" will continue to work, but will use the QHsm implementation internally. There is no longer any efficiency advantage in using the "QFsm-style" state machines.
- Applied a slight performance improvement to the ARM Cortex-M port to the QK preemptive kernel. The QK port now checks for ISR context by looking at the IPSR register, instead of incrementing and decrementing theQK_intNest_ up-down counter.
- Updated ARM Cortex-M examples and provided new examples for NXP mbed-LPC1768, and STM32 NUCLEO-L053R8, and NUCLEO-L152RE boards. All examples now use the latest CMSIS (V4.3.0). All ARM Cortex-M examples are provided for the ARM-KEIL, GNU-ARM, and IAR-ARM toolsets.
- Added the native port and examples to the classic ARM7/9 with AT91SAM7S-EK board and the IAR-ARM toolset.
- Added the native port and examples to the AVR (AVRmega) with GNU-AVR and IAR-AVR toolsets. The examples are provided for the Arduino-UNO board.
- Added the nativeport and examples to MSP430 with TI CCS-430 and IAR-430 toolsets. The examples are provided for the MSP430 LauchPad board (MSP-EXP430F5529LP for the "classic" MSP430 and "extended" MSP430X).
- Added port to CMSIS-RTOS RTX. Examples are available for TI EK-TM4C123GLX, STM32 NUCLEO-L053R8, and NUCLEO-L152RE boards with ARM-KEIL, GNU-ARM, and IAR-ARM toolsets.
- Updated port toembOS. Examples are available for STM32 STM32F4-Discovery board with IAR-ARM toolset.
- Updated port toFreeRTOS for the latest version 8.2.1. Examples are available for TI EK-TM4C123GLX board with GNU-ARM and IAR-ARM toolsets.
- Addedport to Thread-X. Example is available for the Thread-X demo with Visual Studio on Windows.
- Updated port touC/OS-II for the latest version v2.92. Examples are available for TI EK-TM4C123GLX and STM32 NUCLEO-L152RE boards with ARM-KEIL and IAR-ARM toolsets.
- Updatedport to Win32 (Windows). Modified the port to apply a generous "fudge factor" in over-sizingQP event queues and event pools, to minimize the risk of overflowing queues/pools due to non-deterministic Windows behavior.
- Updated the QP-Qt Port (QP/C++ port to the Qt cross-platform GUI framework).
- Added newport to Win32-QV (Windows with non-preemptive QV kernel, previously known as Win32-1T).
- Updated the lwIP-QP example for EK-LM3S6965 board.
Version 5.3.1, 2014-09-20
- Note
- QP/C++ 5.3.1 remains backwards-compatible with all QP/C++ ports and applications
This release fixes the following bugs:
- QMsm::isInState() returns invalid result (bug #105)
- QF::gc() doc typo (bug #102)
- POSIX-port Makefile error (bug #65)
- Problematic friendship to extern "C" function in qf.h (bug #106)
Also, this release updates the PC-Lint options and removes all the remaining PC-Lint warnings for the latest PC-Lint 9.00k.
Additionally, this release improves the uC/OS-II port in that it is now generic and applicable for any CPU, for which uC/OS-II port exists. Specifically, all references to DOS or x86 have been removed from theQP port and any CPU-specific dependencies have been placed in the separate part of the port.
Finally, this release improves the "QP/C++ Reference Manual" generated by Doxygen and available both inside the QP/C++ baseline distribution (qpcpp.chm file) and online at:https://www.state-machine.com/qpcpp
Version 5.3.0, 2014-04-14
This release adds the "transition to history" (deep history) feature to both QHsm and QMsm state machines and their subclasses. This QP/C++ release matches the new QM modeling tool version 3.1.0, which now supports the "transition to history" connector and the corresponding code generation for transitions to history.
/note QP/C++ 5.3.0 remains backwards-compatible with QP/C++ applications developed for QP/C++ 4.x and QP/5.x. However, any QM models created for the previous QP/C++ versions require re-generating the code with QM 3.1.0.
This release adds new QS (Quantum Spy) instrumentation for tracing transitions to history as well as entry and exit points in submachines. All these features require the matching QSPY host application included in Qtools 5.3.0.
Additionally, the QMsm state machine has been extended to add implementation of the reusable submachine states and submachines with entry points and exit points. The reusable submachines in QP/C++ 5.3.0 lay the groundwork for providing reusable submachine states and submachine diagrams in the next upcoming QM version.
This release also uses the C99 data types uint_fast8_t and uint_fast16_t instead of the non-standard uint_t.
Finally, this QP/C++ release brings deep changes in the source code comments and the doxygen documentation generated from the source code. All comments have now more consistent structure, and every function is now documented in the implementation file (.cpp file), whereas the interface (.h files) contain only the brief descriptions of the functions. This re-structuring of documentation is performed as part of the validation and verification effort that has begun to provide a certification package for QP/C++ for safety standards, such as IEC 61508 and ISO 62304 (FDA 510(k)).
Changes in detail:
- Moved detailed documentation of functions from the header files (.h) to implementation files (.cpp).
- Removed the header file "qevt.h" and merged its contents into "qep.h"
- Added macros: trace records QS_QEP_TRAN_HIST, QS_QEP_TRAN_EP, and QS_QEP_TRAN_XP to "qs.h"
- Added macros: Q_TRAN_HIST(), QM_TRAN_HIST(), QM_TRAN_EP(), QM_TRAN_XP(), and QM_SUPER_SUB() to "qep.h"
- Added attributes entryAction and initAction to the QMState struct in "qep.h" (needed for transition to history).
- Added attribute act to the QP::QMAttr union in "qep.h" (needed for transitions to entry point in submachine states).
- Changed the QState return type from action/state handler functions to uint_fast8_t.
- Added QM models to the "Transition to History" design pattern example (directory qpcpp/examples/win32/mingw/history) and also added an example for "Transition to History" with the QMsm class (see qpcpp/examples/win32/mingw/history_qm).
- Changed the m_prio attribute of QActive to uint_fast8_t.
- Changed the type of prio argument to uint_fast8_t and qlen/stkSize to uint_fast16_t in the signature of QActive::start()
- Changed the type of the tickRate argument in QTimeEvt constructor and QP::QF::tickX_(), and QP::QF::noTimeEvtsActiveX() to uint_fast8_t.
- Changed the type of the poolSize argument inQP::QF::poolInit() to uint_fast16_t.
- Changed arguments evtSize and margin inQP::QF::newX_() to uint_fast16_t.
- Changed attribute bits in QPSet8 as well as bytes and bits[] in QPSet64 to uint_fast8_t.
- Changed the QEQueueCtr event queue counter type to uint_fast8_t.
- Changed type of arguments qLen and margin inQP::QEQueue::init() and QEQueue/QActive::post() to uint_fast16_t.
- Changed the return type from QK_schedPrio_() (priority) as well as the p argument in QK_sched_() and QK_schedExt_() to uint_fast8_t
- Added function QMsm::isInState() to "qep.h" and its implementation file qmsm_in.cpp. This function tests whether the QMsm state machine (or its subclasses like QMActive) "is in" the given state.
- Updated all make scripts for QP/C++ ports to include the new qmsm_in.cpp in the QP/C++ library builds.
Version 5.2.1, 2014-01-06
This release fixes two bugs.
- In file qmsm_dis.cpp added saving of the action-table into a temporary variablebefore exiting the current state to the transition source. Also, changed the signature of the QMsm::msm_tran() helper function to take the action table as parameter. NOTE: This bug only affected the Spy configuration and because of this escaped regression testing. The internal testing process have been updated to test all build configurations: Debug, Release, and Spy.
- In file qs_mem.cpp fixed an error in accounting used bytes in the QS trace buffer.
Version 5.2.0, 2013-12-28
This release matches the new QM 3.0.0, for which it provides model examples based on the new QMsm/QMActive classes. This, in turn demonstrates the new state machine code generation that QM3 was specifically designed to do.
This release also provides a clearly separated API compatibility layer, whereas you can configure a level of backwards compatibility by means of theQP_API_VERSION macro. This facilitates migrating existingQP applications to the newer API.
An cyclomatic complexity (McCabe V(G)) analysis of this version has been performed and the maximum V(G) complexity per function has been reduced to 15 by breaking up the QHsm::dispatch() function. The code metrics report, including cyclomatic complexity by function as well as other standard code metrics (e.g., lines of code), is now included in the "QP/C++ Reference Manual", seehttps://www.state-machine.com/qpcpp/metrics.html
Also, in this release all internalQP data that were previously uninitialized are now explicitly initialized to zero. In other words, this release no longer assumes that all uninitialized data (global and static inside functions) is implicitly initialized to zero before the control is transferred to main(). This is a requirement of the C Standard, but some embedded startup code fails to do this.
Finally, this release demonstrates safer stack allocation and safer exception handlers in all ARM Cortex-M examples. The techniques are described in the Embedded.com article "Are We Shooting Ourselves in theFoot with Stack Overflow?".
Changes in detail:
- for backwards compatibility, in file qp_port.h defined "APICompatibility Layer", which is controlled by the macroQP_API_VERSION. For example, specifying QP_API_VERSION=500 chooses API compatible withQP version 5.0.0 or newer, but excludes APIs that became deprecated in the earlier versions. If the macroQP_API_VERSION is not defined by the user (typically on the command line for the compiler), the default value of 0 is assumed. This default means maximum backwards compatibility (from version 0.0.0). On the other hand, higher values ofQP_API_VERSION mean less backwards compatibility. For example QP_API_VERSION=9999 will specify compatibility only with the latest version ofQP. The API Compatibility Layer for QP_API_VERSION < 500 provides macros: postLIFO(), publish(), and tick(). These macros resolve toPOST(),PUBLISH(), andTICK_X() respectively.
- In file qhsm_dis.cpp, broken up the function QHsm::dispatch() into two functions QHsm::dispatch() and a private helper QHsm::hsm_tran(). This has reduced the cyclomatic complexity from 25 for the original function, to 11 and 15 for QHsm::dispatch_() and QHsm::hsm_tran(), respectively.
- In file qmsm_dis.cpp, broken up the function QMsm::dispatch() into two functions QMsm::dispatch() and a private helper QMsm::msm_tran(). This has reduced the cyclomatic complexity from 15 for the original function, to 9 and 7 for QMsm::dispatch() and QMsm::msm_tran(), respectively.
- Changed QM models dpp.qm and game.qm to use QMActive and QMsm base classes instead of QActive and QHsm, to showcase the new code generation capabilities of QM3.
- Added the QMsmTst example application analogous to the QHsmTst to test the QMsm base class. The QMsmTst comes with the QM model qmsmtst.qm.
- In fileqf_act.cpp added the function QF::bzero(), and in filesqv.cpp andqk.cpp added calls to QF::bzero() to explicitly clear the uninitialized data. Also added calls to QF::bzero() inside qf_psini.cpp.
- Updated all examples for ARM Cortex-M to use safer stack allocation and safer exception handlers in all ARM Cortex-M examples, as described in the Embedded.com article "Are We Shooting Ourselves in the Foot withStack Overflow?".
Version 5.1.1, 2013-10-10
This release fixes reversal of logic in the QF::noTimeEvtsActiveX() function as well as sleep mode transition in the ARM Cortex-M3/M4 ports to the non-preemptive QV kernel. Also, the nativeQP event queue implementation has been changed to count the extra "front-event" location into the number of free entries, which fixes the problem of defer queues of depth 1. Finally, the release restores the support for linting (with PC-Lint) of the QP/C++ applications for ARM Cortex-M (with IAR and GNU compilers).
Changes in detail:
- In file qf_tick.cpp reversed the logic inside QF::noTimeEvtsActiveX()
- Modified free entry accounting (nFree) in the files: qeq_init.cpp, qeq_fifo.cpp, qeq_get.cpp, and qeq_lifo.cpp.
- Modified free entry accounting (nFree) in the files: qa_init.cpp, qa_fifo.cpp, qa_get_.cpp, and qa_lifo.cpp.
- Introduced new macro QF_CPU_SLEEP() in the ARM Cortex-M QV ports.
- Changed Board Support Package files (bsp.cpp) in the ARM Cortex-M QV examples.
- Modified the CMSIS-compliant startup code in all ARM Cortex-M QV examples.
- Modified the application examples with PC-Lint (qpcpp/examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint and qpcpp/examples/arm-cm/qk/iar/dpp-qk_ek-lm3s811-lint). Updated lint files for the latest PC-Lint
- Ported all state pattern examples to Win32/MinGW. That way, all these examples can be run and modified directly on Windows, without going back to DOS.
Version 5.1.0, 2013-10-02
/note QP/C++ 5.1.0 remainsbackwards-compatible with the existing QP/C 4.x applications, except theARM Cortex-M applications need to adjust the interrupt priorities. Specifically, you need to set the interrupt priorities equal or lower thanQF_AWARE_ISR_CMSIS_PRI constant provided in the qf_port.h header file.
The main purpose of this milestone QP/C++ release is to enable the QM modeling tool to generate a new type of state machine code (requires QM version 3.0.0, which is still in development as of this writing).
This new type of state machine implementation in QP/C++ 5 is based on the newQP::QMsm class, which takes advantage of the QM tool as an advanced "state machine compiler". QM can perform optimizations that were not possible with the C pre-processor alone. Specifically, the QM can easily determine the LCA (Least-Common-Ancestor) state for every transition and it can generate the complete transition-sequences (sequences of exit/entry/initial actions) at code-generation time. The resulting code can be still highly human-readable, but it will no longer be human-maintainable. The lab tests indicate that the new "housekeeping" code for executing hierarchical state machines can be about twice as fast as the previous code based on theQP::QHsm class.
The next important change introduced in QP/C++ 5 is making several important functions in QP/C++ base classes virtual. The new virtual functions include: QMsm::init() and QMsm::dispatch() and QActive::start(), QActive::post(), and QActive::postLIFO() perations. Making these functions virtual means that all these operations can be overridden in sub-classes of state machines and active objects. This, in turn, allows a single application to use a mix of state machine classes derived from the new QMsm base class with state machines derived from the QHsm base class, each one using a different state machine implementation strategy. Additionally, the virtual QActive::post() operation could be very useful for implementing various Proxy active objects (e.g., for active object event posting across networks).
Another big feature introduced in QP/C++ 5 are the multiple, independent system clock tick rates for time events. The number of system tick rates can be now configured in the QP/C++ ports. For example, a digital watch can use a "fast" clock tick rate of 100Hz and a "slow" clock tick rate of only 1Hz. These clock tick rates can be managed independently, so for example, the fast clock tick rate can be shut down in the absence of time events assigned to this rate. This feature allows the applications to implement sophisticated power-saving policies.
As yet another important feature, QP/C++ adds a new "extended" API for non-asserting event allocation and posting. This feature is intended for situations, where an application is hammered with external events that at times arrive too fast for processing, but that can be ignored under the overload conditions. In those cases firing an assertion inside the framework is undesirable. The non-asserting API allows a designer to request a safety-margin when allocating or posting an event. The event is not allocated/posted if the safety margin cannot be satisfied at the time of the call. On the other hand, the safety margin allows the application to still use the regular (asserting) event allocation and posting, because the event pools and event queues are guaranteed to maintain a minimal margin for safe operation.
Finally, this QP/C++ release brings significant improvements to the QS software tracing implementation and also brings important changes the ARM Cortex-M port. Changes in detail are as follows:
- Removed the conditional compilation of theQP:: namespace based on the macro Q_NNAMESPACE. The namespaceQP:: is now enabled permanently, which is a requirement of MISRA-C++:2004 and is also is part of the QM code generation for QP/C++. Also, the use of explicitQP:: namespace improves the doxygen documentation (QP/C++ Reference Manual).
- Added the new QMsm class to qep.h. Changed the inheritance tree by deriving QHsm and QFsm from the QMsm base class.
- Added new source files qmsm_ini.cpp and qmsm_dis.cpp to the QEP. These files implement the QMsm::init() and QMsm::dispatch() functions, respectively.
- Added the new QMActive class to qf.h. Extended the inheritance tree to derive QMActive from QActive.
- Added the multiple system clock tick rates feature in qf.h:
- added new configuration macroQF_MAX_TICK_RATE, which specifies the number of clock tick rates. This macro is to be defined in the QF ports (in the qf_port.h header file). If the macro is undefined, the default value is 1 (one clock tick rate).
- renamed and re-implemented the QF::tick() function as the "extended" QF::tickX() function with the argument 'tickRate' for processing time events allocated to different clock rates. The application must call QF::tickX(0), QF::tickX(1), ... at the specified tick rates from ISRs ortasks.
- added an "extended" time event constructor, which assigns a time event to a specific tick rate as well as specific active object.
- renamed and re-implemented the internal function QTimeEvt::arm_() to a public function QTimeEvt::armX() for arming time events initialized with the "extended" constructor. The QTimeEvt::armX() function is the new recommended API for arming time events, both one-shot and periodic.
- re-implemented QTimeEvt::disarm() and QTimeEvt::rarm().
- renamed QF::noTimeEvtsActive() to the "extended" version QF::noTimeEvtsActiveX(), which checks time events assigned to the given tick rate.
- Added the new non-asserting API to qf.h:
- renamed internal function QF::new_() to QF::newX_(), the latter one taking the argument 'margin' for allocating events. The function returns NULL if the event pool has less free events than the specified margin. The function asserts if the margin is zero and the event can't be allocated.
- added function QActive::post() to post an event to the given active object. The function does not post the event if the target event queue has less free slots than the specified margin. The function asserts if the margin is zero and the event can't be posted.
- added "extended" macroQ_NEW_X() for allocating events with a margin.
- added "extended" macroPOST_X() for posting events with a margin.
- Modified the QActive::defer() function to return the status of the defer operation (true==success), instead of asserting when the defer queue overflows.
- Modified QS (Quantum Spy) software tracing implementation:
- Optimized the internal QS implementation of all functions that insert trace data into the trace buffer. The general idea of the optimization is to extensively use automatic variables instead of global variables (such as buffer head and tail indexes, the running checksum, etc.).
- Reduced the number of QS global filters from 256 to 124 (0x7C). This enables the code to avoid escaping the trace record numbers
- added additional tick rate byte to the trace records QS_QF_TICK and QS_QFF_TIMEEVT_*.
- An empty QS record and the QS_RESET record are now inserted automatically into the trace buffer in the function QS::initBuf(). The empty QS record/QS_RESET pair provides a clean start of a session and allows the QSPY host application to re-synch with the data stream.
- added new trace records #QS_QF_ACTIVE_POST_ATTEMPT, #QS_QF_EQUEUE_POST_ATTEMPT, and #QS_QF_MPOOL_GET_ATTEMPT for the "extended" non-asserting event allocation and posting.
- added new trace records QS_TEST_RUN and QS_TEST_FAIL for future support for unit testing.
- added new QS source file qs_dict.cpp with functions QS_*_dict() to generate various dictionary entries. Changed the macros QS_*_DICTIONARY() to call these functions. This was done to significantly reduce the amount of tracing code needed to send the dictionaries from applications.
- grouped together the various QS variables (such as filters, trace buffer indexes, etc.) in a single struct, which results in a more efficient code for various QS operations.
- Changed the structure of the ARM Cortex-M ports
- renamed the sub-directory for ARM Cortex-M ports and examples from "arm-cortex" to "arm-cm". This is done to avoid confusion with other ARM Cortex variants, such as Cortex-A/R, which very different from Cortex-M.
- Changed the policy of disabling interrupts for Cortex-M3/M4. For these cores,QP 5.1.0 never completely disables interrupts, even inside the critical sections. TheQP port disables interrupts selectively using the BASEPRI register. (NOTE: The BASEPRI register is not implemented in the ARMv6-M architecture (Cortex-M0/M0+), so Cortex-M0/M0+ need to use the PRIMASK register to disable interrupts globally).
- removed the CMSIS (Cortex Microcontroller Software Interface Standard) directories from the Cortex-M examples and moved it to the common location in the QPC%/ports/arm-cm/cmsis/ directory. Upgraded the CMSIS to the latest version 3.20.
- added the ARM Cortex-M ports and examples with Keil/ARM MDK to theQP Baseline Code.
- upgraded ARM Cortex-M ports with IAR to the latest IAR EWARM 6.60
- upgraded ARM Cortex-M ports with Sourcery CodeBench to the latest version 2013.05-53.
- Added the requested simple "Blinky" example for Windows and ARM Cortex-M (with the GNU, IAR, and Keil toolsets).
- Added "Getting Started with QP/C++" guide based on the Blinky example.
- Updated the Doxygen documentation (QP/C++ Reference Manual)
- removed the outdated tutorial section
- updated and added documentation and code samples
- added search box and tree-view panel to the HTML documentation
/note This new policy of disabling interrupts in ARM Cortex-M divides interrupts into "kernel-unaware" interrupts, which are never disabled, and "kernel-aware" interrupts, which are disabled in theQP critical sections. Only "kernel-aware" interrupts are allowed to callQP services. "Kernel-unaware" interrupts areNOT allowed to call anyQP services and they can communicate withQP only by triggering a "kernel-aware" interrupt (which can post or publish events).
Version 4.5.04, 2013-02-10
The main purpose of this release is adding support for the ARM Cortex-M4F processors with the hardware Floating-Point Unit (FPU). The QP/C ports to Cortex-M4F take full advantage of the "lazy stacking" feature of the FPU registers, and by doing so offer the most efficient preemptive multitasking on this processor.
Changes in detail:
- Added ports and examples for ARM Cortex-M4F with the EK-LM4F120XL board (Stellaris Launchpad).
- Added the macro QF_LOG2(), which can be re-implemented in theQP ports, if the CPU supports special instructions, such as CLZ (count leading zeros in Cortex-M3/M4). If the macro is not defined in theQP port, the default implementation uses a lookup table.
- Updated all ARM Cortex-M ports and examples to the latest IAR EWARM 6.50 and Sourcery CodeBench 2012.09-85.
- Updated App Notes "QP and ARM Cortex-M with IAR" and "QP and ARMCortex-M with GNU".
- Updated the PC-Lint support files (include/lib-qpcpp.lnt, au-misra2.lnt) to the latest PC-Lint 9.00j.
- Updated the Application Note: "QP/C++ MISRA-C:2004 Compliance Matrix".
- Spell-checked the comments in all QP/C++ source files and removed several typos.
- Removed the Qt ports and examples from the QP/C++ Baseline Code and moved them to the separate QDK/C++-Qt.
/note QP/C++ Version 4.5.04 preserves full compatibility with QM 2.2.03 and all existing QDKs for QP/C++ 4.5.xx.
Version 4.5.03, 2012-11-29
This release changes the directory structure ofQP ports to various operating systems, such as POSIX (Linux, BSD, etc.), Win32 (Windows), Qt, etc. The OS ports are moved from the ports/80x86/ directory one level up to ports/. Also, the OS examples are moved from the examples/80x86/ directory one level up to examples/.
Version 4.5.02, 2012-08-15
The main purpose of this release is providing QM models in most examples and better, more comprehensive support for (rapid) prototyping of embedded QP Applications on the desktop with the Win32 API and with Qt. Among others, this release adds a complete toolkit for creating realistic embedded front panels with pure Win32-GUI API and free Visual C++ Express and ResEdit. An extensive Application Note "QP and Win32" is included in this release.
ThisQP release adds QM models, created with the new QM 2.2.01, to most of the examples. The code generated by this new QM version complies with MISRA-C++:2008 rules. For this compliance, the QM code generator applies theQP:: namespace prefix to all QP/C++ elements, such as classes, types, enumerations, etc.
For compliance with MISRA-C++:2008 and compatibility with QM, all QP/C++ ports in this release use theQP:: namespace. The namespace generation can be suppressed by providing the new configuration macro Q_NNAMESPACE, but this is generallynot recommended, because it breaks compatibility with the QM code generation. (In other words, a QP/C++ port without namespace cannot use the code generated by QM.)
This release simplifies theQP ports to desktop OSs, such as Windows (Win32), Linux, BSD, Mac OSX (POSIX) and combines 32-bit and 64-bit ports in one with conditional compilation.
This release also enhances the option for using constructors for dynamically allocated events. When the configuration macro Q_EVT_CTOR is defined, the QEvt class provides a non-default constructor and theQ_NEW() macro becomes variadic and takes the arguments for the event constructor. This generally allows creating dynamic events "on-the-fly" without a temporary pointer to the event. ThisQP configuration is demonstrated only in theQP port to Qt, but can be used in any other port. NOTE: The event constructor feature is NOT backward-compatible with the existing applications.
At the same time, the QEvt class in this release provides the virtual destructor only when the new macro Q_EVT_XTOR is defined. This separation of QEvt constructor from virtual destructor makes the constructor more attractive, because it saves the virtual pointer in every event, if no virtual functions are used in QEvt subclasses (which seems to be generally the case).
This release also adds a new macro QF_MPOOL_EL, which is intended for allocating properly aligned storage for memory pools and event pools.
Finally, allQP ports included in this release use only a singleQP library, rather than separate libraries for QEP, QF, QK, and QS.
Changes in detail:
- ModifiedQP port to Win32 and used the free Visual C++ Express 2010 with Platform SDK rather than Visual C++ Pro 2008. Renamed the port directory from vc2008/ to vc/. Provided a completely revised App Note "QP and Win32".
- EliminatedQP port to Win32 with one thread (Win32-1T).
- Consolidated allQP ports to POSIX OSs (Linux, Linux64, Mac_OSX) into a single port to POSIX and placed it in the directory posix/.
- Renamed the port directory qt_1t/ to qt/.
- Added event constructor to qevt.h (controlled by the configuration macro Q_EVT_CTOR).
- Added the conditional compilation with the macro Q_EVT_XTOR around the virtual destructor in the QEvt class.
- Added macro QF_MPOOL_EL to qmpool.h. Modified all examples to demonstrate the use of this macro to allocate properly aligned storage for event pools.
- Added new typedef 'enum_t' and modified signatures of functions taking event signals from QSignal toenum_t. This was done to significantly reduce the number of casts necessary when enumerated signals were passed toQP functions.
- Modified allQP ports distributed in the QP/C++ baseline code to generate only a singleQP library, rather than separate libraries for QEP, QF, QK, and QS. This includes allQP ports to the desktop (ports/80x86/ directory) and ARM Cortex-M ports (ports/arm-cortex/ directory).
- Modified all examples to link only oneQP library.
- Added QM models to most examples and used the automatically generated code from the models instead of the hand-written code.
- Modified Qt ports to use the event constructors and modified examples for Qt to demonstrate this feature.
- Added .ui files to the Qt examples for generating UIs graphically with the Qt Designer tool. Revised and updated the App Note "QP and Qt".
- Added new macroQS_USR_DICTIONARY() to QS for providing symbolic names for user-defined trace records
- Added new macro QS_RESET() to QS for telling the QSPY application when the target resets. This allows QSPY to reset its internal state.
Version 4.5.01, 2012-06-14
The main purpose of this minor release is providing improved MISRA-compliant state machine implementation. Specifically, a new macro Q_UNHANDLED() has been added for a situation when a guard condition evaluates to FALSE, but the state model does not prescribe the explicit [else] case for this guard. In this case, the state handler can return Q_UNHANDLED(), which will cause the QEP event processor to propagate the event to the superstate, which is what UML semantics prescribes.
NOTE: These change to the QEP event processor is completely backwards-compatible. All state handler functions coded the old way will continue to handle the guard conditions correctly and in accordance with the UML specification. The new Q_UNHANDLED() macro is necessary only for MISRA-compliant state handler coding, which will be applied in the upcoming release of the QM modeling and code generation tool.
Changes in detail:
- Added macro Q_UNHANDLED() and return value Q_RET_UNHANDLED in qep.h.
- Modified qhsm_dis.cpp to handle the Q_RET_UNHANDLED return value.
- Updated the QP/C MISRA-C++:2008 compliance matrix to include the new MISRA-compliant way of coding guard conditions.
- Modified qs.h and qs_dummy.h to add new trace record type QS_QEP_UNHANDLED, which is generated when the state handler returns Q_RET_UNHANDLED.
- Modified qs.h and qs_dummy.h to add the User record dictionary trace record and macroQS_USR_DICTIONARY().
NOTE: This new trace record requires the updated QSPY 4.5.01.
- Corrected qfsm_dis.cpp, which did not generate QS trace records for entry and exit from non-hierarchical states.
- Updated the IAR ARM compiler used in the ARM Cortex-M examples to the latest version IAR EWARM 6.40.
- Modified the Qt port not to define the QPApp::onClockTick() slot function, but instead to allow defining this slot function in the BSP of the application.
Version 4.5.00, 2012-05-26
The main purpose of this release is to improve host-based development ofQP applications, which is critical for Test-Driven Development (TDD). Among others, this release provides integration betweenQP and the popular Qt GUI framework, which allows developers to easily build host-based simulations of the embedded systems with the realistic user interfaces.
This realase also simplifies implementing transitions to history, which is a preparation to providing this feature in the QM modeling tool.
Changes in detail:
- Renamed the event class from QEvent to QEvt to avoid a name conflict with the Qt framework. Also, for consistency, renamed the file qevent.h to qevt.h and the macro Q_EVENT_CAST() toQ_EVT_CAST().
NOTE: To minimize impact of this change on the existingQP ports and applications, the name QEvent is provided as well, but this can be suppressed by defining the configuration macro Q_NQEVENT in qep_port.h.
- Changed the design of QF::tick() (file qf_tick.cpp) to better support calling this function from low-priority tasks (as opposed to interrupts and highest-priority tasks), which often happens whenQP is executed on the desktop operating systems. In this design only QF::tick() can remove time events from the active linked list, so no unexpected changes to the list structure are eliminated
- Simplified the QTimeEvt class by removing the m_prev link pointer, as the new design no longer needs a bi-directional list. These changes impact the files: qte_*.cpp.
- Added return value to QF::run() to allow transfer of the exit status to the desktop operating systems.
NOTE: This modification haves impact on most QP/C++ ports, because the QF::run() function must now return a int16_t value.
- Eliminated the m_running member of the QActive class, which has been used only in theQP ports to "big" OSes such as Linux or Windows.
- Added member m_temp to the QHsm and QFsm base classes to prevent clobbering the current state (the m_state member) during transitions. This change allows keeping the current state unchanged during the entire transition chain, which in turn allows easy and generic access to the state information to store the state history in the exit actions from states. Additional bonus of this re-design is the opportunity of testing for stable state configuration in assertions added to the qhsm_*.cpp and qfsm_*.cpp files.
- Added the QHsm::state() and QFsm::state() accessor methods.
- Modified the "Transition to History" pattern implementation to use the simplified technique of obtaining the current state in the exit action from the superstate rather than all the exit actions from the substates. Modified the "State-Local Storage" (SLS) pattern as well, because it was using the transition to history constructs.
- Re-designed the implementation of the QSPY host application, so that it can be convenienty included as part of theQP library. This allows direct QS tracing output to the screen for QP Applications running on the desktop.
NOTE: This change is part of the Qtools release 4.5.00.
- Modified theQP ports to Win32_1t (both the MinGW and VC2008) to output QS trace data directly to the stdout via the QSPY host-application interface. Modified the DPP examples for Win32_1T to demonstrate the direct QS output to the screen.
- AddedQP port to Qt_1t (Qt with one thread) and two example applications (DPP and PELICAN crossing).
- Added GNU compiler option -pthread toQP ports for POSIX with P-threads, includingQP ports and examples for Linux and Mac OS X.
Version 4.4.00, 2012-05-02
The main purpose of this release is MISRA-C++:2008 compliance, strong-type checking compliance, update of PC-Lint option files and tests, and general cleanup.
- Moved the qp_port.h header file from the port directories to the qcppp/include/ directory. Also, moved the inclusion of the QS (Spy) header files (qs_port.h/qs_dummy.h) from qep.h, qf.h, and qk.h headers to qp_port.h. These structural changes were made to reduce the number of preprocessor #if nesting levels below 8, which is the ANSI-C limit. This was done to comply with the MISRA-C rule 1.1 (all code shall conform to ANSI/ISO C).
NOTE: This modifications have impact on most QP/C++ ports, because the qp_port.h header file must be removed from the port.
- Enabled theQP namespace in most QP/C++ ports (except the DOS ports with the Open Watcom compiler). This modification was needed for MISRA-C++:2008 compliance with the rule 7-3-1.
NOTE: This modifications have impact on most QP/C++ ports, because allQP elements require now using theQP:: prefix. However, this prefix can be dropped when the application applies the "using namespace QP" directive. (The "using" directive deviates from MISRA-C++:2008 rule 7-3-4, so it is not used in the MISRA-compliant examples. However, a number ofQP ports applies the "using" directive for backwards compatibility.)
- Added the PC-Lint option files std.lnt and lib-qpcpp.lnt to the qcppp/include/ directory.
- Cleaned the whole QP/C code from lint comments. All PC-Lint options have been moved to PC-Lint option files.
- ModifiedQP assertion macro Q_DEFINE_THIS_MODULE() to avoid using the # operator (MISRA rule 16-3-2). This macro now requires the argument enclosed in double quotes "".
NOTE: This modification has impact on some QP/C++ ports.
- Added typedefs forchar_t,int_t,float32_t, andfloat64_t to event.h header file for compliance with MISRA-C++:2008 rules 3-9-2.
- Added macrosQ_STATE_CAST() and Q_EVENT_CAST() to qep.h to encapsulate deviation from MISRA-C++:2008 rule 5-2-7.
- Added macroQ_UINT2PTR_CAST() to encapsulate casting unsigned integers to pointers, which deviates from MISRA-C++:2008 rules 5-2-7 and 5-2-8. This macro has been added forapplication-level code.
- Updated ARM Cortex-M examples with the latest CMSIS v3.0, which complies with more MISRA-C:2004 rules.
- Added DPP examples for MISRA-C++:2008 compliant applications (for IAR-ARM and GNU-ARM).
- Updated ARM-Cortex-M3 port with GNU to the latest Sourcery CodeBench 2011.09-60.
- Added QP/C++ port to Win32-1t and examples (Windows with 1 thread). This port is useful for testing embedded QP/C++ applications on windows.
- Added documentation to QP/C++ distribution in the directory qpcpp/doc/, with the following Application notes: "MISRA-C++:2008 Compliance Matrix", "Quantum Leaps Coding Standard", "QP and ARM Cortex-M, and QP and Windows",
Version 4.3.00, 2011-11-03
- This release changes the names of critical section macros and introduces macros for unconditional interrupt disabling/enabling. This is done to simplify and speed up the built-in QV and QK kernels, which no longer are dependent on the interrupt locking policy.
NOTE: The change in handling the critical section in the QV and QK kernels can breakQP ports, which use the "save and restoreinterrupt lock" policy, because all such ports must also define unconditional interrupt disabling and enabling.
- This release changes the partitioning of the QK scheduler. Specifically, the QK scheduler is now divided between two functions QK_schedPrio_() and QK_sched_(), to calculate the highest-priority task ready to run and to perform scheduling, respectively. The function QK_schedPrio_() is useful to determine if scheduling is even necessary.
- Updated allQP ports to comply with the new critical section names and policies.
- Modified the ARM Cortex-M port qk_port.s to take advantage of the new structure of the QK scheduler.
- Upgraded the examples for ARM Cortex with IAR EWARM to the latest IAR EWARM version 6.30.
- Upgraded the examples for ARM Cortex with GNU (CodeSourcery) to the latest Sourcery CodeBench 2011.07-60.
Version 4.2.04, 2011-09-24
The main purpose of this release is to provide a bug fix for the QK port to ARM Cortex processors. The bug fix addresses a very rare and undocumented behavior of late-arrival of an interrupt while entering the PendSV exception. In this case the PENDSVSET bit in the NVIC-ICSR register isnot cleared when finally PendSV is entered, so the PendSV exception is entered in adifferent state when it is entered via the late-arrival mechanism versus the normal activation of the exception through tail-chaining. The consequence of this undocumented and inconsistent hardware behavior, PendSV could be re-entered again before the SVCall exception cleans up the stack. The bug fix is implemented in the qk_port.s file and consists of clearing the PENDSVSET bit programmatically inside PendSV_Handler.
Version 4.2.02, 2011-09-08
- The main purpose of this release is to repackage the default QP/C++ distribution to contain the single root directory qpcpp/ in the archive. That way, unziping the archive will produce only one directory (qpcpp/), which can be then changed by the user.
- This release also changes the ARM CortexQP ports with GNU. The suffix "_cs" has been added to allQP libraries generated by the Code Sourcery toolset (now Mentor Sourcery CodeBench). This is to distinguish libraries generated by different GNU-toolchains (such as CodeRed, Attolic, DevKit ARM, etc.)
Version 4.2.01, 2011-08-13
- Modified file qassert.h to add assertion macrosQ_ASSERT_ID,Q_REQUIRE_ID,Q_ENSURE_ID,Q_INVARIANT_ID, andQ_ERROR_ID, which are better suited for unit testig, because they avoid the volatility of line numbers for identifying assertions.
- AddedQP port and examples for Mac OS X on 80x86.
Version 4.2.00, 2011-07-15
The goal of this milestone release is to extend the number of event pools (theoretically up to 255 pools) instead of just three event pools available up til now. This release adds an option to use constructors/destructors and virtual functions in subclasses of QEvent. Also, this release adds an option to wrap the whole QP Framework in theQP namespace to avoid name conflicts with other libraries and to improveQP compliance with MISRA C++ 2008. This release adds also several improvements to the QS/QSPY software tracing, such as adding sender information to event posting so that sequence diagrams could be easily and automatically reconstructed from tracing data. Also, the tracing now supports 64-bit targets, such as embedded Linux 64-bit. Finally, this milestone release migrates the examples to use the environment variable QPCPP instead of relying on the relative path to the QP/C++ framework. This allows easier adaptation of the examples for real projects, which don't really belong to the examples directory.
The changes in detail are:
- Changed the QEvent base class (file qevent.h). The private member 'dynamic_' has been replaced by two members 'poolId_' and 'refCtr_'.
- Added conditionally-compiled constructor and virtual destructor to the QEvent base class (file qevent.h). Also added the inclusion of the <new> header file for placement new if the constructor/ destructor option is configured.
- Added new version of the macroQ_NEW() with variable number of parameters, which invokes the event constructor (via placement new) with any parameters required by the event constructor (file qf.h).
- Added explicit call to the event destructor in QF::gc() (file qf_gc.cpp).
- Added configuration macro QF_MAX_EPOOL (file qf.h) to define the maximum number of event pools in the QP Application (default to 3). The maximum theoretical number of this macro is 255.
- Made algorithmic changes in the QF source code related to the change of storing the event pool-IDs and reference counters inside QEvent.
- Changed the default signal size (macro Q_SIGNAL_SIZE in the file qevent.h) from 1 to 2 bytes.
- Changed the signature of QActive::recall() to return uint8_t instead of QEvent*, which this could encourage incorrect usage (processing of the event at the point of recalling it). Now, the function only returns 1 (TRUE) if the event was recalled and 0 (FALSE) if the event was not recalled.
- Added the QTimeEvt() constructor and new source file qte_ctr.cpp. The function returns the counter of a time event, which allows using a time event for measuring the time.
- Added new QF macros #QF_TICK, #QF_PUBLISH, and #QACTIVE_POST in file qf.h to provide sender of the events for software tracing.
- Added new QS macros (files qs.h and qs_dummy.h) for handling 64-bit integers.
- Added the functions QS::u64() and QS::u64_() and new source file qs_u64.cpp.
- Added the QS macro #QS_U32_HEX_T for hexadecimal formatting of integer numbers in the user-defined trace records.
- Added the new port linux64 for 64-bit Linux. Also added the corresponding examples for 64-bit Linux.
- Adapted the QSPY host application for 64-bit pointer sizes and the changed layout of trace records that contain event information (such as PoolID and RefCtr). Also added the backwards-compatibility option (-v) for switching the tool to the previous data format.
- Removed the tools directory from the QPC distribution and moved the QSPY host application to the QTOOLS distribution, which now also contains the GNU make tools for Windows.
- Modified the make files and project files to use the environment variable QPCPP instead of relying on the relative path to the QP/C++ framework.
- Upgraded the examples for ARM Cortex with IAR EWARM to the latest IAR EWARM 6.20.
Version 4.1.07, 2011-02-28
The goal of this release is to improve the ease of experimenting with QP/C++ on the desktop. This release adds support for Windows (Win32) to the baseline code. Two most popular compilers for Windows are supported: Microsoft Visual Studio and MinGW (GNU). The support for Linux has been improved by including pre-built QP/C++ libraries and improving makefiles for Eclipse compatibility.
The changes in detail are:
- Added Win32 port with the Visual C++ 2008 (ports/80x86/win32/vc2008). This directory contains the Visual Studio solution all_qp.sln for building all QP/C++ libraries from the IDE. Three build configurations (Debug, Release, and Spy) are supported.
- Added Win32 port with the MinGW compiler (ports/80x86/win32/mingw). This directory contains the Makefile for building all QP/C++ libraries. Three build configurations (dbg, rel, and spy) are supported. NOTE: the Makefile assumes that the MinGW/bin directory is added to the PATH.
- Added Win32 examples for Visual C++ 2008 (examples/80x86/win32/ vc2008/dpp and examples/80x86/win32/vc2008/qhsmtst). Visual Studio solutions are provides for all build configurations.
- Added Win32 examples for MinGW (examples/80x86/win32/mingw/dpp and examples/80x86/win32/mingw/qhsmtst). Eclipse-compatible makefiles are provided for all build configurations. NOTE: the Makefiles assume that the MinGW/bin directory is added to the PATH.
- Removed memory alignment correction in the file qmp_init.c. This correction required casting of pointers to integers and was problematic on 64-bit targets (such as 64-bit Linux).
- Upgraded the examples for ARM Cortex with CodeSourcery to the latest Sourcery G++ 2011.02-2.
Version 4.1.06, 2011-01-07
- Fixed a bug in the software tracing instrumentation in the function QF::unregister_(), fileqf_act.cpp.
- Made cosmetic improvements to the example QM models of the "Fly 'n' Shoot" game.
- Made improvements in make.bat files for building the examples for DOS/Open Watcom to run better in DosBox on Linux.
- Upgraded the examples for ARM Cortex with IAR to the latest IAR EWARM version 6.10.
- Upgraded the examples for ARM Cortex with CodeSourcery to the latest Sourcery G++ 2010.09-66.
Version 4.1.05, 2010-11-01
This release is adds examples for the QM (QP Modeler) graphical modeling and code generation tool. The examples are based on the "Fly 'n' Shoot" game described in the QP/C++ Tutorial and in Chapter 1 of the PSiCC2 book.
Specifically, the directory <qpcpp>/examples/80x86/dos/watcom/l/game-qm/ contains the "Fly 'n' Shoot" game model file "game.qm". This model, when opened in the QM tool contains all state machine diagrams and generates code into the subdirectory qm_code/. This code can then be built and executed on any 80x86 machine (newer versions of Windows or Linux require the DOSbox application, seehttp://www.dosbox.com).
The directory <qpcpp>/examples/arm-cortex/vanilla/iar/game-ev-lm3s811-qm/ contains the version of the game for the EV-LM3S811 ARM Cortex-M3 board. This directory contains the model file "game.qm", which is actually identical as the model in the DOS version. The LM3S811 version needs to be compiled with the IAR compiler and executed on the EV-LM3S811 board.
Additionally, the QP/C++ baseline code has been slightly modified for better conformance to the MISRA C++ 2008 rules and the latest PC-Lint 9.x.
Version 4.1.04, 2010-05-16
This release is adds compatibility of all examples for DOS with the DOSBox emulator (http://www.dosbox.com/) that recreates a MS-DOS compatible environment on all versions of Windows, including 64-bit Windows that don't run 16-bit DOS applications anymore.
Also, this release includesQP ports and examples for EV-LM3S811 board with the GNU-based Code Sourcery G++ toolset. Support for Sourcery G++ provides a very cost-effective option for developing QP Applications for ARM Cortex MCUs.
Finally, this release improves the Cortex Microcontroller Software Interface Standard (CMSIS) for the whole family of the Stellaris LM3Sxxx MCUs. The improvement extends the CMSIS from Sandstorm to Fury, DustDevil, and Tempest Stellaris families.
Version 4.1.03, 2010-01-21
This release is concerned with the ARM Cortex ports and examples. Specifically, this release contains the following improvements:
- Unified source code for ARM Cortex-M3 and the new ARM Cortex-M0 cores, including the code for the preemptive QK kernel.
- Compliance with the Cortex Microcontroller Software Interface Standard (CMSIS) in all ARM Cortex examples.
- Backward-compatible support for the new LM3S811 EVAL Rev C board with different OLED display than previous revisions. (NOTE: The OSRAM 96x16x1 OLED used in REV A-B boards has been replaced RITEK 96x16x1 OLED used in Rev C.)
In the process of making the examples CMSIS-compliant, the dependency on the Luminary Micro driver library (driverlib.a) has been completely removed.
Additionally, the screen saver of the "Fly 'n' Shoot" game has been improved to periodically switch off the power of the OLED display, which better protects the display from burn-in. The affected file is tunnel.cpp.
Finally, this release introduces the QP_VERSION macro, which identifies theQP version. Otherwise, this maintenance release does not change the QP/C API in any way, so the release has NO IMPACT on the QP/C applications except for the ARM Cortex ports and applications.
Version 4.1.02, 2010-01-14
The purpose of this minor maintenance release is the change in the directory structure for the ARM Cortex ports and examples. As new ARM Cortex cores are becoming available, the old port name "cortex-m3" could be misleading, because it actually applies to wider range of ARM Cortex cores. Consequently, all ARM Cortex ports and examples are hosted in the directory tree called "arm-cortex".
This maintenance release does not change the QP/C++ API in any way, so the release has NO IMPACT on the QP/C++ applications except for the ARM Cortex ports.
Version 4.1.01, 2009-11-05
The main purpose of this release is to replace the Turbo C++ 1.01 toolset with the Open Watcom C/C++ toolset, because Turbo C++ 1.01 is no longer available for a free download. In contrast, Open Watcom is distributed under an OSI-certified open source license, which permits free commercial and non-commercial use. Open Watcom can be downloaded from www.openwatcom.org.
All 80x86/DOS and 80x86/qk ports and examples for Turbo C++ 1.01 have been replaced with ports and examples for Open Watcom. The make.bat scripts are provided to build the QP/C++ libraries and examples.
In the process of converting the examples to Open Watcom two new examples have been added to the standard QP/C++ distribution. The Calc2 example located in <qpcpp>/examples/80x86/dos/watcom/l/calc2 shows how to derive state machine classes withQP 4.x. The SLS example located in <qpcpp>/examples/80x86/dos/watcom/l/sls shows the implementation of the new State-Local Storage state design pattern.
Version 4.1.00, 2009-10-09
The release provides brings a number of improvements to QP/C++ and updates the QP/C++ ARM Cortex-M3 examples for the EK-LM3S811 board to the latest IAR EWARM 5.40. Due to the acquisition of Liminary Micro by Texas Instruments the directory IAR structure for the examples and drivers has changed and theQP examples had to be changed accordingly.
This maintenance release does not change the QP/C++ API in any way, so the release has NO IMPACT on the QP/C++ applications.
The main changes inQP v4.1.00 with respect to earlier versions are as follows:
- in qs.h added a new trace record QS_QEP_DISPATCH logged when an event is dispatched to a state machine. This timestamped trace record marks the beginning of an RTC step. The end of the RTC step is marked by the existing timestamped trace records QS_QEP_INTERN_TRAN, QS_QEP_INIT_TRAN, and QS_QEP_IGNORED, depending on how the event is handled. The new QS_QEP_DISPATCH record facilitates measurement of the RTC step lengths.
- in qhsm_dis.cpp added generation of the QS_QEP_DISPATCH trace record.
- in the tools/qspy/ sub-directory added output of the new trace record to the Q-SPY host application.
- in the tools/qspy/matlab/ sub-directory added processing of the new trace record to the qspy.m script.
- in qpset.h changed the implementation of the Priority Set. In particular, the QPSet64 now derives from QPSet8, which enables a common way of testing for non-empty set (e.g., useful in assembly). Also, the findMax() functions in QPSet8 and QPSet64 now can work with an empty set, in which case they return 0.
- in qk_sched.cpp simplified the QK_schedule_() function to skip the testing of the ready-set for non-empty condition. Such test is no longer necessary. The test can still be performed outside the QK_schedule_() function (e.g., in assembly) to avoid calling the scheduler if the ready set is empty.
- in qk_ext.cpp simplified the QK_scheduleExt_() function in the same way as QK_schedule_().
- modified make.bat files for buildingQP libraries in the ports/ directory to use the externally defined environment variables for the location of the toolchains. The defaults are applied only when the environment variable is not defined. This enables greater flexibility in installing the development tools in different directories than those chosen by Quantum Leaps.
- modified the ARM Cortex-M3 examples for the new IAR EWARM 5.40.
- modified slightly the Calculator example to allow extensibility.
- in the ARM Cortex-M3 port file qk_port.s added explicit testing of the QK_readySet_ set for empty condition. This test allows avoiding calling the QK scheduler and two contex-switches if the ready-set is empty.
- in the game example moved setting up the QS filters from main.cpp to bsp.cpp.
Version 4.0.04 (Product) Apr 09, 2009
The maintenance release introduces the virtual destructor in the QHsm and QFsm base classes. This is done to allow proper handling of virtual functions in the subclasses of QHsm or QFsm. Please note, however, that the change increases the size of every state machine object by the additional (hidden) virtual pointer (vptr).
Also, this release provides a fix for the compile-time assertions, which did not work correctly for the GNU compiler family.
Finally, the ARM Cortex-M3 examples have been recompiled with the newer IAR EWARM v5.30.
This maintenance release does not change the QP/C++ API in any way, so the release has NO IMPACT on the QP/C++ applications.
The main changes inQP v4.0.04 with respect to earlier version are as follows:
- in qep.h file, virtual destructors have been added to QFsm and QHsm.
- in qassert.h file theQ_ASSERT_COMPILE macro has been modified to render a negative array dimension when the asserted condition is not TRUE.
Version 4.0.03, 2008-12-27
The main purpose of this release is to fix a bug in the QK preemptive kernel, which occurs only when the advanced QK features are used. Specifically, the QK priority-ceiling mutex could interfere with QK thread-local storage (TLS) or QK extended context switch. When the QK mutex is in use, the TLS or the extended context for this task could get saved to an incorrect priority level.
The release 4.0.03 fixes the bug by strictly preserving the semantics of QK_currPrio_ variable. The mutex locking now uses a different variable QK_ceilingPrio_, which represents the ceiling-priority locked by the mutex. The QK scheduler and extended scheduler now perform an additional check to make sure that only tasks with priorities above the ceiling can run. To avoid that additional overhead, the user can define the macro QK_NO_MUTEX, which eliminates the QK mutex API and eliminates the additional tests in the QK schedulers.
This maintenance release does not change the QP/C++ API in any way, so the release has NO IMPACT on the QP/C++ applications.
The main changes inQP v4.0.03 with respect to earlier version are as follows:
- in qk.h file, made the QK mutex API only visible when the macro QK_NO_MUTEX isnot defined.
- in qk_pkg.h file, added the QK_ceilingPrio_ external declaration when the macro QK_NO_MUTEX is not defined.
- in qk_mutex.cpp file, changed priority-ceiling mutex implementation to use the QK_ceilingPrio_ instead of QK_currPrio_. Also, added compiler error when the macro QK_NO_MUTEX is definedthis and this file is included in the build.
- in qk_sched.cpp file added testing priority against the QK_ceilingPrio_, when the macro QK_NO_MUTEX is not defined.
- in qk_ext.cpp file added testing priority against the QK_ceilingPrio_, when the macro QK_NO_MUTEX is not defined.
Version 4.0.02, 2008-11-15
This maintenance release does not change the QP/C API in any way, so the release has NO IMPACT on the QP/C++ applications.
The main changes inQP v4.0.02 with respect to earlier version are as follows:
- in qep.h file, added comments to macros Q_TRAN() and Q_SUPER() to suppress the PC-lint warning about using the comma-operator (MISRA rule 42).
- in qhsm_in.cpp file, fixed a bug in the QHsm::isIn() function. - fixed a bug in tunnel.cpp file ("Fly 'n' Shoot" game). The constant event HIT_WALL was not declared static.
Version 4.0.01, 2008-06-09
This maintenance release is made to allow using QS software tracing with the GNU compiler for AVR (WinAVR). Specifically, the output of the strings residing in ROM has been fixed.
This maintenance release does not change the QP/C++ API in any way, so the release has NO IMPACT on the QP/C++ applications.
The main changes inQP v4.0.01 with respect to earlier version are as follows:
- in qs_.cpp file, updated the function QS::str_ROM_().
- in qs_str.cpp file, updated the function QS::str_ROM().
- in qvanilla.cpp file, function QF::run(), declared the temporary variables as static to save stack space, because QF::run() never returns and is not reentrant.
Version 4.0.00, 2008-04-07
This milestone release is made for the book /ref PSiCC2. The book describes in great detail this new release. The older "QP Programmer's Manual" is now phased out and is replaced with this hyper-linked /ref main_page "QP/C++ Reference Manual", which provides very detailed, easily searchable reference to the software. The book /ref PSiCC2 provides in-depth discussion of the relevant concepts as well as the design study ofQP v4.0.
The main changes inQP v4.0 with respect to earlier versions are as follows:
- the coding techniques for hierarchical state machines (HSMs) and the simpler finite state machines (FSMs) have changed. While the changes are quite simple, the backward compatibility with QEP 3.x has been broken, meaning that some manual changes to the state machines implemented with earlier versions are necessary. Please refer to the "QP/C++ Tutorial" Section /ref coding_hsm for more information about coding state machines with QEP 4.x.
- The main change is the signature of a state-handler function, which now returns simply a byte. This return type (typedef'ed as QState) is the status of the event-handling that the state handler conveys to the QEP event processor.
- The macro #Q_TRAN() must now always follow the return statement.
- The new macro #Q_SUPER() designates the superstate of the given state. Again, this macro must follow the return statement.
- Then two new macros #Q_HANDLED() and #Q_IGNORED() have been added to return the status of event handled and event ignored, respectively.
- all callback functions are now consistently called /c XXX_onYYY() or /c XXX::onYYY():
- Q_assert_handler() is nowQ_onAssert()
- QF::start() is now QF::onStartup()
- QF::cleanup() is now QF::onCleanup()
- the new header file qevent.h has been broken off the qep.h header file. qevent.h contains the QEvent class and other basic facilities used in the wholeQP. This new file allows easier replacement of the entire QEP event processor with custom event processors, if you wish do so.
- the macro QEP_SIGNAL_SIZE is renamed to #Q_SIGNAL_SIZE.
- the data type QSTATE is now deprecated. Please useQP::QState.
- the #QF_FSM_ACTIVE macro is now deprecated. Instead, please define #QF_ACTIVE_SUPER_ to the base class ofQP::QActive and #QF_ACTIVE_STATE_ to the data type represented state. By default, these macros are defined to use theQP::QHsm base class from the QEP hierarchical event processor, but you can replace the event processor, if you wish.
- the internal macro QACTIVE_OSOBJECT_WAIT_() is nowQACTIVE_EQUEUE_WAIT_().
- the internal macro QACTIVE_OSOBJECT_SIGNAL_() is nowQACTIVE_EQUEUE_SIGNAL_().
- the internal macro QACTIVE_OSOBJECT_ONIDLE_() is now #QACTIVE_EQUEUE_ONEMPTY_().
- the data members QActive::m_osObject and QActive::m_thread are now present only if the macros #QF_OS_OBJECT_TYPE and #QF_THREAD_TYPE are defined.
- theQP::QPSet class has been renamed to QP::QPSet64.
- the QPSet::hasElements() has been renamed QPSet64::notEmpty()
- the QS software tracing is now better integrated with allQP components. You no longer need to explicitly include qs_port.h, because it is automatically included when you define the macroQ_SPY. Also the file qs_dummy.h is included automatically when the macroQ_SPY isnot defined.
- the new header file qv.h now replaces the file qsched.h.
- the macros QF_SCHED_LOCK() and QF_SCHED_UNLOCK() are now obsolete.
- the native QF event queues (both the active object event queues and the "raw" thread-safe queues) are slightly more efficient by counting down the /c head and /c tail pointers rather than up. This leads to wrap-around at zero, which is easier (faster) to test than any other wrap-around point. Also the native QF event queues maintain the minimum of the free events in the queue rather the maximum of used events.
- the data member of QEQueue::nTot class is removed.
- the QF::publish() function has been re-written so that QF no doesnot need to lock the scheduler. The QF::publish() function posts events to active objects with scheduler unlocked starting from the highest-priority active objects. However, the event is protected from inadvertent recycling by incrementing its reference counter before the publish operation. After the event is posted to all subscribers, the garbage collector QF::gc() is called to decrement the reference counter and recycle the event, if necessary.
- the qf_run.cpp file is obsolete. The QF::run() function for the non-preemptive QV kernel is now implemented in the fileqv.cpp.
- the QF::tick() function has been rewritten to allow calling QF::tick() from the task context as well as from the interrupt context. The nested critical section around QF::tick() is no longer needed when it is called from the task level. Among others, this re-designeliminates the need for the recursive mutex in the POSIX QF port.
- the QMPool::init() function has been re-designed to optimally align the memory buffer in a portable and platform-independent way. This should bring some performance improvements on some CPUs (e.g., 80x86).
- the extended QK scheduler has been re-designed to save stack space. The extended context (e.g., coprocessor registers) are no longer saved on the precious stack, but rather in the active object.
- a bug has been fixed in handling of Thread-Local Storage (TLS) in the QK scheduler and extended scheduler.
- the -q (quiet) flag has been added to the QSPY host application.
- the support for two new compilers for Windows has been added for the QSPY host application. The application can now be build with the MinGW GNU compiler for Windows as well as the Microsoft Visual C++ 2005.
- theQP port to Linux has been improved by eliminating the need for recursive P-Thread mutex.
- theQP port to MicroC/OS-II has been upgraded to the latest version 2.86.
- all examples in the standardQP distribution have been cleaned up and updated to the latestQP API changes.
- all examples that use QF now contain the QS software tracing support.