 I will present you the cube monitor. So it's the first hands-on for today, and we will see in this hands-on what is the cube monitor, what it does and how you can use it, and how you can customize it to monitor your application. We will also start the dashboard that you will use in next hands-ons. So what is the cube monitor? It's a tool that comes at the end of the development thread. So after you have debugged your application with the ID and programmed on the board, and you need to fine-tune the application, the behavior of your application, the performance, without disturbing the application. So you can use the monitor for this. Another important point is that this tool, like the other tools of the ecosystem, is free. You can download it for free. And like QBID is based on an open platform, in the case of QBID, it's Eclipse. Here, the Q monitor is based on Node-RED. And ST has added some features to make it suitable for the STM32 MCUs, especially for the communication with the MCUs. So this tool will be used when the application is running, and it will allow you to customize the variables you want to monitor. So to display only the variable you want to see, the data you want to see, and the way you will display them using different widgets for this. So you will customize the dashboard of displayed. And for this, the tool uses visual programming to make the work easier. The communication of the tool, on the right side of this slide, you see this picture and you suddenly recognize it. You have your PC, the USB cable, the STLink probe. Then the G tag here on the discovery board, the probe is embedded on the board. Then you have the G tag and the SWD protocol connection to the MCU. And the tool will access to the MCU memory through the MCU debug block. So like with the ID, all the MCU address space is accessible with these two. Even registers which have addresses will be accessible. So any kind of memory, the flash, or kind of RAM in the MCU and registers, the core registers or the peripheral registers. Now you can connect the board to your PC if it's not already done and launch the Q monitor. And we will start from the homework. So during the homework, you have downloaded a firmware to the board and you should have the green led blinking on the board and you have already connected the Q monitor to the board. So we are in the design mode here of the monitor and the floor which is displayed has always the same structure, whatever, because we want to communicate with the MCU from the PC to the MCU and read data in the memory of the MCU. So the floor is defined into parts. At the top, we have the transmission path from the PC to the MCU or to the STDN probe. And at the bottom, we have the path from the STDN probe to the PC. So I come back to the slides. So each time on the transmission path, we will click on the start button. We will send messages to the STDN probe sequentially asking to read the value of the variables defined in the variable node. And on the other direction, we will receive the variables from the STDN and display it on a chart. Another information to have in mind is that of course the MCU and the MCU debug block uses addresses and the PC software use names instead and we human beings prefer names as well. So the variable nodes, both variable nodes here will make the translation from names to addresses and from addresses to names. So those two nodes will have all the information about the variables. And the last point is that from this flow, we will get the directly the dashboard. So I can show you this on the tool clicking on dashboard. So you should have done this in homework already. We get this dashboard and on the dashboard we find the widget we have in the queue monitor. So the start and stop button, the clear graph button and all the rest is the chart widget. But for the moment, if I click on the start button, of course, nothing happens. We must import the variable information in the tool. This is an extract of the firmware running at the moment on the board. So we have a variable and we will monitor this variable. I will show you how to monitor this variable. So we have the name, the type of this variable and an extract of the code with a simple Y loop. And we see that we increment this variable by one every 500 millisecond. And in between we have a line which is the toggling of the LED. So the LED is off for 500 millisecond and on for 500 millisecond. So the period is one second. And the information about the variable will be extracted from the ELF file. So the ELF file has been generated during the build of the project with Q by D. And in this file we will find the address, the name and the type of the variables. And I indicate at the bottom of this slide two other file extensions that are also supported by the tool meaning that other IDs on Q by D can be used. So if I come back to the tool, to the Q monitor. So I've told you that the information will be in these nodes, these two nodes. So the processing node will inherit the list of variable that we will define in the list of variable at the top. So we can double click on the variable node. The property window appears and we need to define this to put the name of the executable in this executable box here. So if I click on the arrow, I don't have any executable for the moment. I click on the small pen and I get another window. Here I must put a name, it's mandatory. So I will call it my var config. For example, we can have several config for the same flow, for the same dashboard. For example, we can have several version of the executable file, several version of the firmware. But here we will just have one configuration. Here the folder we can't browse through the window explorer. So I will go directly in the window explorer to get the path where the health file is. So it's in the C column STM32H7 Echo Workshop, or WS. And in the ANZAN sub directory, ANZAN01. So I hope you have all installed the material in this default directory. It will be easier for the rest of the ANZANs. And I've put the health file in this directory. So I just copy paste the directory in the folder box. Then if I click on the arrow, I find my health file. I click on it and I get the list of the variables in my firmware. So here we are interested by the basic counters. I click on it, I select it. And we see that we have the name, the address and the type of the variable. So we're very happy with this. I click on add and I have my variable in the variable list. And we see that we will sequentially acquire this variable. So here we can choose the frequency of acquisition, but we are very happy with this sequential loop, meaning it's the fastest possible acquisition in the cube monitor. We could choose another frequency, but the maximum here is one kilo hertz for the acquisition. So now I can click on the done. And I see I have a blue circle on my variable, meaning that I've modified this node. So I click on deploy to save the modification and I can click on the dashboard. And now on the dashboard, when I click on start acquisition, I see that I have the basic counter indicated at the bottom of the chart and that the variable is read sequentially and that it's sequentially incremented. So if I stop the acquisition, I can click on show point and I get a marker. If I zoom on the curve, I can see that the basic counter is incremented by one every 500 milliseconds. So now we are able to read some viable from the MCU memory. We may want to modify this value, but for the moment on our dashboard, we don't have anything to do this. So we must add some widget to be able to write to write the value of the basic counter and modify it in the MCU memory. So for this, we come back to the flow editor and we will use the right panel widget on the left on the left of the screen. So to add it in the dashboard, in fact, it's very simple. We just click on it, keep the button of the mouse and drag it on the floor and we just release the button of the mouse. Then we have a red triangle here. If I put the mouse on it, I see that there is some invalid property, some group property that is invalid. If I double click on the right panel, I get the properties. In fact, we have a default value which is exactly, which is good for us. If I click on the small pen, I see that the name of the group is chart and the tab is home. In fact, we can have several groups of widgets on the dashboard. Here, we will just have one and we can have several tabs and you will see an example of this a bit later. But for the moment, I just click on console, done and the red triangle has disappeared. So again, the blue circle. So I click on deploy and again on dashboard. And now I see at the button of my dashboard that I have this right panel below the chart. So we have just by a simple drag and drop added a widget to the dashboard. So you see that it can be very easy to add some widget to the dashboard and to customize the dashboard. For the moment, we don't have anything in the right panel. So if I click on right, of course if I click on the start acquisition I see always my basic counter but if I click on the right button I nothing happens, of course. So we must populate this right panel with variables and especially with the basic counter we want to visualize to modify. So for this, I will insert it in the floor that we have here. I just drag the probe out a bit on the right and put the right panel just above. We want to have variables in this right panel. So to populate the right panel we will use the variables in my variable list. So in the node my variables so we will put a link between the two nodes. For this, we put the mouse either at the entry of the right panel of the output of my variables when the node is orange. We click on the mouse, we keep the mouse button and we drag the link to the output of the variable list and we release the button of the mouse when the other extremity is orange. So now each time we will click on the start button the variable list from this node will be copied to the right panel and so we will populate the right panel this way and if we want to modify the value of a variable in the right panel we must send a message to the Esteline probe. So for this we do the same. We put a link between the right panel and the probe out node. So I save, go back to the dashboard and now when I start the acquisition I see the basic counter in the right panel. So we see on the curve that it is at something the value is 10,000 and something. If I write a zero in the basic counter so I write zero and click on the right button then the counter comes down to zero and the scale of the chart will be resized automatically. So I can put the counter back to zero I can put it to 100 for example and then I'm able to modify the value of the variable in the MCU memory. As I told you, you can access to all the MCU address space of the MCU, so especially to registers and I will show you how to do this because for registers we just have addresses we don't have a name. So we can't extract the different information we need the type and of course a name we can't add the address. We can't extract this from the ELF file from the executable file. I will use the example of GPIOC because GPIOC is connected to the leads and we see this is an extract of the schematic of the bone and we see that the two leads are connected to the GPIOC pin two and three. So two, it's the red lead and three, the green lead and the other information we get on this schematic that as we have three volts here we to have the lead on, we need to put zero on the corresponding GPIO pin. So we need the address of this GPIOC so we find this in the release manual. So here in the table, in this table we see that it's 0x58020800 and we will access to the output data register which is at offset 14. So the final address, the address that in which we are interested is 0x58020814 and as we are interested only in bit three and two we will consider only the lowest byte of this register. So the type will be unsigned eight bit and the address is this one. So if I come back to the monitor I go again to my variables node and here as I don't have it in the executable file I can add this address using this add custom variable. So here we can choose the type but unsigned eight bit is what we need. So we don't change it. The address is 058020814 and I've forgotten to put 0x, yes, like this, 0x58020814 in hexadecimal and the name here is mandatory. Of course, because the software needs a name. So it's mandatory to give a name and it will be easier also for us to know what is this address. So we can call it GPIOCODR and that's it. We can click on done, deploy to save and we go back to the dashboard and when I start the acquisition now I see that I have this GPIOCODR register. Here we see that the basic counter that is now in orange is somewhere around 700 and so the values of the ODR register is very small. So we can click on the basic counter and we better see the scale of the chart has been resized. But the basic counter is still sequentially read from the MCU memory. If I click again on it, we have it again and if I hide it, it's just a little bit of a mess. We have it again and if I hide it, it's just hidden on the chart in fact. If I put a zero in the basic counter, right, I show it again and we see that it has changed to zero. So it just a way to, when the values are very different to remove or when we have too many values on the chart to hide some values to observe better the value that we are interested at a certain time. If I come back to the slide, so we see on the two first lines of the table when the red lead is off, we have the green lead toggling on off. So the red lead is on the bit two. So when it's off, it's one. The bit three is zero and one. So the ODR register value toggles between four and 12 with the four which is the offset due to the bit two of the red lead. And on the two other lines when the red lead is on, this time the ODR register is toggling between zero and eight. So at the moment we see that the red lead is off and the ODR register is toggling between four and 12. Now I can modify the ODR value. So I can put either zero or eight. Here I will put zero, zero, right. So we see now that the ODR register is toggling between zero and eight. And if you look at your board, you see that the red lead is on now. So if I put again four in the ODR register, then I will put a one on the bit two of the GPIOC. I can write it in decimal or in hexadecimal like this. Right, and it's not a good value, no, it's four. Four, so it's zero, four, right. And again the ODR register is toggling between four and 12. So you can write it in decimal or in hexadecimal here. Except that zero X four doesn't work. You must write zero X, zero four. Okay, so up to now what we have seen is how to configure the flow. So how to connect the MCU, the monitor to the MCU bond through the STLing. So that's what you have done during the homework. And how to get the valuable informations, the names, the address, the type from the executable file. And so how to read and write using viable names or using address. So how to access to the STM32 memory. How to easily add a widget to the dashboard to customize the dashboard by a simple drag and drop by a simple drag and drop. And insert this widget in the flow. And now we will import the flow that will be used in the next hands-on. I come back to the cube monitor and to import this new flow, I use the menu at the top right of the cube monitor, the three lines. And in the menu we have the import and in the import pop-up window, we click on the selector file to import. And here, okay, I already have the window explorer opening at the right place. So it's in C column, again, STM32 H7 ECO WS. And this time it's in the STM32 cube monitor directory. And here you have this JSON file. So you click on it, open, and import. And here we see a new tab. If we click on it, we have this nice flow here. So at first glance, it's a nice flow here. It seems much more complex because there is much more links and notes. But in fact, we find the same structure than we had before. We, you can recognize here at the top, the path, the transmission path from the PC to the STLIN probe. And at the bottom, the reception path from the STLIN probe to the PC. So the difference is that there is more widgets, widgets globally on the dashboard. So if we look at the transmission path first, you will recognize the start and stop button, the right panel, the STLIN probe. And the difference here is that there is three viable lists instead of just one. So the reason of this is first that I just wanted one viable in the right panel instead of all the viable in the viable list. So to isolate only one viable, I put it in one separate viable list. It could be two viable also, but not all the viable in the right panel. So the viable that will appear in the right panel are isolated in one viable list. The second reason is that they don't have the same frequency of acquisition. So the fast hack node uses this sequential loop sampling frequency, which is the fastest possible for the Q monitor. And the other nodes uses another sampling frequency. Here I've chosen 10 hertz. So the acquisition is made less frequently. And the other difference is that we have those switches here. Those switches allow to write to some viable just two values. In fact, one for the position on and one for the position off of the switch. But in the end, with this floor, the message sent to the STLIN probe is exactly the same than the one sent by the right panel that is right at this address, this value. And that's all, not more complicated. On the reception path, we find again, those three viable list, each is paired with the corresponding node from the transmission path. There, inherit the, can show you, for example, in the fast hack viable, we have, oh, it's not the most interesting. Yes, in this we have three variables, for example. If I click on the same processing node, I find again, these three variables that are inherited from the other node. We have the widgets on, so you can recognize the clear chart button and the chart, but we have some other widgets like text to display values as text. So function calls per value, we have another one here per percent. We have a gauge and we have three leads. And in between, in fact, except the clear chart button, these nodes allow to select which variable will be displayed on which widget. For example, here, we have one variable for each lead, but for the percent, for the perth percent, this variable is displayed on two different widgets. And we can have one variable displayed on, or several variables displayed on one widget, et cetera. So that's only to select which variable is displayed on which widget. And that's all, it's not more complicated than this. So now to start this dashboard, we just have to select the ST link. So we double click on one of the probe node and we click on the smaller row and we find our ST link here, we select it, and we click on done. And we do the same for the other probe node. We find our ST link, identified by the serial number. And we deploy and we can go to the dashboard. I resize the window and that's it. So we find, click on start acquisition, it will be a bit more easier to understand it. So we find all our widgets, the start, stop, clear chart button, the chart, the right panel, and new widgets like the gauge, the text values, and the switches and the leads. Here, for example, if I modify the value, the variable in the right panel, I put, for example, 1500, I click on right and I see that it's displayed as text just below. And the same for the per value that I find in text and the value in the chart that I find in CPU cycles per function here. When I click on a switch, I see the chart value is changing, the gauge value is changing. The values in text here have changed as well. The lead has been as red color, simulating a red on. So for the moment, and yeah, that's okay. So for the moment, the value displayed here has no meaning. When I click on this switch on off cache, I just add or subtract 50%. Each time I click on the switch in the middle, I just subtract or add 5% and for the LCD display, 20%. But it has no meaning. Just on the discovery board, we have just a simulation firmware that I've used to develop this dashboard. The other thing I can show you here is we have just one group of widgets, but we have this time two tabs in our dashboard and we can go back to the home dashboard. We still have it and we can still start the acquisition and see the ODR register and the basic counter. So you see here that with two tabs, you can display different variables of your application or display the same variables in a different way. For example, you could have variables in a table, for example. Okay, that's the way of using different flows for the same application. Just come back to the slides now. Okay, what I want to show you is this. The variables displayed on this new dashboard are all put in a H7 demo structure. And you will be able to use this dashboard without modifying. In fact, you will build new applications in next season. So you will get new Elf executable files, but you will use this dashboard without modifying the Elf file. You won't modify anything in the dashboard because we have made it so that this structure is put at fixed address at the 24 million. That is the beginning of the SRAM of the MCU. So you remember that the MCU debug block, the ST-Link uses addresses. So as the addresses won't have changed and the types won't have changed, you will be able to use the same Elf file to visualize the behavior of your new firmware. Only the basic counter will be a problem because we don't know what there is in those new firmware at this address. So it will not be a good idea to play with this basic counter because the effect could be surprising. So for this, I propose you to go back to the Q-Monitor application and here double click on the basic floor. So we have this window opening here and we can either delete the basic floor but that's not what I want to do here. I want to show you that you can click on the enable button and then the basic floor will be disabled. Click on done, click on the deploy and we see that it's disconnected from the board. And if we go back to the dashboard, the tab has disappeared. So here we won't be able to modify the basic counter anymore. So we won't have surprised during next hands-on. So at the moment, what we have done with the dashboard is that each time I've clicked on the switch, for example, on off cache. In fact, the cache is always off. I don't modify the cache in the current firmware. I just add or subtract 50% to the path person value variable. So the path displayed on the dashboard is totally dummy but during next hands-on, when you will click on the on off switch, the firmware will actually enable or disable the cache and return the status. So the status is displayed on the LED and the path value will be the consequence of this action. So the dashboard will have a real signification, the values displayed on the dashboard. And that's it for this hands-on. So just in conclusion, some words. We have seen that the cube monitor is used on a running application and is non-intrusive to this application. Of course, as much as the MCU debug blog and the SWED or GTAC protocol are non-intrusive. And we have seen that it's quite easy to customize the dashboard to configure the flow, to access to the STM32 memory in read or write. Of course, you won't be able to write to the flash memory but you are able, for example, to read some address in the flash memory or some variable and some address and to add a widget by simple drag and drops. And so now you are ready to design your own dashboard. Of course, you will start with a simple dashboard at the beginning and do it a bit more complex after this. And the example will help you in the first steps of your customization of your design. So for next hands-on, you will have to stop the cube monitor because for the moment we can connect only one tool. So either the cube ID for the debug connection or the cube monitor. And then when you will start again, the cube monitor, it will connect automatically to the board. And some links. So I want to, so the first link is the cube monitor webpage on st.com but you have already have access to this page. The two links I want to highlight is the STM32MCU wiki because we don't have documentation of the tool in shape of a PDF document. All the documentation is on this STM32 wiki here. And the second interesting link is this webinar about cube monitor. It's especially interesting because there is another example of dashboard in this webinar and you will have another example of what you can do with the monitor. And finally you can also have access to some help directly from the cube monitor from the menu and the help here and again a link to the wiki and a link to the ST community where you can find some discussion threads on cube monitor that can give you some more information on the tool. And that's all for this answer.