 So, we will learn in this project how to configure the GPIU that is connected to the user button as XTI, so external interrupts with rising edge. Let me present you the key features of the EXTI. So, the EXTI for external interrupts, that's a way to wake up, you know, the system of the SM42 from stock mode. It also generates interrupts and generates events. So, we have configurable events. So, where you can configure, you know, the edge, so the active edge to be like falling or rising edge. And you have also direct events. Here is the block diagram of the EXTI. So, as you can see, any IOS can be configured as external interrupts or EXTI. So, as you can see here, we have a way also for the EXTI to wake up the microcontroller, so the power block of the microcontroller, so you can wake up the system, you know, from a low power mode. And we have some configurable events and direct events that are linked, you know, to the NVIC and to the event input of the Cortex M0 Plus. In this table, we summarize the lines mapping for the EXTI. So, as you can see, for the lines 0 to 18, so that's the GPIU, the PVD and the comparators, the lines are configurable. But then, from line 19 to 33, those are direct link. So, those are coming, you know, from other peripherals like RTC, the temp, the I2C, the UART, and the UCPD, for example. Here is a quick overview of the NVIC. So, the NVIC stands for nested vector interrupt controller. So, this is integrated in the Cortex M0 Plus CPU. So, the features have 32 maskable interrupt channels, four different levels of priorities, low latency exceptions, and interrupt handling with power management control. So, for your application, that means that we support priority levels, you know, with dynamic control, fast response to IRQs, and relocable vector table. Now, time for the lab. So, first, we will close tile microvision 5. Then, in STM32 Cubemax, we will open the Blinky Project and rename it as EXTI. So, the idea is to add the configuration of the IEU that is connected to the user button on your board, so which is PC13, to toggle the LED. So, LD4, you remember, that's the one connected to PA5 of the STM32 G0 on your nuclear board. So, because we started with Blinky Project, so you already have PA5 that is configured as GPIO output push-pull. So, if not, please configure it. So, remember, left click on PA5 and configure as GPIO output. And now, we're going to add the configuration for PC13, so which is connected to the user button, and configure it as an external interrupt mode. So, to do this, so you will left click on PC13. So, PC13 is located right here, you know, on the upper left corner of the package. And you want to left click on PC13 and select GPIO XTI-13. So, first, we close kyle-microvision-5. So, we're going to exit and then close the app. Then, in STM32-QMX, so we're going to open a previous project. So, you can go with recent project and Blinky. So, because we start from Blinky, and we will rename the project as EXTI. So, change from Blinky to EXTI. PA5 is already configured as GPIO output. Now, we need to configure PC13, which is located here in the upper left corner of the package. And we're going to configure it as GPIO EXTI-13. So, this is EXTI line number 14. Now, under system view, so you will click on system view. Now, in GPIO, so you will click on GPIO under system view. We want to check that in the configuration for the GPIO mode, external interrupt mode with rising edge has been selected for PC13. So, when you click on PC13, check that GPIO mode is external interrupt mode with rising edge. I'm going to system view, click on GPIO, expand the view with these arrows here, select PC13, and make sure that the GPIO mode is external interrupt mode with rising edge. Still, under system view, select NVIC. So, by clicking on NVIC, then in the table, so in the selection below, in the NVIC interrupt table, you want to click on the last one, so which is EXTI line 4 to 15 interrupts. So, you're going to click here to enable this interrupt. So, because we want to include EXTI 13, so to do this, we're going to enable EXTI 4 to 15. So, still in system view, click on NVIC and now, so for the last line, external interrupt line 4 to 15 in the NVIC interrupt table, we're going to click here to enable the interrupt. Now, we can generate the code, so click on generate code in STM5 to QMX. Then, when the window like this will appear, open projects. So, that will open KM5. And then in main.c, we are going to look for the section called user code begin PV and we're going to add like one line of code in order to declare a variable that will initialize to zero. So, we'll add PC13 underscore flag. Okay, I'm going to generate the code and now we're going to open the project. Now, we're going to add, you know, the rising edge callback function for the EXTI. So, to do this, so we're going to copy this function right here. So, same thing, you can find it in the description of the video to copy and paste in your code in main.c. So, we're going to copy it in the user code section begin four. Okay, so user code four. So, this function, so we'll increment every time it's called. So, every time basically there is a rising edge on the EXTI 13, so PC13. We're going to execute this function and we're going to increment, you know, the flag that we declared previously. Depending on the value of the flag, we will turn on or turn off, you know, the LED. So, basically every time we're going to press on the user button connected to PC13, we will toggle the LED. Let's add the function, the callback function. So, we're going to call down all the way down and in the user code section four, we will add the callback function for the rising edge. Okay, save this. Now it's time to build the project. So, remember, build button, click on it, or F7. Enter debug session. So, with the D, so the icon D, or control F5. Once you're in debug session, you can run the code by pressing F5 or clicking on this icon right there. Now, when the code executes, so if you press on the user button, so this is, you know, the blue button on your nuclear board, you will see the LED for blinking or toggling. Let's build the project. The project built successfully. Now we can enter debug session with the D. Okay, we can now run the code. So, F5, or run button. And now, so when you press on the user button, so this is the blue button on your nuclear board, you see that LED four is toggling.