Quantum Leaps, LLC
Quantum Leaps, LLC
  • Видео 74
  • Просмотров 3 329 199
Using QP/Spy Software Tracing with STM32Cube IDE
This video shows how to build a QP application with the QP/Spy software tracing system using the STM32Cube IDE. This will allow you to trace, troubleshoot, optimize, and monitor your QP applications. QP/Spy tracing is also a cornerstone of testing event-driven QP applications.
This video is a continuation of our previous one, where we explored using the QP framework with STM32Cube IDE.
---
Links to related software:
- QP-bundle downloads
www.state-machine.com/#Downloads
- Quantum Leaps qpc-examples repo:
github.com/QuantumLeaps/qpc-examples
---
Links to related videos:
- Using QP Framework with STM32 Cube IDE
ruclips.net/video/M05jMX3_wJk/видео.htmlsi=gz2PGKTfUiVT0cTY
- Software Tracing with printf
ru...
Просмотров: 847

Видео

Using QP Framework with STM32 Cube IDE
Просмотров 1,4 тыс.21 час назад
This video shows how to use the QP real-time embedded framework with the STM32Cube IDE. This will allow you to apply modern embedded programming with active objects, hierarchical state machines, modeling, and powerful software tracing in this popular STM32 development environment. Links to resources: - QuantumLeaps on GitHub: github.com/QuantumLeaps - cmsis-packs repo: github.com/QuantumLeaps/c...
#50 To block or NOT to block, that is the question!
Просмотров 2,7 тыс.3 месяца назад
"To block or not to block?" is the single, most fundamental question determining the architecture of your embedded software. In fact, the issue of blocking is the most important discussion we can have in embedded programming, even though many embedded developers don't realize that. A traditional blocking RTOS is still the dominant approach, but this is changing. There is much more innovation in...
#49 Embedded Unit Testing #embedded_systems #embeddedsoftware #testing
Просмотров 9 тыс.6 месяцев назад
This is the first lesson about embedded software testing and its central role in software development. You will also see some ways of testing embedded software on the host computer and embedded targets and how to obtain the necessary tools. Contents with Timestamps: 🕑 0:45 Evolutionary principles for creating complex systems 🕑 2:00 On the Origin of Software by Artificial Selection :-) 🕑 3:00 Wa...
#0 Modern Embedded Systems Programming: Getting Started
Просмотров 91 тыс.8 месяцев назад
This is an updated version of "lesson-zero" of the "Modern Embedded Systems Programming" video course. The updates include new development toolsets, new structure of the code projects, and new resources for the course. Timeline: 🕑 0:07 *Introduction:* In this course, you'll learn how to program embedded microcontrollers the modern way, from the basics all the way to the contemporary modern embe...
Super-Simple Tasker -- The Hardware RTOS for ARM Cortex-M, Part-2
Просмотров 5 тыс.Год назад
Super-Simple Tasker (SST) is a preemptive, priority-based RTOS kernel fully compatible with Rate Monotonic Analysis/Scheduling (RMA/RMS). It was initially published in 2006. This video presents a unique hardware implementation of a modern version of SST for ARM Cortex-M (M0, M0 , M3, M4, M7, etc.). This is Part-2 of the talk delivered at Embedded Online Conference 2023, see: embeddedonlineconfe...
Super-Simple Tasker -- The Hardware RTOS for ARM Cortex-M, Part-1
Просмотров 10 тыс.Год назад
Super-Simple Tasker (SST) is a preemptive, priority-based RTOS kernel fully compatible with Rate Monotonic Analysis/Scheduling (RMA/RMS). It was initially published in 2006. This video presents a unique hardware implementation of a modern version of SST for ARM Cortex-M (M0, M0 , M3, M4, M7, etc.). This is Part-1 of the talk delivered at Embedded Online Conference 2023, see: embeddedonlineconfe...
#48 Assertions and Design by Contract, Part-2
Просмотров 5 тыс.Год назад
In this second lesson about assertions and Design by Contract (DBC), you'll see how to practically apply them in embedded systems. Contents with Timestamps: 0:45 Agenda for the previous Part-1 and today's Part-2 1:00 Embedding assertions (the qassert.h header file) 1:45 qassert.h code review (using Doxygen documentation) 2:35 Q_ASSERT_ID() macro implementation 3:53 Q_ASSERT_ID() macro use 4:34 ...
#47 Assertions and Design by Contract, Part-1
Просмотров 6 тыс.Год назад
In this lesson, you'll learn about software assertions and, more formally, the Design by Contract methodology in the context of embedded programming. This is part-1 of the two-part series on this subject. Contents with Timestamps: 1:25 What are software assertions? 1:46 Standard assertions in C 3:07 Demonstration of standard assertions on a desktop 4:37 Disabling standard assertions 5:49 Softwa...
#46 Software Tracing with Binary Protocols
Просмотров 9 тыс.Год назад
This lesson explains modern software tracing based on binary protocols instead of ASCII formatting with printf. To focus the discussion, you will see a mature software tracing system called QP-Spy, which is much more suitable for real-time systems than the primitive printf method. Contents with Timestamps: 1:25 The main problems of printf-style tracing 1:50 Firefighter analogy of printf-style t...
#45 Software Tracing with printf
Просмотров 12 тыс.Год назад
This lesson explains "debugging by printf" as the most common software tracing technique. You'll learn how to implement printf on the TivaC LaunchPad board, as well as NUCLEO-L152. You'll also explore some shortcomings of this primitive technique. Contents with Timestamps: 3:18 Adding printf tracing to the BSP code 4:25 Attempts to run and the hardcoded breakpoints 6:00 MicroLIB and the fputc()...
Channel Trailer
Просмотров 4,9 тыс.Год назад
The channel features in-depth videos explaining key aspects of modern embedded software. This trailer video shows fragments of a representative lesson "What is Real-Time Operating System (RTOS)" from the "Modern Embedded Systems Programming" video course.
Testing of Event-Driven Embedded Software with Python Part-2
Просмотров 4,3 тыс.2 года назад
This is part-2 of the talk "Testing of Event-Driven Embedded Software with Python" that Miro Samek presented at the [Embedded Online Conference in May 2022](embeddedonlineconference.com/session/Testing_of_Event_Driven_Embedded_Software_with_Python) NOTE: All code presented in this video is available on GitHub in the qpc repository: github.com/QuantumLeaps/qpc/tree/master/examples/qutest The vid...
Testing of Event-Driven Embedded Software with Python Part-1
Просмотров 12 тыс.2 года назад
This is part-1 of the talk "Testing of Event-Driven Embedded Software with Python" that Miro Samek presented at the [Embedded Online Conference in May 2022](embeddedonlineconference.com/session/Testing_of_Event_Driven_Embedded_Software_with_Python) This part starts with the general strategy for testing event-driven software. Next, at 5:35, you'll get a clear explanation of the traditional appro...
Hierarchical State Machines Persevere on Mars
Просмотров 4,4 тыс.2 года назад
Steve Scandore, the technical lead of the Mars 2020 FSW, talks about the *Mars Perseverance Software* in his keynote address at the recent Embedded Online Conference 2021. He mentions the state machine implementation by Dr. Samek of Quantum Leaps. Resources: www.embeddedonlineconference.com/session/Mars_Perseverance_Software www.embeddedonlineconference.com/session/Modern_Embedded_Software_Goes...
Hierarchical State Machines Persevere on Mars
Просмотров 3,4 тыс.2 года назад
Hierarchical State Machines Persevere on Mars
#44 Active Objects in Real-Time Part-2: Mutable Events
Просмотров 18 тыс.2 года назад
#44 Active Objects in Real-Time Part-2: Mutable Events
#43 Active Objects in Real-Time Part-1: Run-to-Completion and RMS/RMA
Просмотров 12 тыс.2 года назад
#43 Active Objects in Real-Time Part-1: Run-to-Completion and RMS/RMA
#42 State Machines Part-8: Semantics of Hierarchical State Machines
Просмотров 16 тыс.2 года назад
#42 State Machines Part-8: Semantics of Hierarchical State Machines
Active Objects, Hierarchical State Machines and Modeling in Practice
Просмотров 9 тыс.2 года назад
Active Objects, Hierarchical State Machines and Modeling in Practice
#41 State Machines Part-7:Automatic Code Generation
Просмотров 11 тыс.2 года назад
#41 State Machines Part-7:Automatic Code Generation
#40 State Machines Part-6: What is a Hierarchical State Machine?
Просмотров 22 тыс.2 года назад
#40 State Machines Part-6: What is a Hierarchical State Machine?
#39 State Machines Part-5: Optimal Implementation in C
Просмотров 22 тыс.2 года назад
#39 State Machines Part-5: Optimal Implementation in C
Modern Arduino Programming with QP and QM
Просмотров 8 тыс.3 года назад
Modern Arduino Programming with QP and QM
#38 State Machines Part-4: State Tables and Entry/Exit Actions
Просмотров 12 тыс.3 года назад
#38 State Machines Part-4: State Tables and Entry/Exit Actions
Why Attend Embedded Online Conference?
Просмотров 2 тыс.3 года назад
Why Attend Embedded Online Conference?
#37 State Machines Part-3: Input-Driven State Machines
Просмотров 15 тыс.3 года назад
#37 State Machines Part-3: Input-Driven State Machines
#36 State Machines Part-2: Guard conditions
Просмотров 15 тыс.3 года назад
#36 State Machines Part-2: Guard conditions
#35 State Machines Part-1: What is a state machine?
Просмотров 46 тыс.3 года назад
#35 State Machines Part-1: What is a state machine?
Beyond the RTOS Part-4: state machines as "spaghetti" reducers
Просмотров 10 тыс.3 года назад
Beyond the RTOS Part-4: state machines as "spaghetti" reducers

Комментарии

  • @user-tw9oi7od9k
    @user-tw9oi7od9k 2 дня назад

    How could we see the startup code on the STM32?

    • @StateMachineCOM
      @StateMachineCOM 2 дня назад

      This lesson #13 uses the standard startup code generated by KEIL uVision. To get this code, you need to open the provided project in KEIL uVision. The act of opening the project will cause the generation of additional directories in your project folder. Among others, you will get the RTE folder (Run-Time Environment). Inside this directory, you need to go to RTE\Device\STM32C031C6Tx. Deep inside there, KEIL has generated the startup file startup_stm32c031xx.s, which is in assembly (not in C), but you can study this file. In the subsequent lessons (#14 and higher), you will use the customized startup code written in C. Please watch the subsequent lessons. --MMS

    • @user-tw9oi7od9k
      @user-tw9oi7od9k 2 дня назад

      @@StateMachineCOM Thank you for the quick reply.

  • @mateoarv
    @mateoarv 2 дня назад

    First of all, thank you for the great content. I've been learning event-driven programming from your videos, and I'm convinced it's the better way to approach these systems. However, I've been having trouble trying to solve some "sequential" problems using this method. In particular, I tried implementing a driver for a GSM module that communicates through serial AT commands. The problem is that I found myself trying to model the solution in a sequential way. For example, let's say you need to configure the module and for that you need to send a series of N commands. Normally, I would've done something like this: send_cmd1(); wait_response(); // blocking send_cmd2(); wait_response(); // blocking ... My understanding is that to model this behavior in an event-driven way, one has to create a state machine in which each step is a state. The problem I encountered is that my state machines started to grow a lot and there was a lot of repetition. I'm pretty sure this can be done in a better way. What would your advice be for these kinds of scenarios where there are a lot of predefined sequential steps to achieve something?

    • @StateMachineCOM
      @StateMachineCOM День назад

      Your experience is very common during the transition from sequential (the "intuitive" way) to event-driven ("backward!"). I assure you that the transition *is* worth it. Regarding the repetitions in the state machine, they reflect the nature of the problem. It's not like your sequential problem is not repetitious (just at it!) But the traditional "flat" state machines have also another class of repetitions, which can be eliminated by using *hierarchical* state machines. This course has several lessons about all sorts of state machines. Here is the playlist: ruclips.net/p/PLPW8O6W-1chxym7TgIPV9k5E8YJtSBToI

  • @leohuang990
    @leohuang990 3 дня назад

    Thanks for a great lecture! When I disassemble ARM Cortex-M firmware, they often have "Reset_Handler" in the IVT entry of "__iar_program_start" in this lecture. I guess it's due to different vendors or development kits.

  • @rockababy
    @rockababy 4 дня назад

    whenever I install the missing Stellaris ICDI in KEIL, it doesn't seem to add it to the debug tab

  • @justinushartoyo2370
    @justinushartoyo2370 4 дня назад

    EDIT: I got my project to work! In case anyone is having a similar issue, the fix is to modify the CLOCK_SETUP macro to 0 in the device system file: \RTE\Device\{device_name}\system_{device_name}.c Quantum Leaps left a comment inside the course file that this has to be done to allow debugging in Keil Simulator (bypass the default clock configuration). I located this issue by comparing the project folder I created with the course project folder using WinMerge. Hi, I was trying to recreate the KEIL lesson-01 from scratch, but I'm running into the following error when I start debugging: *error 65: access violation at 0x400FE070 : no 'write' permission* This error doesn't appear when I run the provided project. I've tried to reverse-engineer the project: - Create a new project and select TM4C123GH6PM device - Check CMSIS Core and Device Startup for Run-Time Environment - Add a main.c file to Source folder, and write the counter script - Check the 'Use Simulator' debug option - Build target (F7) Everything works so far, including a successful build. But then I ran into the error when I hit 'Start Debug Session'. Which project creation step did I miss? Thank you so much!

    • @StateMachineCOM
      @StateMachineCOM 3 дня назад

      You're approaching it wrong. The most important fact to remember is that "in embedded programming, nothing works until everything works" ( I discuss this in the video ruclips.net/video/kcpHuuEt1xs/видео.htmlsi=NuerVMfiTBsExGxg ). Therefore, if your system doesn't work, you cannot make it work by tweaking it aimlessly. Even less chance has an outsider, like me, to diagnose your problems. Instead, you should take advantage of something that already works (the provided project). Then, you can *compare* it to your version and the differences will show you the problem. A good free differencing tool is essential. I use the free WinMerge tool (google for it). Please note that you *can* compare the uVision project files also (they are in XML). In the end, the purpose of this course is not to give you a fish, but to teach you how to fish. I hope you see my point. --MMS

    • @justinushartoyo2370
      @justinushartoyo2370 2 дня назад

      @@StateMachineCOM thank you for the inputs. I was essentially doing the comparison between my file and the course download manually (comparing 2 windows) - didn't know something like winMerge exists, it's a game changer!

  • @MrTurtleAIDS
    @MrTurtleAIDS 5 дней назад

    Not sure if anyone else is having these issues. Currently have the c031c6, found the ref man, datasheet, usermanual, and some sort of schematics on google. I notice that none of them really have schematics like the like shown on the video for the Tiva, so I can't really find the ports needed for the led. I may just follow the course with the Tiva board since most of the comments / documentation seem to lean towards that for now.

    • @StateMachineCOM
      @StateMachineCOM 5 дней назад

      If you wish to follow this course exactly as it was presented, TivaC LaunchPad is nice to have. However, the newer NUCLEO-C031C6 board should also be sufficient for this course. Regarding the schematics, a simplified version is available in the document "STM32 NUCLEO-C031C6 Board" available on the companion website: www.state-machine.com/video-course#STM32C031 . Also, the projects for the NUCLEO-C031C6 are available (such as for this lesson-04) so, you should be able to build and run them on your board: www.state-machine.com/course/lesson-04.zip . --MMS

  • @MrTurtleAIDS
    @MrTurtleAIDS 6 дней назад

    I wanted to follow along with IAR initially for the first few lessons, but they need an actual business email to get into the evaluation version, was it always like this?

    • @StateMachineCOM
      @StateMachineCOM 6 дней назад

      IAR Systems had been offering the free, size-limited "KickStart" version of their IAR toolset for decades. Only recently, the management of the company has changed and the free licensing of any kind has disappeared. Things were different when this video course was starting, but frankly, I don't blame IAR. There is just too much piracy and disregard for licensing. Everybody suffers because of this: both vendors and developers. --MMS

  • @BerthaProt
    @BerthaProt 6 дней назад

    Great video as always, big thanks

  • @Deepak9aagri
    @Deepak9aagri 6 дней назад

    You are doing great Job 😊

  • @Emcio3312
    @Emcio3312 6 дней назад

    Hi Miro! Nice to hear you again!

  • @itsJden
    @itsJden 7 дней назад

    Hello Sir Does you course on Modern ES Programming Include programming in embedded c?

    • @StateMachineCOM
      @StateMachineCOM 7 дней назад

      Yes, the course uses embedded C. Just watch it. Here is the playlist: ruclips.net/p/PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM

    • @itsJden
      @itsJden 6 дней назад

      @@StateMachineCOM Thank you sir As an embedded beginner this really helps me alot

  • @abdifatahaden4761
    @abdifatahaden4761 8 дней назад

    Just wonderful.

  • @BigJoe-y4p
    @BigJoe-y4p 9 дней назад

    Hi Miro! For some reason, I can not see Stellaris ICDI under Debug even though I downloaded it several times to correct drive. What am I missing?

    • @StateMachineCOM
      @StateMachineCOM 8 дней назад

      The companion web-page to this video course has troubleshooting instructions for that. Please see www.state-machine.com/course/AN_Troubleshooting_TivaC.pdf --MMS

    • @Mion446
      @Mion446 4 дня назад

      @@StateMachineCOM I'm also trying to find that under debug options and its not showing up even tho I tried several times. what exactly to troubleshoot?

    • @StateMachineCOM
      @StateMachineCOM 4 дня назад

      @@Mion446 After you download the "TivaC Troubleshooting Guide", you need to actually open it :-) When you do, you will find in it Section 2 "Keil uVision Doesn't Support Stellaris ICDI". Please read it, download the "MDK_Stellaris_ICDI_AddOn.exe" software, and install it. --MMS

    • @Mion446
      @Mion446 4 дня назад

      @@StateMachineCOM thanks, its just, I've downloaded that software and installed it at least 6 times, and the debug tab just doesnt have the stellaris option

  • @0rhansahin
    @0rhansahin 9 дней назад

    Being able to integrate without editing the framework is very valuable.

  • @mixail844
    @mixail844 9 дней назад

    good work , surprised about CubeMXGenerator integration. Still not getting the difference/usage among qp, qef, qv ,qk , qxk . Also will be interesting to see video integration of QP Framework , Q Designer and freeRTOS via CubeMXGenerator.

    • @StateMachineCOM
      @StateMachineCOM 9 дней назад

      Definitely, more information and videos are needed to explain the components and various real-time kernels for the QP framework. But just quickly: qep is useful if you want just the passive hierarchical state machines, qf adds active objects, qs is the software tracing system. The real-time kernels are as follows: qv is a simple non-preemptive kernel, qk is the preemptive non-blocking kernel (very efficient and fast!), qxk is a dual-mode kernel (with both non-blocking and blocking tasks). Finally, regarding FreeRTOS and CubeMX, it seems that ST is now much more invested in ThreadX. But perhaps a short video on integration with FreeRTOS won't hurt. --MMS

    • @mixail844
      @mixail844 7 дней назад

      @@StateMachineCOM thank you for replay and for all your lessons

  • @Deepak9aagri
    @Deepak9aagri 9 дней назад

    Nice video

  • @rupantaradhikary6580
    @rupantaradhikary6580 9 дней назад

    I have found that It's not really a coincidence that I gradually think and implement such a inheritance way for active object at least in c this is the only way to go it seems. I have learned all three concepts active object, opp's and state machine from this channel.

  • @MrDinhTungLam
    @MrDinhTungLam 11 дней назад

    One of the best video I've seen about the State Machine.

  • @rommelvillon6811
    @rommelvillon6811 14 дней назад

    Hi. I need help. I really would like to follow the video, especially the simulation part but my IDE(Keil for microvision V5.40) is going to some files(like system_TM4C123.c and startup_TM4C123.s) whenever I start the debug. I have tried to run a debug using your provided lessons and it works meaning there must be something wrong with my current setup.

    • @StateMachineCOM
      @StateMachineCOM 12 дней назад

      It's a known fact of life that "in embedded systems, nothing works until everything works." Therefore you must always start with a *working* project (the project provided in the downloads) and then gradually change it making sure that it keeps working every step of the way. You should also keep backup copies of the previous working versions so that you can always revert to a working version. I've devoted the whole lesson ruclips.net/video/kcpHuuEt1xs/видео.htmlsi=Blz2UPWMPZPh51ig to this process. I hope that my comments make sense to you. --MMS

    • @justinushartoyo2370
      @justinushartoyo2370 2 дня назад

      It seems we have a similar issue with getting our project to work with the Keil debugger. See my comment for details, but the fix for me was setting CLOCK_SETUP macro to 0 in the system_TM4C123.c file (it's set to 1 by default). As pointed out by Miro, using WinMerge helps a ton. Good luck!

    • @rommelvillon6811
      @rommelvillon6811 2 дня назад

      ​@@StateMachineCOM

    • @rommelvillon6811
      @rommelvillon6811 2 дня назад

      @@StateMachineCOM I'll be sure to follow your recommendation. I have watched your linked video and it's quite deep... need some time to re-watch and digest. I understand what you mean anyway. Thanks!

    • @rommelvillon6811
      @rommelvillon6811 2 дня назад

      @@justinushartoyo2370 Thanks for reaching out. I tried it and it worked. Do I have to modify the system_TM4C123.c file for every program or have you found a way to change it once and for all?

  • @rommelvillon6811
    @rommelvillon6811 16 дней назад

    Hello sir, I must be missing some setting because whenever I press DEBUG, it goes to startup code and all STEP buttons become inactive. By the way I am following this video using KEIL. The thing is it works whenever I am using your code . Do you have any video that shows the complete set up for KEIL uvision? Thanks for updating this series of lesson!

  • @bhavaysen754
    @bhavaysen754 18 дней назад

    I tried to download 14-days trial version of IAR, First it showed me that my case is registered. Here I'm not able to download the application. I downloaded the application from some other source and when I got into the License Management, then when entering my valid mail ID then also it is saying that email is invalid. Only registered mail can ask for trial license ? Please revert ASAP, I'm on my way to purchase boards.

    • @StateMachineCOM
      @StateMachineCOM 18 дней назад

      The IAR licensing has changed since the first lessons of this course were made (back in 2013). AFAK, the free IAR "KickStart" version is no longer available. Therefore, this course also offers projects for the KEIL uVision IDE, which I would recommend at this point. --MMS

    • @bhavaysen754
      @bhavaysen754 16 дней назад

      @@StateMachineCOM Thanks Miro for your quick reply. I will go with keil. thanks for the valuable course.

    • @bhavaysen754
      @bhavaysen754 16 дней назад

      Thanks Miro, for your quick response. After getting into Keil MDK, I'm stuck at the simulation ICDI part. I got the licence with the User-Based License option.

  • @user-tw9oi7od9k
    @user-tw9oi7od9k 18 дней назад

    Where would we find the memory map for the STM32?

    • @StateMachineCOM
      @StateMachineCOM 18 дней назад

      The memory map (the .map "map file") is generated by the linker in the dbg directory of the project. For example, most projects are called "project", so the map file will be called "project.map". --MMS

    • @user-tw9oi7od9k
      @user-tw9oi7od9k 18 дней назад

      @@StateMachineCOM Thank you, but I mean more like where we would find the memory addresses to let's say the GPIOA MODER register or other registers.

    • @StateMachineCOM
      @StateMachineCOM 18 дней назад

      @@user-tw9oi7od9k The description of STM32C031 peripherals can be found in the "Reference Manual", which is available for download from the companion page to this video course at: www.state-machine.com/video-course#STM32C031

    • @user-tw9oi7od9k
      @user-tw9oi7od9k 17 дней назад

      @@StateMachineCOM Thank you so much

  • @netanelshoshan
    @netanelshoshan 19 дней назад

    Can I use NVIDIA Jetson Nano?

    • @StateMachineCOM
      @StateMachineCOM 19 дней назад

      Absolutely you can! Only not for this course.

  • @xbreyy25
    @xbreyy25 22 дня назад

    I really like the idea of event driven, I completely understand the idea of immutable events in flash memory as consts. But what about mutable events (like your ethernet example).In this scenario I don't understand who is respobsible of saving all payloads queue( framework or application) as blinkyButtonqueue is only array of pointers to structs. can anybody show me some code where events are mutable? Perhaps in this case blinkyButtonqueue should not be an array of a pointers, but be a variable in global ram

    • @StateMachineCOM
      @StateMachineCOM 22 дня назад

      Yes, I realize that the management of mutable events with parameters hasn't been explained in this presentation. And yes, you are right that this is very important and indeed, the most valuable feature of the QP framework. You can find more information about it here: www.state-machine.com/qpc/srs-qp_emm.html and www.state-machine.com/qpc/sas-qp_emm.html

    • @xbreyy25
      @xbreyy25 22 дня назад

      ​@@StateMachineCOM It would be great to see a video or have github repo where freeact and qp framework would be in the same project example. (or freeact lib could be extended) I see in your other video that for mutable object you control led blink frequency creating event parameters with q_new function.

    • @StateMachineCOM
      @StateMachineCOM 19 дней назад

      At this point, FreeACT is a "minimal active object framework" that demonstrates the main principles of implementing the event-driven paradigm with a traditional RTOS. The FreeACT project ( github.com/QuantumLeaps/FreeACT ) could become more complete (e.g., by providing true management of mutable events), but this requires work. The project is licensed under the permissive MIT license (the same as the FreeRTOS kernel), but so far there have been no community contributions. In contrast, QP/C framework ( github.com/QuantumLeaps/qpc ) is a mature and full-featured active object framework that can work with many RTOS kernels (among others with FreeRTOS). QP is dually-licensed under the restrictive GPL license and commercial licenses. This different licensing model prevents combining QP and FreeACT in the same repository. --MMS

    • @xbreyy25
      @xbreyy25 19 дней назад

      @@StateMachineCOM I will definitely check complete framework, thx

  • @riffsfromtheabyss666
    @riffsfromtheabyss666 28 дней назад

    I'm having issues following along with the first 2 lessons in Keil micro vision. Any tips or recommended videos to watch so I can know how to interpret your earlier lessons with a different IDE? Thanks.

    • @StateMachineCOM
      @StateMachineCOM 28 дней назад

      Maybe you can skip forward and watch a lesson that uses KEIL rVision? The first lesson to do so is lesson #21 "Foreground/Background Architecture" ruclips.net/video/AoLLKbvEY8Q/видео.htmlsi=MzaGjGY9y6j3DlSp

  • @mengli1231
    @mengli1231 Месяц назад

    Unbelievable course! It has helped me to understand so many points in the black box. Thank you Miro!

  • @dawsongrattidge1695
    @dawsongrattidge1695 Месяц назад

    Does QK block interrupts? Could you do a video describing the advantages and complexities of available RTOS’ that do not block interrupts.

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      Yes, the preemptive, non-blocking QK kernel (see www.state-machine.com/qpc/srs-qp_qk.html ) briefly disables interrupts to protect its internal variables. But, QK also supports "kernel unaware" interrupts that are never disabled (see www.state-machine.com/qpc/arm-cm.html ). --MMS

  • @tsap0015
    @tsap0015 Месяц назад

    Can we follow the course including the practical experiment with any OS? (I am using Ubuntu)

  • @sharuns917
    @sharuns917 Месяц назад

    what is the equivalent of the __enable_interrupt() in GNU ? For example when I am using say CCS instead of IAR ?

    • @sharuns917
      @sharuns917 Месяц назад

      Found it in the video #19, we can use __enable_irq(); Thanks for moving the course to GNU!

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      In GNU-ARM you can use __disable_irq()/__enable_irq() (see also stm32f4-discovery.net/2015/06/how-to-properly-enabledisable-interrupts-in-arm-cortex-m/ ) --MMS

  • @79Nardo
    @79Nardo Месяц назад

    Thanks so much! for sharing your knowledge! Im Full stack Developer and always I asked how is the programming with embedded systems! I appreciate your help, thanks again!

  • @matthewszklany101
    @matthewszklany101 Месяц назад

    Hi I'm in keil changing all the bits as directed to enable the LED, however when I set the bits to 0x2 at address 0x400253FC, nothing happens. Any idea why this might be the case?

  • @matthewszklany101
    @matthewszklany101 Месяц назад

    So question, I'm using the keil ide/simulator which as far as I know, has a different compiler compared to the IAR ide/sim, which would of course, result in different assembly code being generated. Something slightly strange I'm seeing however occurs when incrementing the counter variable, both directly, and via the p_int pointer. This is what it looks like in the dissassembly: 0x000004DC DC05 BGT 0x000004EA 0x000004DE E7FF B 0x000004E0 6: ++(*p_int); 7: } 8: 0x000004E0 9900 LDR r1,[sp,#0x00] 0x000004E2 6808 LDR r0,[r1,#0x00] 0x000004E4 3001 ADDS r0,r0,#0x01 0x000004E6 6008 STR r0,[r1,#0x00] 0x000004E8 E7F5 B 0x000004D6 0x000004EA 2002 MOVS r0,#0x02 0x000004EC F2C20000 MOVT r0,#0x2000 Now, when single stepping with the debugger, we should reach that first load instruction into r1, then we should be able to keep stepping through the instructions until we reach the branch which will send us back to the beginning of the loop at 0x000004D6. What's actually happening however is that when I press f11 to single step through the instructions, it appears to stay at that first load instruction, but the counter is indeed getting incremented as I can see the value going up in the register window. A similar occurrence appeared to happen when I first tried stepping to see R0 get set to 0xDEADBEEF, but that part at least appears to be working now. I'm not quite sure why this is happening except for maybe its some sort of optimization by the debugger as it knows that it's just incrementing "counter" and therefore doesn't feel the need to display the rest of the loop instructions occurring.

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      This behavior of the KEIL uVision debugger is most likely caused by stepping one C-instruction at a time, whereas you apparently wish to step one assembly-instruction at a time. To do this, please click on the disassembly window first, and then single-step. I think that the F11 shortcut should work for this, but you might also try to click on the single-step button in the toolbar. --MMS

  • @matthewszklany101
    @matthewszklany101 Месяц назад

    Hi I'm a little confused on the computation of the program counter when branching. So given this: 0x000004DC E7F7 B 0x000004CE When computing the program counter, we add the offset value of the encoding to the current value of the PC. In this case we have PC: 0x4DC and an offset of F7, which in two's complement is -9. So adding them together we get 4D3, which isn't the target address of the branch. What am I missing here?

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      Your B instruction starts with 11100, so it uses the T2 encoding (see 5:05), so the immediate offset is 11-bit 0x7F7. But you're right that after sign-extending from 11 bits, it is -9. So, now 0x4DC - 9 == 0x4D3 -> 0x4D2 (after discarding the LS-Bit). But I think that this must be further corrected for the pipelining effect 0x4D2 - 4 == 0x4CE. --MMS

  • @crogersdev
    @crogersdev Месяц назад

    Miro, you are my new best friend. Liked and subscribed.

  • @jhanvisaraswat6976
    @jhanvisaraswat6976 Месяц назад

    I am getting an error "no debug probe found connected to USB port" when I try to debug with the device connected to my computer

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      Please check your debugger settings. For the TivaC board, you should have the "Stellaris ICDI" debugger. For the STM32 NUCLEO board, you should have ST-LINK. --MMS

    • @jhanvisaraswat6976
      @jhanvisaraswat6976 Месяц назад

      @@StateMachineCOM I have STM32F446RE MCU NUCLEO-F446RE board. When I change the debugger option to ST-link I get the error , failed to load flash loader. Do I have the wrong board or are my setting wrong? I am sorry if I am acting stupid but this is my first time trying to use this board

  • @leohuang990
    @leohuang990 Месяц назад

    Great to know that in C, small integers in computation are converted to the platform's "int" instead of the left-hand side's datatype, and a signed integer used with unsigned ones is converted to unsigned int. Did not notice that stdint was in the C99 standard and ARM & RISV-V can support both endianness. A very informative lecture.

  • @leohuang990
    @leohuang990 Месяц назад

    The carefully designed example about stack corruption is a great one. It shows how a C program can go wrong w/o explicit signs. Nice to know that static variables resolve the common bugs of reading out-of-scope local variables.

  • @leohuang990
    @leohuang990 Месяц назад

    A very informative lecture! I went through an unexpected review of the header file conventions and compiler vs. linker. The keyword AAPCS led me to the answers to some personal questions about real-world ARM assembly (e.g., about r12). Rumor has it that NASA forbids recursion and suggests applying a fixed upper bound to each loop.

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      The NASA rules you're mentioning are known as "The Power of 10: Rules for Developing Safety-Critical Code" (interested people should google this up). The rules restrict recursion and recommend explicit loop bounds. They also recommend using assertions, and not just using them but reaching the right assertion *density*. I talk about assertions in the later lessons #47 (ruclips.net/video/cnEhFwo4u5g/видео.htmlsi=TQIG_igL9tZ8W9Yc ) and #48 (ruclips.net/video/yHBmzQQVVas/видео.htmlsi=UP2V2PtKCoynyHxE ). --MMS

    • @leohuang990
      @leohuang990 Месяц назад

      @@StateMachineCOM Wow, thanks for the information. I'll go check them out!

  • @leohuang990
    @leohuang990 Месяц назад

    Glad to see this lecture mention the Thumb-2 technology (mixed 2-byte and 4-byte instructions), odd LR values (decoding of the Thumb instruction set), and the start & end of typical function calls (pass the arguments + (de)allocate the stack memory).

  • @leohuang990
    @leohuang990 Месяц назад

    Great to show a concrete reason (interrupts) for atomic RMWs. This MCU (its GPIO) implements bit-banding in quite an interesting way. Many MCUs simply map each bit in the bit-band region to a word in the alias region, w/o enumerating all possible bit-combinations. Thank you so much for introducing the AHB, the SYSCTL register to enable the AHB for GPIO, and the AHB aperture.

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      Good observation, but it's perhaps worth pointing out that the TivaC GPIO design goes beyond bit-banding. In the traditional bit-banding each bit has its own unique address. In the TivaC GPIO each bit *combination* has its own unique address. --MMS

    • @leohuang990
      @leohuang990 Месяц назад

      @@StateMachineCOM Great thanks for the information. Now I see this design is by Tiva-C. Your lectures are very helpful.

  • @leohuang990
    @leohuang990 Месяц назад

    Great to know that the ASR instruction preserves the relation between division-by-2 and right-shift for negative numbers. A firmware typically accesses control-related MMIO registers as if they were normal memory: read their previously stored values, update these values in the CPU, and write the updated values back. This is a common tip for peripheral modeling for firmware emulation.

  • @leohuang990
    @leohuang990 Месяц назад

    What a great lecture! MACRO and the "volatile" keyword are mentioned briefly in most freshman C programming courses. This lecture reminds me of their importance in firmware programming: define MACRO upon MACRO or fancy MACRO functions, use "volatile" to access MMIO registers or global variables likely modified by interrupts, and go through the headers provided by MCU manufacturers.

  • @leohuang990
    @leohuang990 Месяц назад

    Great thanks for mentioning the clock gating control, GPIODIR (direction), and GPIODEN (digital enable). It seems that we may design the busy-waiting loop(s) based on the clock frequency and the tolerable frame-per-second range for human eyes.

  • @jhanvisaraswat6976
    @jhanvisaraswat6976 Месяц назад

    Can this be done in macOS

  • @leohuang990
    @leohuang990 Месяц назад

    Great to know subtle details from the lecture like where Cortex-M stores global variables, load/store patterns in RISC, and Cortex M0 vs. M4 in terms of support for unaligned accesses.

  • @leohuang990
    @leohuang990 Месяц назад

    I love this style that the lecture's topic seems easy but the lecture itself reviews some essential concepts in architecture and assembly.

  • @TheMaaz99
    @TheMaaz99 Месяц назад

    Hello, I don't have LM4 package installed in my IAR embedded system how can I download it there

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      The LM4 microcontrollers have been renamed to TivaC. Please also see the other comments to this video, where some 100 of them are about this issue. Finally, please visit the companion web-page to this video at: www.state-machine.com/quickstart

  • @damiengates7581
    @damiengates7581 Месяц назад

    Also did you do away with the dispatcher? Is it publish-subscribe, message queueing or both?

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      The QP frameworks (QP/C and QP/C++) support both direct event posting and pub-sub. Regarding the runtime environment, QP frameworks can work with a variety of different kernels. I will make a video about the buit-in kernels. But QP have been also ported to traditional RTOSs, and also Linux and Windows.

  • @damiengates7581
    @damiengates7581 Месяц назад

    Hi Miro, how would you best describe your framework in terms of architectures? Is it close to Staged Event-Driven Architecture for example?

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      The QP framework is a lightweight implementation of the Active Object design pattern (aka Actor model). Additionally, QP provides support for hierarchical state machines to implement the event driven behavior of the AOs.

    • @damiengates7581
      @damiengates7581 Месяц назад

      @@StateMachineCOM Are the HSMs enabling a synchronization protocol for the AOs?

    • @StateMachineCOM
      @StateMachineCOM Месяц назад

      @@damiengates7581 The HSM in every AO is a general mechanism to specify the behavior of the AO. But among others, you can use HSMs to synchronize the behavior of multiple AOs to a given "protocol".

  • @richardsherburn4816
    @richardsherburn4816 Месяц назад

    Hi Miro, I'm really looking forward to starting the course, however, I've come across a problem with Keil uvision (latest version) and STM32cubeMX (latest version). The projects require 'FrameworkCube.gpdsc' which cubeMX will not provide, it only generates a 'ioc' file.; this is a known and ongoing problem with cubeMX. Please could you suggest a solution? Thanks in advance.