Good to hear that QM works on your mac. Most examples in the QP/C and QP/C++ frameworks contain QM models, from which you can generate code. Also, there are some YT videos about state machines that involve QM: - State Machines Part-7:Automatic Code Generation - State Machines Part-8: Semantics of Hierarchical State Machines --MMS
Good to hear that QM works on your mac. Most examples in the QP/C and QP/C++ frameworks contain QM models, from which you can generate code. --MMS
Thanks Miro, yes indeed, long time no see :-) Getting my feet wet in QM once again. I realized my mistake, apparently I mounted DMG first and then tried to change the attributes. If I 1. Unmount qm_7.0.0-macos.dmg 2. Run xattr -c qm_7.0.0-macos.dmg 3. Mount qm_7.0.0-macos.dmg 4. Open qm Then everything works fine!
Hi Sergei, So nice to hear from you! Thanks a lot for your interest in QM. I can't reproduce the problem on my mac M2 Pro running Sonoma 14.6.1. Here is what I tested: 1. Downloaded qp_8.0.0-macos.zip from state-machine.com. This archive contains qm_7.0.0-macos.dmg in the sub-directory qp/qm/. 2. Mounted the qm_7.0.0-macos.dmg file without any change in the attributes. 3. When I click on qm.app in it, it says qm is damaged and can't be opened. You should eject the dmg. 4. Ejected the .dmg 5. Opened...
Hi Sergei, So nice to hear from you! Thanks a lot for your interest in QM. I can't reproduce the problem on my mac M2 Pro running Sonoma 14.6.1. Here is what I tested: 1. Downloaded qp_8.0.0-macos.zip from state-machine.com. This archive contains qm_7.0.0-macos.dmg in the sub-directory qp/qm/. 2. Mounted the qm_7.0.0-macos.dmg file without any change in the attributes. 3. When I click on qm.app in it, it says qm is damaged and can't be opened. You should eject the dmg. 4. Ejected the .dmg 5. Opened...
When I click on it, it says: “qm” is damaged and can’t be opened. You should move it to the Trash. And yes, I did $ xattr -c qm_7.0.0-macos.dmg
Thank you Miro, I will follow your recommendations. Edit: I already tested it and it works right out of the box. Now I got something to compare with to find where I went wrong. Cheers.
Thank you Miro, I will follow your recommendations. Cheers.
Hi bymalba, Thank you for your interest in the "Modern Embedded Systems Programming" course on YouTube. I obviously cannot help you with your custom VSCode/GCC/Ozone setup. But I have just added the STM32 NUCLEO-C031C6 board support to the project for lesson #34. Please download and try this out. The updates include the following additional sub-directories: - stm32c031-ucos2-keil contains pure uC/OS-II project for blinking the LED and controlling it with the button - stm32c031-uc_ao-keil contains...
clarifications and additions: Code in bsp.c is executed when main.c executes BSP_init() and BSP_start(); but that's it. When stepping into OSS_start(), it reaches os_cpu_a.s and gets into OSStartHang which is commented as follows: "should never get here"
Hello everyone, I am working with NUCLEO-C031C6. VSCode for as editor, GCC for compiler and Ozone for debugging. I am at lesson_34 and have not been able to get various examples working. It starts with using a prepared code and uCOS, which I got working close, but not exactly because I am using only one LED. But good enough to get the point. I modified the project to use Active object and followed the changes closely but must be missing something. The LED does not bling at all; when debugging I set...
Thank you so much for this tour of the architecture of QM. I'm cross referring your answers with the Qt doc and it's all starting to make sense. You got me started on the right track. Thank you again for taking the time to share this valuable info. --Martin
Hi Martin, Thank you for your interest in the QM modeling tool. For the Model part, are the objects composing it derived from Qt, or it is just a plain hierarchical collection of objects with no connection to Qt? The internal QM model is derived from Qt class QAbstractItemModel. The items in this model are all subclasses of the Item class that is specific to QM. This is pretty standard in models derived from QAbstractItemModel. If it does, does it uses the XML capabilities of Qt for the load/save...
Hi Martin, Thank you for your interest in the QM modeling tool. For the Model part, are the objects composing it derived from Qt, or it is just a plain hierarchical collection of objects with no connection to Qt? The internal QM model is derived from Qt class QAbstractItemModel. The items in this model are all subclasses of the Item class that is specific to QM. This is pretty standard in models derived from QAbstractItemModel. If it does, does it uses the XML capabilities of Qt for the load/save...
Hi Miro, I'm in the process of designing a UI application that is very alike QM. In short, I want to model a collection of registers with several attributes (name, address, access type, bit fields). This model has a strong hierarchy just like the abstract software system modeled by QM. Just like QM, I would like to be able to view the hierarchy tree, manipulate (add/remove) registers and fields, move them around, edit various properties of each fields, etc. The ultimate goal is to have different...
The purpose of my attempt was not reverse engineering, but it was an attempt to detect a bug in my code. :) Anyway, your answer helped me a lot to understand QHsm more. Thank you very much for your kind reply.
Hi M, The best available guide for porting the QS target-resident software tracing component is provided in the existing examples (directory qpc/examples or qpcpp/examples) . The QS-port generally consists of a few QS_onXXX() callback functions that setup the UART and provide the fine granularity time stamp. You can find such QS_onXXX() callback functions in the Board Support Package files (bsp.c in the QP/C examples and bsp.cpp in the QP/C++ examples). Additionally, to the QS callbacks, you need...
Hi J, Thank you for your interest in the QHsm hierarchical state machine implementation. I'm glad to hear that you experimented with it, but there is really no need to reverse-engineer the implementation because all of this has been thoroughly described in the two editions of the "Practical Statecharts" books, both available in free PDF downloads, please see: - https://www.state-machine.com/psicc - https://www.state-machine.com/psicc2 Specifically, Chatper 4 "Hierarchical Event Processor Implementation"...
Hi J, Thank you for your interest in the QHsm hierarchical state machine implementation. I'm glad to hear that you experimented with it, but there is really no need to reverse-engineer the implementation because all of this has been thoroughly described in the two editions of the "Practical Statecharts" books, both available in free PDF downloads, please see: - https://www.state-machine.com/psicc - https://www.state-machine.com/psicc2 Specifically, Chatper 4 "Hierarchical Event Processor Implementation"...
Hi. Is there a QS (the QSpy target resident part) porting guide available somewhere in the documentation? I need to use QS on STM32F407 board. But I think It's not ported to that platform. Or if it's already ported please provide any link/pointers etc. Thanks.
I have some questions regarding QFSM. I wrote the following code. void dummy(void) { volatile int i; i = 3; // (C) } QState motor_control_move_drive(motor_control * const me, QEvt const * const e) { dummy(); QState status_; switch (e->sig) { case Q_ENTRY_SIG: { //: status_ = Q_HANDLED(); break; } case INT_MOTOR_DRIVE_END_SIG: { status_ = Q_TRAN(&motor_control_move_braking); // (A) break; } default: { status_ = Q_SUPER(&motor_control_move); break; } } return status_; } QState motor_control_move_braking(motor_control...
Hi Lucca, Your suggestion to dispatch every event to all "Orthogonal Components" is precisely how most traditional implementations of "orthogonal regions" (a.k.a. AND states) work. You can find many examples of this, for instance in the book "Design Patterns for Embedded Systems in C" by Bruce Douglass. Specifically, Chapter 5, "Design Patterns for State Machines", Section 5.7 "AND-States" discusses such an implementation. Interestingly, the "Decomposed AND-State Pattern" presented in Section 5.8...
Hi Lucca, For my QP/C++ approach to this, check out: https://github.com/covemountainsoftware/cpputest-for-qpcpp/blob/master/cpputest-for-qpcpp-lib/include/cmsOrthogonalContainer.hpp and https://github.com/covemountainsoftware/cpputest-for-qpcpp/blob/master/cpputest-for-qpcpp-lib/include/cmsOrthogonalComponent.hpp In this case, the container is generic and manages N components. An individual component must be dervied from the above and implement the required interface. One requirement I imposed on...
Hi Lucca, Your suggestion to dispatch every event to all "Orthogonal Components" is precisely how most traditional implementations of "orthogonal regions" (a.k.a. AND states) work. You can find many examples of this, for instance in the book "Design Patterns for Embedded Systems in C" by Bruce Douglass. Specifically, Chapter 5, "Design Patterns for State Machines", Section 5.7 "AND-States" discusses such an implementation. Interestingly, the "Decomposed AND-State Pattern" presented in Section 5.8...
Will, in this case, all my dispatches execute at the same RTC step? Yes. That is the nature of the parent (container) AO's relationship with its "children" components. Each AO runs in its own thread (regardless of underlying scheduler) and all the components run in the same thread context of the parent AO.
Hello everyone, I'm standardizing the way I initialize all my orthogonal components inside an active object and reached a method that work very well. I'm, however, worried that by dispatching so many events at once (I only have a few atm, but might scale up in the future) I can overwhelm my active object's queue with events (in case they all during the dispatch also post to the parent container). Code for initializing the components: // Initialize all Orthognal Components for (uint8_t oc_index =...
Hello everyone, I'm standardizing the way I initialize all my orthogonal components inside an active object and reached a method that work very well. I'm, however, worried that by dispatching so many events at once (I only have a few atm, but might scale up in the future) I can overwhelm my active object's queue with events (in case they all during the dispatch also post to the parent container). Code for initializing the components: // Initialize all Orthognal Components for (uint8_t oc_index =...
Hi Eddie, I'm sorry for the late reply to your question. I'm not sure how to make the cmake work for testing. For now, please just use the regular make, as shown in all other standard examples. --MMS
Hi Christophe, I'm not sure how you search, but the "dedicated web-page for Arduino" is still there at the most logical URL I can think of: https://www.state-machine.com/arduino Please take a look at what's available. The provided free software should still work, although it is no longer the "latest and greatest" version. --MMS
Well, 9 years after, maybe time to refresh somewhat : I exactly did that (Arduino in teh search box), and I didn't find the "dedicated page", but I found this one, nice. The QP (nano?) approach seems much better to me than the poor attempt at libraries that are in the Arduino library catalog. Why didn't you ever submit it ? I'm interested in implementing (small) RL algorithms such as SARSA, I think using QP would be a real plus instead of poorly or ad-hoc designed state machines. I'll do some investigation...
Please see: - https://www.state-machine.com/qm/ui_model_file.html#ui_model_xsd - https://www.state-machine.com/qm/qm.xsd --MMS
Please see: https://www.state-machine.com/qm/ui_model_file.html#ui_model_xsd --MMS
Hello, I was looking through your documentation for the generated format for your .xml files (the once containing the qpc-model) Is this documented somewhere in an acessible manner (to implement an own parser) I am specifically interested about the sections describing the abstract syntax of the state machine and the transitions itself
Hi MMS, I'm trying to run the qutest examples /qpcpp/examples/posix-win32-cmake/dpp/qutest. Using the explanation provided in the CMakeLists file I have been able to build all the example and they work as they should but I can not see how to run the tests. If I run the built executable (./philo_test ) the application stops at waiting for a reset, I believe this because qutest is not running.
Hi Giulio, Please see the "Transition to History" design pattern for the description of the concept. Please note that this is the original description of the History pattern from the PSiCC2 book. The QM modeling tool, which has been created after that book was published fully supports transtitions to history (both shallow history and deep history.) But to make it more concrete for you, let's apply it specifically to the Modem state machine attached in the previous post. So, suppose that your Modem...
Hi Giulio, Please see the "Transition to History" design pattern for the description of the concept. But to make it more concrete for you, let's apply it specifically to the Modem state machine attached in the previous post. So, suppose that your Modem is in the middle of AT-command sequence, say in state "wifi_mode". This state has only only one transition OK, which is expected when everything goes fine. But suppose that ERROR event arrives instead. The "wifi_mode" state does not handle the ERROR...
Please see the "Transition to History" design pattern for the description of the concept. But to make it more concrete for you, let's apply it specifically to the Modem state machine attached in the previous post. So, suppose that your Modem is in the middle of AT-command sequence, say in state "wifi_mode". This state has only only one transition OK, which is expected when everything goes fine. But suppose that ERROR event arrives instead. The "wifi_mode" state does not handle the ERROR event, so...
Hi Miro, could you explain better (with an example) what do you intend when you say "transition to History"? Thanks a lot in advance! Giulio
I'm assuming that the OK, ERROR, and other responses are converted to events outside the Modem active object." That is a key point from Samek. Create a parser module. That module can run within the modem/cell AO if you like (the UART Rx ISR could send a character at a time to the AO in events), or run within the UART Tx ISR itself, POSTing output events. But the key point is the parser module would handle all the incoming bytes/characters until a single completed AT message is received. Then it would...
The fact that you are aware of the unsolicited responses is already a big positive. I had to rewrite some firmware some years ago because of this. That client would not pay for QP, so I had to re-invent the wheel, but I did implement using the active object pattern. Here is the starting point for some of my observations on this issue: https://covemountainsoftware.com/2020/07/18/extreme-asynchronous-firmware-design/
Hi dood444, I'm not aware of a ready-to-use example of an active object for a modem driven by AT commands. The beaten path approach is to send AT command and sleep or wait for the OK response. However, the ERROR responses or some other unsolicited responses are harder to manage this way. A hierarchical state machine approach, on the other hand, can deal with all this in an elegant way because a state machine doesn't block and can handle any event sequence. I've attached a state machine sketch that...
Hi dood444, I'm not aware of a ready-to-use example of an active object for a modem driven by AT commands. The beaten path approach is to send AT command and sleep or wait for the OK response. However, the ERROR responses or some other unsolicited responses are harder to manage this way. A hierarchical state machine approach, on the other hand, can deal with all this in an elegant way because a state machine doesn't block and can handle any event sequence. I've attached a state machine sketch that...
Hi dood444, I'm not aware of a ready-to-use example of an active object for a modem driven by AT commands. The beaten path approach is to send AT command and sleep or wait for the OK response. However, the ERROR responses or some other unsolicited responses are harder to manage this way. A hierarchical state machine approach, on the other hand, can deal with all this in an elegant way. I've attached a state machine sketch that could give you an idea how you might approach something like that. I'm...
Hi dood444, I'm not aware of a ready-to-use example of an active object for a modem driven by AT commands. The beaten path approach is to send AT command and sleep or wait for the OK response. However, the error responses or some other unexpected responses are harder to manage this way. A hierarchical state machine approach, on the other hand, can deal with all this in an elegant way. I've attached a state machine sketch that could give you an idea how you might approach something like that. I'm...
Hi dood444, I'm not aware of a ready-to-use example of an active object for a modem driven by AT commands. The beaten path approach is to send AT command and sleep or wait for OK response. However, the error responses or some other unexpected responses are harder to manage this way. A hierarchical state machine approach, on the other hand, can deal with all this in an elegant way. I've attached a state machine sketch that could give you an idea how you might approach something like that. I'm assuming...
Hi dood444, I'm not aware of a ready-to-use example of an active object for a modem driven by AT commands. The beaten path approach is to send AT command and sleep or wait for OK response. However, the error responses or some other unexpected responses are harder to manage this way. A hierarchical state machine approach, on the other hand, can deal with all this in an elegant way. I've attached a state machine sketch that could give you an idea how you might approach something like that. I'm assuming...
QM 6.2.2 doesn't show GUI on Ubuntu 22.04
Fixed in QM 6.2.3 --MMS
QM 6.2.2 doesn't show GUI on Ubuntu 22.04
Hello, As is known, when an AT command is sent in cellular modem communication, a requested response must be waited for the next transmission. Unsolicited responses may also be received. Also other active objects can make requests to the modem active object. Is there a similar example project or code with such a design?
Thanks a lot. Yes it confirms my expectation. Still it is a good suggestion to make the maintainer aware that the interrupts need to have these macros, if they are adding events for the Active objects anytime in future --Dhiren
Hi Dhiren, Under the preemptive QK kernel, every ISR that potentially posts/publishes events needs to call the QK_ISR_ENTRY()/QK_ISR_EXIT() macros. (The macros are just called, not "implemented" because they are already provided in the QK port). My question is whether I should implement the same for all the interrupts even though none of these interrupts are generating any event for the active object in my program If an ISR does not produce any events, it cannot activate any Active Objects, so it...
Hi Dhiren, Under the preemptive QK kernel, every ISR that potentially posts/publishes events needs to call the QK_ISR_ENTRY()/QK_ISR_EXIT() macros. (The macros are just called, not "implemented" because they are already provided in the QK port). My question is whether I should implement the same for all the interrupts even though none of these interrupts are generating any event for the active object in my program If an ISR does not produce any events, it cannot activate any Active Objects, so it...
Hi Dhiren, Under the preemptive QK kernel, every ISR that potentially posts/publishes events needs to call the QK_ISR_ENTRY()/QK_ISR_EXIT() macros. (The macros are just called, not "implemented" because they are already provided in the QK port). My question is whether I should implement the same for all the interrupts even though none of these interrupts are generating any event for the active object in my program If an ISR does not produce any events, it cannot activate any Active Objects, so it...
You only need to employ the entry & exit segments for ISRs that generate events (I believe these are called "QP aware" interrupts). This is because any ISR that generates events could make ready a higher priority AO than the one that was pre-empted by the interrupt, and so of course we want. to run the scheduler on exit. But an ISR that generates no events cannot make ready an AO that was blocked (only new events can new that), so running the scheduler wouldn't hurt, but it would be useless. I suspect...
Hi, I am implementing QK for the first time. I am replacing QV which I had already implemented Now as per the book, it is mentioned the kernel must be notified about entering and exiting an interrupt. Specifically, every interrupt must call the QK scheduler upon exit, to give the kernel a chance to handle the asynchronous preemption I have implemented this(QK_ISR_ENTRY(); and QK_ISR_EXIT();) for the timer interrupt which is used for timeout event signal for my active objects My question is whether...
Thanks a lot for the comments. The just released QM version 6.2.2 fixes a couple of minor issues precisely with submachines. But this most likely will be the last QM version that has submachines. From what I hear from the trenches, embedded developers have been often confused and misused submachines and submachine states. Some folks used submachines in place of regular composite states, which is overkill. Some other folks used submachine states only because they were rendered in a different color,...
Thanks a lot for the comments. The just released QM version 6.2.2 fixes a couple of minor issues precisely with submachines. But this most likely will be the last QM version that has submachines. From what I hear from the trenches, embedded developers have been often confused and misused submachines and submachine states. Some folks used submachines in place of regular composite states, which is overkill. Some other folks used submachine states only because they were rendered in a different color,...
I've been waiting for the addition into QHsm, have a design that would benefit by removing quite a bit of duplicated code. I'd put it in the "nice-to-have" category, have been designing great state-machines with QP since 2005 without them. To answer your question directly, no, not used in any current or past projects.
I've been on 2 projects where submachines were used, and they were scrapped / aborted. One early on (maybe 2017 or 18?) because of a bug or two specific to submachines (way back -- can't remember the details, I'd probably have to go into QP history to find which submachine bugs were fixed The other one, the engineers just couldn't understand them / figure them out (it also wasn't the best use case) I'm all for simpler code and a smaller codebase, you will not hear any squawking or complaining from...