 Welcome to this video about STM32Q Programmer debugging features. STM32Q Programmer's main purpose is to program STM32 device. But some additional features are valuable to allow you a first level of investigation in case of issue. In this video, I would like to show you the register viewer and the fault analyzer features. I think the name are some are quite explicit, but beware, those features are only valuable through SWD and GTAG interfaces. Let's start with the register viewer feature. Once you are connected through SWD or GTAG interface, you can select the CPU button and check the core register. In this interface, you can also control the core state. I mean you can reset, run or hard the core, or you can simply doing some step instruction. The CPU security state will be available only on the STM32 with Cortex M33 on trust zone activated. In this case, it will show you the current core state, secure or non-secure. But you also have the possibility to check all the register IP of your STM32. For this, after connection, you just need to select a reg button. Then the device corresponding to the STM32 used. Then you will have the possibility to select the peripheral register you want to observe. Now, you can read or write in the register depending on the access write. But you can also control the CPU state, run hard or reset it. Another interesting feature is the capability to save the register values of one or whole the peripheral in a text file. This allows you to have a full overview of your platform configuration from register content point of view. But let's continue with a short live demo. First, let's check the connection parameter. I'm using the SWD interface and I'm in output mode because I want to observe what are the value of my register and my code is currently executed. Though I just press connect first, then go in the register reg beta button. I have to select what is the device that I'm trying to observe. In this case, it was a GZ071. So I select it and you can see the control peripherally selected by default with the register value. I can change through the flash for example. And here we can see the latency has been set to 1 by the code. So of course I can change this. For example, I can modify just the prefetch value. I apply this value and I can reduce the code and see if it has an impact or not. I can halt it. I can reset again the device. If I want to check new value, I will get the prefetch. So if I halt, if I read, I can see that source value come back to the default one. The last interesting feature is for me the capability to save all those values in a file. For example, I can save all the peripherals of my device in a text file. And if I show you the results, you can see just a text file with each register on the different field on their value. So it's really useful to have full picture of your platform. And that is what I want to show you in this short video. Let's talk now about STM32Q programmer fault analyzer feature. As you probably know, ARM Cortex Core implement a set of fault exception. The default one is hard fault. On the Cortex M0 M0+, some information could be recovered from the stack, but mainly that's all. For the other Cortex M, you have some dedicated fault status register which allows to configure and to get more information depending on the error. In those case, you can see some main management exception which detects some access relation regarding the memory protection unit. You can see some bus fault which detects some memory access error and usage fault which detects undefined instruction, un alignment access on also some divided by zero or other un alignment access if you configure it. Once you are connected to your target, you can select the bad button to get this fault analyzer interface. Now, you can control the CPU state that can be running on HALT. You can reset the CPU. And you can click on start analysis to check all those registers to find if there is a hard fault on which information you can recover from them. You can clear this window. And you've got this little not button, so I will just show you what is this. This not is just one you about the fact that division by zero and un alignment access are not trapped by default. You have to activate them in your software or another possibility would be to use a STM32Q programmer register viewer to set those values. This is a screenshot of memory management fault. The MMFR or main management fault address register contain the address of the location that generates this error. In case of bus fault, you can find the bus fault address registers which contain the location that generates bus fault, but you also have the fault instruction address and the call function address. So with all the information, it could help you to identify the issue in the code. And the last example is about a division by zero exception that I configure also by software, but I propose to show you this example with a live demo. For this demo, I created a simple firmware that do a division by zero when you press a button. And I would like to check what we can recover from STM32Q programmer. So first I will connect in hot black mode. And I would like to show you the configuration of the register. So first let's go in the register viewer. I already selected the SCB system control block. And in the CCR, you can see that division by zero and un alignment exception are not triggered or are not trapped. So if I go in my art foot analyzer, and if I press any button to I would say do a division by zero, I can start analysis but find nothing. But you've got a window that's open and tell you that the div zero trap bit was enabled. So please double check. So if I want to show you in the register view, if I read again, you can see those bits have been modified. So now if I do a new division by zero in my code, and I do a start analysis, this time all the information are recovered from the device. When away the 40 instruction address, you know it's a division by zero. And here you also have the CP register. So it's really show you this aspect. You can of course reset the device if I do a start analysis again. No exception for the moment. You activate the flag again. If I don't press any button and start analysis, you don't find any art foot. This is mainly what I want to show you with this art foot analyzer. Thanks for your attention.