Activity for Panopticon

  • Panopticon Panopticon posted a comment on discussion Free Support

    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...

  • Panopticon Panopticon posted a comment on discussion Free Support

    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...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Jim, I should confess I should go back and re-read your original post, but can it be accomplished with something like this: whoever knows the SPI AO should be paused (maybe it's the SPI AO itself) does a LIFO post saying "Pause yourself", SPI AO goes to PAUSE state, while in PAUSE state other events are deferred until TX COMPLETE interrrupt, which posts UNPAUSE to SPI AO, then SPI AO resumes. I know there are probably some corner cases and concerns about event ordering, but I've often found the framework...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Unfortunately this isn't correct. Each bit (0 or 1) must be held for a minimum of 60 usec; the 1 usec time you see is the minimum recovery time in between bits. The datasheet says: All write time slots must be a minimum of 60µs in duration with a minimum of a 1µs recovery time between individual write slots. Like almost all I2C / SPI / 1-wire devices, you can always run the device slower than the max speed, but you can't run it faster. In other words, your write time slot can be 1ms instead of 60...

  • Panopticon Panopticon modified a comment on discussion Free Support

    Miro -- the original poster has a 1 MHz tick rate (1 microsecond tick period). My jaw hit the floor when I read this... Tuyen -- I'm pretty sure you can't read the temperature sensor that quickly, and also from a physics perspective and the sensor bandwidth what sampling rate makes sense -- maybe 100 Hz? I could imagine 1 kHz (I know somebody who used the QP in a real-time closed loop temperature control system who did this) but any faster doesn't make sense to me.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Miro -- the original poster has a 1 MHz tick rate (1 microsecond tick period). My jaw hit the floor when I read this...

  • Panopticon Panopticon posted a comment on discussion Free Support

    if (defer(&cmdQueue, e)) // If we don't add above check then will queue will get over written or crash due to boundary cross?? I am ok for queue over written.. If the queue is full and you attempt to defer into the full queue, the framework will assert. It will not "crash" (it will enter Q_onAssert() if you are running before 7.3.0) and it will not overwrite one of the elements. I'm assuming you understand that the framework asserts when you do something that won't work. This is one of those cas...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Sorry for thread-hijacking but this reminds me of the quote: "The nice thing about standards is that you have so many to choose from; furthermore, if you do not like any of them, you can just wait for next year's model." (Andrew Tanenbaum) When I worked at a big company that everybody's heard of (2 decades ago), everyone was drinking the POSIX Kool Aid until it turned out to be a clown show. And then on the ops side, Java promised "write once, run everywhere" (particularly with GUI apps) and that...

  • Panopticon Panopticon posted a comment on discussion Free Support

    I see what's going on here... sometimes "peeking behind the curtains" can be dangerous. the Q_RET_ENTRY & Q_RET_EXIT are used for the QMSM class -- this is always generated code by the modeling tool. It seems you are hand-coding, or hand-modifying, code that was generated by the modeling tool? If you're using the QHsm base class, the Q_HANDLED() return is the right choice (which just turns into Q_RET_HANDLED, but you should always use the macros because they might do other things behind the scene)....

  • Panopticon Panopticon posted a comment on discussion Free Support

    I've been using QP for 20 years (almost exactly to the day) and I've never seen Q_RET_EXIT. These are probably internal definitions that aren't intended to be user-facing. (But in C there is no concept of namespaces and access specifiers) Entry and Exit actions should finish with Q_HANDLED().

  • Panopticon Panopticon modified a comment on discussion Free Support

    Hi Peter, I can talk a little about your question (Arduino libs) I've been using the QP since 2003 (I bought the first edition of Miro's book in Germany in late 2003), I've been using RTOSes & preemptive schedulers for another decade before that. Not a humble brag, just trying to indicate I'm coming from a place of real-world experience. For the first time in my career, I pretty much had to (for the client) port / use a nasty, spinning/blocking Arduino library in a QP system. The product was running...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi Peter, I can talk a little about your question (Arduino libs) I've been using the QP since 2003 (I bought the first edition of Miro's book in Germany in late 2003), I've been using RTOSes & preemptive schedulers for another decade before that. Not a humble brag, just trying to indicate I'm coming from a place of real-world experience. For the first time in my career, I pretty much had to (for the client) port / use a nasty, spinning/blocking Arduino library in a QP system. The product was running...

  • Panopticon Panopticon posted a comment on discussion Free Support

    From the QP documentation for the "margin" parameter: margin -- the **minimum free slots **in the queue, which must still be available after posting the event. Do you have 65535 free slots in your queue?

  • Panopticon Panopticon posted a comment on discussion Free Support

    So it looks like around time 0487053391 when the IQSENSOR_EVALUATE_FIFO_SIG is dispatched, starting at that time, we no longer dispatch IQSENSOR_POLL_DATA_SIG events any more (even though they are being posted to the queue, which is filling up) Are you running QV, or QK, or an RTOS, or... (sorry if that was already mentioned) I suspect that something is gobbling up all the CPU. Either the processing of that last IQSENSOR_EVALUATE_FIFO_SIG at '3391 or some other thing is just grinding away in a run-to-completion...

  • Panopticon Panopticon modified a comment on discussion Free Support

    If the (large) queue is eventually overflowing, it is a classic producer-consumer problem. This is one of the fundamental issues described by Queueing Theory. Your problem, generally stated, is that you are producing events for that AO / Queue, on average, faster than you are consuming (producing) them. So "it's just this easy" -- either you're producing more events per unit time than you think, or you're maybe blocking / pausing / spinning in your run-to-completion event-handling code, instead of...

  • Panopticon Panopticon posted a comment on discussion Free Support

    If the (large) queue is eventually overflowing, it is a classic producer-consumer problem. This is one of the fundamental issues described by Queueing Theory. Your problem, generally stated, is that you are producing events for that AO / Queue, on average, faster than you are consuming (producing) them. So "it's just this easy" -- either you're producing more events per unit time than you think, or (we can't see your code, so I'm speculating) you're maybe blocking / pausing / spinning in your run-to-completion...

  • Panopticon Panopticon posted a comment on discussion Free Support

    As you probably suspected, you need to manually create the signals enum (usually in a header file) and then #include that file in your QM-generated files. Part of understanding QM is understanding what it does and what it doesn't do. It generates all the state machine code for you -- all the state-handler functions, all the state transitions, the matching events to states, etc. but it doesn't know anything about what code to call when something happens (that's where you add your code). Similarly...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Have you already studied and fully understood the simpler included examples such as the blinking LED and the dining philosophers (DPP)? Those examples showcase almost all of the functionality of the framework -- publish subscribe, timers, state hierarchy, dynamic event allocation & garbage collection, tracing, etc. I'm curious what you are looking for in something more complex, normally complexity makes things harder to understand. I've worked on many large projects with QP (none are open source),...

  • Panopticon Panopticon modified a comment on discussion Free Support

    To paraphrase Andrew Tanenbaum's quote about standards: "The good thing about RTOS APIs is that there are so many to choose from." It's maddening. The last time I looked at Micrium's API for creating a task, I think it took 13 arguments...

  • Panopticon Panopticon modified a comment on discussion Free Support

    To paraphrase Andrew Tanenbaum's quote about standards: "The good thing about RTOS APIs is that there are so many to choose from." It's maddening. The last time I looked at Micrium's API for creating a task, I think it took 13 arguments...

  • Panopticon Panopticon posted a comment on discussion Free Support

    To paraphrase Andrew Tanenbaum's quote about standards: ""The good thing about RTOS APIs is that there are so many to choose from." It's maddening. The last time I looked at Micrium's API for creating a task, I think it took 13 arguments...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Ah OK thank you, from what TA99 wrote: Apparently e->sig is changing contents while running switch case. when i save e->sig in a local variable before entering switch call, i get the expected signal. I thought it must be something else. Since the local temp copy is probably on the stack (or really more likely, in a register) then any memory corruption in an event would not harm the local copy (esp. if in a register) One mistake folks often make when hand-coding is putting code outside the switch...

  • Panopticon Panopticon modified a comment on discussion Free Support

    Yikes! This is not good -- the value in e->sig should not change while you are processing the event. So, while I am happy that you found a workaround, please keep in mind that this is a workaround, and something else is going on. Someone is probably writing past the end of an event, and it is corrupting the "sig" field of the event after it in the event pool. Even if your workaround is OK for now, don't forget that you still have something weird going on that needs to be found and fixed. :-/

  • Panopticon Panopticon posted a comment on discussion Free Support

    Yikes! This is not good -- the value in **e->sig** should not change while you are processing the event. So, while I am happy that you found a workaround, please keep in mind that this is a workaround, and something else is going on. Someone is probably writing past the end of an event, and it is corrupting the "sig" field of the event after it in the event pool. Even if your workaround is OK for now, don't forget that you still have something weird going on that needs to be found and fixed. :-/

  • Panopticon Panopticon posted a comment on discussion Free Support

    Unfortunately with the information provided, it's hard to answer. There are many things that could be happening here, but debugging it via a chat thread is almost impossible. For starters, we'd need to see the P/S init code. I suspect that you don't have a P/S table with almost 4000 signals, so you probably aren't receiving a published signal. (question: have you seen that the published signals should be the "low end" of the signal space?) Secondly, maybe somebody is direct-posting the event, and...

  • Panopticon Panopticon posted a comment on discussion Free Support

    I will just jump in here to say a couple things... From a quick reading of the code, it seems like TA99 is "explicitly" ignoring EMPTY / INIT / ENTRY / EXIT is so that "default" catches ALL use signals, which then get printed, and optionally handled. I wouldn't do it this way and this isn't maintainable (QL always reserves the right to add other signals besides these 4 in the future, hence Q_USER_SIG) but I think I understand conceptually what the intent is. Beyond my comment about maintainability,...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Yes I think this is a bug in the QM documentation. For as long as I can recall (pun intended), QActive_recall() has returned a bool indicating whether or not an event was recalled from a deferral queue. Just checked 7.1.3 code and that appears to still be true. There have been multiple clients I've worked with who seemed to be under the impression that recall() returns a pointer to the recalled event, I never knew why, maybe this is why...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Peter, thanks for the taking the time to come back and post the answer to your question once you've solved it. Chances are high that someone else will have a similar question and your post will help.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi, Please see this answer: https://sourceforge.net/p/qpc/discussion/668726/thread/ae9254b572/?limit=25#0325

  • Panopticon Panopticon posted a comment on discussion Free Support

    is it possible to run under control of the debugger and set a breakpoint in Q_onAssert()? Then you can look at the call stack. (Honestly I don't use the AVR so I don't know if any of this is possible)

  • Panopticon Panopticon modified a comment on discussion Free Support

    Regarding your 2nd question about posting vs. publishing and triggering the scheduler: If you are running the non-preemptive QV scheduler, a post, and a publish, put one or more events(*) into active object queues, but the scheduler won't run anyway until the posting AO finishes its RTC step. So: no difference. Regarding publishing under a preemptive scheduler (QK or RTOS): that behavior has changed/evolved over time. But presumably your question is about the present times (unless you are using an...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Regarding your 2nd question about posting vs. publishing and triggering the scheduler: If you are running the non-preemptive QV scheduler, a post, and a publish, put one or more events(*) into active object queues, but the scheduler won't run anyway until the posting AO finishes its RTC step. So: no difference. Regarding publishing under a preemptive scheduler (QK or RTOS): that behavior has changed/evolved over time. But presumably your question is about the present times (unless you are using an...

  • Panopticon Panopticon modified a comment on discussion Free Support

    While I understand the desire for something like this for testing, I do have a concern about this request. It's not for me to decide if the request is honored, of course. Definitely understand the needs of testing. We've all seen the goofy stuff like #define'ing "static" to whitespace to give symbols external linkage, and #define'ing "private" to "public" when building for test. All of us feel sad when we see that. My concern about the request is that once a public API to read this information is...

  • Panopticon Panopticon posted a comment on discussion Free Support

    While I understand the desire for something like this for testing, I do have a concern about this request. It's not for me to decide if the request is honored, of course. Definitely understand the needs of testing. We've all seen the goofy stuff like #define'ing "static" to whitespace to give symbols external linkage, and #define'ing "private" to "public" when building for test. All of us feel sad when we see that. My concern about the request is that once a public API to read this information is...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hey Bugs, As Miro indicated in the other thread, guards on initial transitions aren't permitted in UML, and thus they're not possible using QM. If you hand-coded the state machine, you could, but you don't want to do that (thankfully). Typically the way to do this is on the initial transition, post an event to yourself (e.g. "GO_ACTIVE", "GO_STANDBY", etc.) and transition to a purgatory state where you will then receive the event and transition to the desired "starting state". Let me know if that...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Thank you Miro for the explanation. I can understand the corner case (warning: danger lurks here!) for copying data from big events (e.g. ethernet packets, etc.) Every language designer, every framework designer, every library designer has to make that decision every so often, weighing the pros and cons of whether to expose certain details, whether to give the user certain privileges. Glad it's not me! Thank you for the excellent reply.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Can you guys please remind me here? Harry talked about event deferral, I thought defer() / recall() took care of reference counting, why are we employing the manual reference-count manipulation here? Generally speaking, the whole idea of reference counting is that it is handled "behind the scenes" and yet we are manually twiddling knobs here. And actually the follow up is a question, I'm sure it's been discussed previously: why the addition of APIs that allow manipulation of the event's reference...

  • Panopticon Panopticon posted a comment on discussion Free Support

    I know this doesn't help Edwin very much but I just tried downloading the file from 2 different computers with 2 different OSes (MacOS & Windows) and both worked fine. Edwin, maybe try any of the following: * can you use your phone as a hotspot & download over that connection? * can you try from another computer (ideally w/ different OS) * can you have a colleague / friend / etc. try, maybe from a different site? Debugging connectivity issues can be an intractable problem.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi June, you mentioned the old & new versions of QM, but did you also change versions of QP? If so, what was the old version of QP, what is the new version of QP? There are some "warnings" about pools, specifically alignment and pool size, you might be aware of them: https://www.state-machine.com/qpcpp/class_q_p_1_1_q_m_pool.html#a5c9795bf9d76d4a6c30c2e341c182dfa From my reading of the pool init code, it looks like the assertion must be one of the following: * null pointer for memory you supply *...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Not surprisingly, Miro has written about the Open/Closed topic too: https://embeddedgurus.com/state-space/2012/06/rtos-tdd-and-the-o-in-the-s-o-l-i-d-rules/

  • Panopticon Panopticon posted a comment on discussion Free Support

    Giulio - You make a good point about separation between the physical interface and the downstream processing of the protocol. How I typically handle this is as follows: let's say you have 3 UARTs (A,B,C) and each UART has a different protocol (e.g. proprietary, MODBUS, and PPP just for example) What I would do is have one UART AO class, and instantiate it 3x. And in the constructor for each I would specify channel/HW device, baud rate, parity, etc. Also in the constructor, I would specify a "callback...

  • Panopticon Panopticon posted a comment on discussion Free Support

    I agree with Miro's sentiments here. The only time I've done the start/stop/re-start thing, this was ~7-8 years ago, is because I was working on a very resource-constrained system, and there wasn't enough RAM for all 8 AOs to run at the same time. As it turns out, 2 of the 6 AOs were for communications interface that never were active at the same time. So if for example the CAN interface was active, the WiFi interface was inactive, and vice-versa. Of course there was coordination about switching...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Quick question: are you needing something like a "suspend/resume" in an RTOS? The AO "stop" is more like "terminate", as opposed to suspend. Maybe that's OK with you and what you want. But before proceeding I wanted to understand what you want / need. I haven't done it, so you'd have to read the docs and/or try it, but I think you can re-init a stopped active object, and get it back into a state where it can be started again.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Just inventory'ing embedded graphics libs here (ignoring things like Qt and WinCE, which IMO are really suited for desktop systems masquerading in kiosks & automobiles We've already mentioned: TouchGFX LVGL Crank Segger emGUI Others I've seen used (all sorts of tradeoffs in cost, source available, etc. - not vouching for or advocating any of these) Micrium's uC/GUI (might be re-badged Segger?) uGFX -- I believe this is with source, and free for personal/edu/open source (but check license for yourself)...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Thanks for following up, David. Makes sense.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Thanks David, if you are able to share the code, perhaps someone else can work on smoothing the text (and perhaps that would even benefit the work project) I remember the 747 Disco GUI example now that you describe it. I had to basically port it from FreeRTOS to Micrium as a part of a PoC, but unfortunately that project didn't use QP so I never ported it over.

  • Panopticon Panopticon posted a comment on discussion Free Support

    It means that the timer has expired and the timeout event has been posted. The problem with this response is that it doesn't tell us if we have RECEIVED that event. Yes that is correct. The return value simply says "the event has been put in your queue." Whether or not the event has already been processed, that is entirely up to your application. "Received" is a little bit of a tricky word here ... I tend to think of "enqueued" and "processed"... for example, if mail is put into your mailbox, I'd...

  • Panopticon Panopticon modified a comment on discussion Free Support

    I think the question is: when the timeout event is received, is the timer disarmed at that point? Maybe. It depends... the 3rd parameter of the QTimeEvt_armX() API call is the interval. If the interval is 0, it is a one-shot (as opposed to periodic) timer. A one-shot timer is automatically disarmed when it expires (and this also causes an event to be posted to the queue). Related: The QTimeEvt_disarm() API call guarantees the timer is stopped when the call returns; the return value is a boolean that...

  • Panopticon Panopticon modified a comment on discussion Free Support

    I think the question is: when the timeout event is received, is the timer disarmed at that point? Maybe. It depends... the 3rd parameter of the QTimeEvt_armX() API call is the interval. If the interval is 0, it is a one-shot (as opposed to periodic) timer. A one-shot timer is automatically disarmed when it expires (and this also causes an event to be posted to the queue). Related: The QTimeEvt_disarm() API call guarantees the timer is stopped when the call returns; the return value is a boolean that...

  • Panopticon Panopticon posted a comment on discussion Free Support

    I think the question is: when the timeout event is received, is the timer disarmed at that point? Maybe. It depends... the 3rd parameter of the QTimeEvt_armX() API call is the interval. If the interval is 0, it is a one-shot (as opposed to periodic) timer. A one-shot timer is automatically disarmed when it expires (and this also causes an event to be posted to the queue). The disarm API call guarantees the timer is stopped when the call returns; the return value is a boolean that indicates if the...

  • Panopticon Panopticon posted a comment on discussion Free Support

    I think the question is: when the timeout event is received, is the timer disarmed at that point? Maybe. It depends... the 3rd parameter of the QTimeEvt_armX() API call is the interval. If the interval is 0, it is a one-shot (as opposed to periodic) timer. A one-shot timer is automatically disarmed when it expires (and this also causes an event to be posted to the queue). The disarm API call guarantees the timer is stopped when the call returns; the return value is a boolean that indicates if the...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Ooops -- brain fart -- Miro beat me to the punch, and of course he is correct. Not good brain functioning before first cup of coffee. I was thinking a direct transition from A to B (peers) based on the event, but of course the way you described it, the event was caught at a superstate. Please ignore my post, it's not helpful

  • Panopticon Panopticon posted a comment on discussion Free Support

    I believe your understanding and expectation is valid / correct. Without seeing the actual code (your code, not the QEP) it's hard to say for sure what is happening or why. I understand you cannot just post proprietary code. Are you using QM to generate the code or is the code hand-coded? And (using QSPY etc.) are you confident that the state the event is trapped/caught in is what you think it is, and also that the transitions (exits/entries) are what you are describing here? Sorry if this sounds...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi - What have you tried so far? Where have you encountered obstacles?

  • Panopticon Panopticon posted a comment on discussion Free Support

    Glad to hear you're past the problem. Thanks for following up, Andy.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Andy thanks for the video, IMO that is a great way to walk through the issue. Do you see this all the time, or just "every so often"? Because it's possible that when you go to disable the timer on exit, that it's already expired and posted the event into your queue. So by the time you get to the next state, the timeout event is working its way down through the queue and hits you in the new state. It's not clear if that dns_A_query_sample() call could take a while, that sounds like something that...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi Giulio, I think there might be a misunderstanding. You said: I'm wondering why the framework can't manage this situation with a single memory pool where we can alloc space for each dynamic event. You can certainly do this in QP. With QP, you can create as many different pools as you like (limited by the amount of RAM in your system, of course). For example, you could create pools as follows (just an example, you can change the numbers to match your own needs): Pool 1: 8 events total, each event...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Why do you say Ev1 is an internal transition? I believe both are self transitions the way you have them drawn. Ev1 would be an internal transition if the destination of the transition wasn't the border of the state. Both transitions start and end on the border of the states. They are both self transitions. The tool doesn't care about the topology of the line, only where the transition starts and ends. If Ev1 ended in a square box (not connected to the state's border) it would be an internal transition....

  • Panopticon Panopticon modified a comment on discussion Free Support

    I've also used "just HSMs" for complex interrupts (ISRs) in bit-banging communications protocols where the original ISR was a mess of flags. Think of things like PPP, HDLC, or bit-banging UART or even I2C or SPI. Sometimes due to low power requirements, you do almost everything in ISRs and very little if anything in "background" code (where AOs would run). I realize that this is literally very far from Wade's specific use case (Windows / non-interrupt) but conceptually it is almost identical; using...

  • Panopticon Panopticon posted a comment on discussion Free Support

    I've also used "just HSMs" for complex interrupts (ISRs) in bit-banging communications protocols where the original ISR was a mess of flags. Think of things like PPP, HDLC, or bit-banging UART or even I2C or SPI. Sometimes due to low power requirements, you do almost everything in ISRs and very little if anything in "background" code (where AOs would run).

  • Panopticon Panopticon posted a comment on discussion Free Support

    The extensions you propose to QP would lower the overall performance of QP for things it does well in order to handle a rather unique set of circumstances. Personally, I don't think the trade-off is worth it. Well said. (I also don't have a good general solution -- that's the whole engineering task of evaluating tradeoffs.)

  • Panopticon Panopticon posted a comment on discussion Free Support

    Andy Thanks for circling back and explaining the root cause. As you indicated, once an event has been allocated from a pool, it must either be published or posted (a publish is really just a special kind of post) and then eventually removed from a queue, dispatched, and garbage collected. Otherwise it won't be recycled back to the pool. In the very rare case where an event is allocated, and then the code determines "abort -- don't send", the event can (must) be manually garbage collected -- IIRC,...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Steve -- did you happen to look yet at the diffs between 6.9.2 and 6.8.1? I haven't but might do that later today. I'm guessing there were no changes in the MSP port, so the only relevant deltas would be in the framework itself? Actually just checked 6.9.2 against 6.7.0, the MSP430 port directory differences look innocuous -- just adding "U" suffixes to force integer literals to unsigned... I guess you don't know how far it gets, for example does QF_run() complete and start running the AOs? Do you...

  • Panopticon Panopticon modified a comment on discussion Free Support

    Hi Ralf, My thoughts... I think QP/C or QP/C++ is ported to work on Arduino, which is an AVR, correct? So that might be one possibility. QP/C in a minimal configuration is incredibly lightweight. https://www.state-machine.com/arduino/ Secondly, the most common development platform in mainstream embedded is ARM Cortex M, specifically in my opinion the M4. There is the M0, the M7, the M33... but the M4 is "right down the middle" most common. I think there are probably a dozen vendors with this silicon...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi Ralf, My thoughts... I think QP/C or QP/C++ is ported to work on Arduino, which is an AVR, correct? So that might be one possibility. QP/C in a minimal configuration is incredibly lightweight. Secondly, the most common development platform in mainstream embedded is ARM Cortex M, specifically in my opinion the M4. There is the M0, the M7, the M33... but the M4 is "right down the middle" most common. I think there are probably a dozen vendors with this silicon (ST, NXP, Microchip, Nordic, Si Labs,...

  • Panopticon Panopticon posted a comment on discussion Free Support

    I've never looked at code for 3D printers, I guess there are some open source offerings? If you can post a github URL or 2 that would be helpful. IMO, QP is a great fit for many embedded systems, especially systems with relatively independent "silos of functionality" that need to remain responsive to stimuli (which I think exactly describes a 3D printer). Many systems are comprised of multiple independent concerns, e.g. control loop, comms with external world, simple UI, logging, etc. And you're...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Good to hear, Patrick. By the way, there is one other thing I forgot to mention... there is a feature in the QP that allows you to run a "constructor" before returning from Q_NEW() (even in the C version of the framework). This allows you to put the allocated object into a sane state before it is handed back to you by Q_NEW. It is called variadic Q_NEW() (printf() is another example of a variadic function, it can take any number of arguments of different types). You need to #define Q_EVT_CTOR, and...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi Patrick, I think QP adopts the same philosophy as the C programming language -- doing everything necessary to perform correctly, and nothing more. So for example in C, automatic variables are uninitialized unless you provide an initializer. And memory from the heap (malloc/free) isn't wiped / zeroed in between uses. Allow me to play "devil's advocate" for a moment... If the framework did this, it would incur a performance penalty, and for the 95% of the correct cases, you'd pay a tax for processing...

  • Panopticon Panopticon modified a comment on discussion Free Support

    No that's not a crappy attitude at all, I get it. I'm a command-line guy myself, old school Unix and makefiles are my friends. I like how Miro provides the Workstation examples that can be built with gcc (I guess it's mingwin) from a Makefile. Every IDE is different, hides different settings under different buried menus, etc. I totally get it.

  • Panopticon Panopticon posted a comment on discussion Free Support

    No that's not a crappy attitude at all, I get it. I'm a command-line guy myself, old school Unix and makefiles are my friends. I like how Miro provides the Workstation examples that can be build with gcc (I guess it's mingwin) from a Makefile. Every IDE is different, hides different settings under different buried menus, etc. I totally get it.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Just FYI (perhaps you know this) -- TI's CCS is now (and for a while) free, and IAR has a 30-day eval. I'm pretty sure Miro has these numbers (or can generate them easily) and will reply anyway, but just in case you want to see for yourself.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Dana, If I'm understanding you correctly (QHsm <--- Connection <--- <<subclasses>>), then yes you can do this. Miro understands OOD / OOP at least as well as me, I can't speak for him but I think in your initial question (which I just went back and re-read) there was some mention of using QHsm as the base class (good) and then later something about a base class without a state machine (not possible -- QHsm always has a state machine, and I believe you indicated you wanted state machines)</subclasses>...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Yes I've done this... if you look at any of the QP examples running QV, you'll see that everything is initialized in main(), and then QF_run is called from main(), and QF_run doesn't return... that's essentially what you'd do inside your FreeRTOS task. The main difference is that in the case where all the AO queues are empty (QV_onIdle) that is where you relinquish control of the CPU to a lower priority task using an OS call. If the QV task is the lowest priority task (no one else to run when all...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Yikes. Apologies. I just realized that the model in my QP distribution is one I create (reverse-engineered from the code). Sorry.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi Dana, I assume you have a modern (i.e. 6.x) version of QP/C? I have 6.7.0 and there is a QM model for the Defer Pattern that can be found under: qpc\examples\workstation\defer\defer.qm Hope that helps.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Yes exactly, and thanks for adding in your thoughts. In the cases I've seen companies doing this (handles to other AOs), through type-casting, I've seen developers willfully and knowingly break that encapsulation. This is a case where C++ can help a little, with its access specifiers (protected and private).

  • Panopticon Panopticon modified a comment on discussion Free Support

    Following up on this: could you please shed a little light on the QP API QHsm_isIn()? If we think of AOs as encapsulated functionality, each running in its own thread, then effectively the state of the AO, and the data that it touches, should be opaque to other AOs -- the only communication is via events. Similarly, HSMs (whether an HSM component, or one being dispatched to in an ISR, etc.) are also encapsulated functionality. Events are dispatched to them, they do their thing, and then they return...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Following up on this: could you please shed a little light on the API QHsm_isIn()? If we think of AOs as encapsulated functionality, each running in its own thread, then effectively the state of the AO, and the data that it touches, should be opaque to other AOs -- the only communication is via events. Similarly, HSMs (whether an HSM component, or one being dispatched to in an ISR, etc.) are also encapsulated functionality. Events are dispatched to them, they do their thing, and then they return...

  • Panopticon Panopticon modified a comment on discussion Free Support

    QP's garbage collection is explained PSiCC2 Book, page 339. The framework uses a reference count for each dynamically allocated event. Garbage collection is well-defined and deterministic in QP.

  • Panopticon Panopticon modified a comment on discussion Free Support

    PSiCC2 Book, page 339. The framework uses a reference count for each dynamically allocated event. GC is deterministic and well-defined in QP.

  • Panopticon Panopticon posted a comment on discussion Free Support

    PSiCC2 Book, page 339. GC is deterministic and well-defined.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Your understanding is correct. Double buffering is the common approach. Note that if you know the max message size, you can allocate the event via Q_NEW() and then fill it in over a succession of ISRs before posting. Then you get the benefits of the framework's garbage collection too.

  • Panopticon Panopticon posted a comment on discussion Free Support

    From what you've provided, it's hard to give a definitive answer. Both approaches could work. We don't know if you have any real-time deadlines, and/or if you are running a preemptive scheduler. These can play into the decision. Shared data or objects are always the trickiest part IMO. Some thoughts: be aware of the TOCTOU problem -- time of check, time of use. It's possible by the time you go to use the system mode, which you checked 10ms, it's actually changed. Sooooooo..... With the P/S approach,...

  • Panopticon Panopticon modified a comment on discussion Free Support

    This is a good question. I'll give you a brief answer with 3 different ways to do it, and then we can go from there. Also, Miro will almost certainly post with his recommendation. First off, answering your question directly: this isn't really the use-case for the reminder pattern. You could probably bend the pattern to make it work for this situation, but it's really ideal for a single chunk of processing that needs to be "suspended and resumed" or "broken up into many small slices" so that other...

  • Panopticon Panopticon modified a comment on discussion Free Support

    This is a good question. I'll give you a brief answer with 3 different ways to do it, and then we can go from there. Also, Miro will almost certainly post with his recommendation. First off, answering your question directly: this isn't really the use-case for the reminder pattern. You could probably bend the pattern to make it work for this situation, but it's really ideal for a single chunk of processing that needs to be "suspended and resumed" or "broken up into many small slices" so that other...

  • Panopticon Panopticon modified a comment on discussion Free Support

    This is a good question. I'll give you a brief answer with 3 different ways to do it, and then we can go from there. Also, Miro will almost certainly post with his recommendation. First off, answering your question directly: this isn't really the use-case for the reminder pattern. You could probably bend the pattern to make it work for this situation, but it's really ideal for a single chunk of processing that needs to be "suspended and resumed" or "broken up into many small slices" so that other...

  • Panopticon Panopticon modified a comment on discussion Free Support

    This is a good question. I'll give you a brief answer with 3 different ways to do it, and then we can go from there. Also, Miro will almost certainly post with his recommendation. First off, answering your question directly: this isn't really the use-case for the reminder pattern. You could probably bend the pattern to make it work for this situation, but it's really ideal for a single chunk of processing that needs to be "suspended and resumed" or "broken up into many small slices" so that other...

  • Panopticon Panopticon posted a comment on discussion Free Support

    This is a good question. I'll give you a brief answer with 3 different ways to do it, and then we can go from there. Also, Miro will almost certainly post with his recommendation. First off, answering your question directly: this isn't really the use-case for the reminder pattern. You could probably bend the pattern to make it work for this situation, but it's really ideal for a single chunk of processing that needs to be "suspended and resumed" or "broken up into many small slices" so that other...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Nice post Burak. You have documented in your blog post what many of us have gone through. I went through this journey in the mid/late 1990s before there was a QP... and my solution was still inferior to what the QP does today. My solution used an RTOS and queues, dynamic memory wasn't a problem, but a) there was no reference counting, so everything was managed from developer expertise/knowledge, not automatic garbage collection like QP; and b) the state machines were flat (FSMs), they were not UML...

  • Panopticon Panopticon posted a comment on discussion Free Support

    A diagram from Miro's PSiCC2 book is probably on-point here...

  • Panopticon Panopticon posted a comment on discussion Free Support

    I strongly agree with MMS' comment, and hesitated even to post about using only the QEP, because a) I cannot imagine why the original poster wouldn't want to use the QP as a whole, and b) it does require some understanding of the structure and underlying roles of the QP components. Artem -- I don't mean this as a criticism, but your original question is kind of like, "I want to still use my horses to pull the vehicle, but how can I use a Tesla automobile to get from point A from point B." Of course,...

  • Panopticon Panopticon modified a comment on discussion Free Support

    Hi Artem, Yes, in fact there are really 2 parts to the answer. The QP is actually comprised of several components with (deliberately) well-defined interfaces. A typical QP application will make use of the QP's: QEP component (Quantum Event Processor) - this component provides UML statechart functionality QF component (Quantum Framework) - this component provides things like timers, active objects (with queues and threads), event posting, publish/subscribe, etc. QSPY component (event tracing / logging)...

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi Artem, Yes, in fact there are really 2 parts to the answer. The QP is actually comprised of several components with (deliberately) well-defined interfaces. A typical QP application will make use of the QP's: QEP component (Quantum Event Processor) - this component provides UML statechart functionality QF component (Quantum Framework) - this component provides things like timers, active objects (with queues and threads), event posting, publish/subscribe, etc. QSPY component (event tracing / logging)...

  • Panopticon Panopticon posted a comment on discussion Free Support

    You misunderstood me. I was saying that it's strange that the casting isn't sufficient, but somehow the temporary variable rectifies it.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Ah OK, I see now. My misunderstanding. That certainly is weird!!

  • Panopticon Panopticon posted a comment on discussion Free Support

    Yep I think this is pretty much what I was suggesting (although the use of the QF_ACTIVE_CAST() macro is better) Miro, did you mean for the second line of your example code to use "ao" (the temporary ptr); otherwise the temporary probably isn't needed. As you said, the OP could just use the cast directly in the call to QACTIVE_POST() as well. In either case the compiler will probably generate the same code, at least if the optimizer isn't brain-dead.

  • Panopticon Panopticon posted a comment on discussion Free Support

    Sorry because I'm not familiar with the AVR tools, but one quick question: Doesn't QACTIVE_POST() require a pointer to a QActive for the 1st parameter? And isn't the type of AO_Main a "struct BlindTag"? perhaps you could try &(AOMain.super) or (QActive *)&AOMain to force the types?

  • Panopticon Panopticon posted a comment on discussion Free Support

    Hi Orris, Thanks for the kind words. I understand what you are saying. And what Miro says rings true. Part of the QM experience relies on a basic understanding of a) UML statecharts and b) the QP framework, both of which you may have. My understanding is that the QM tool was developed to be very easy to use, low friction, intuitive and straightforward. I came to the QM after using heavyweight tools (e.g. Rhapsody, Enterprise Architect -- both of which are proud of their 1,500 page manuals) so the...

  • Panopticon Panopticon posted a comment on discussion Free Support

    That's certainly not too specific ;-) What is it you are having trouble with? (I see what you wrote above, I did). Is there some way the QM Tutorial can be improved? Or are you unaware of it? https://www.state-machine.com/qm/gs_tut.html

1 >