 Okay, let's do a hands-on on the WAAP protection two step I would like first we check together the flash write protection thanks to our tool Q programmer and In a second time, I would like to check the SRAM protection. Thanks Qbidia So I will launch Q programmer and started the first step. So here you've got Q programmer Which have Nobody connected for the moment I bring two boards one with the L073 and one L476 Just to show you the difference in the option by structures So first I plug the L073Z Let's check the option byte So I connect I can see the content of the flash If I click here, I can see the option byte on the write protection Even the per sector basis you've got one bit per sectors of the flash that you can protect. Okay, and Let's plug now the L4 So I connect to the board and Now if you see the structure of the option byte is different here for the write protection You've got one pair bank. You've got area with the start address and hand address. Okay, let's experiment this protection now so Let's check the flash nothing in the flash though. I can write here what I want I don't know So we double-click here if And I just apply this as you can see now I have modicava in the flash no protection So now I propose we protect this first sector. So I will go in the option byte Then I will say it started at address zero It finished at address zero. I just want to protect the first sector Okay, I apply this modification so It's programmed successfully Now if I come back To the content of my flash and if I try to modify it to get it to zero I Can't I've got the right memory fail. So okay, it's a little bit travel on zone But it's ready to show you how it's done Now as I said you can modify Okay, you can modify as you want this. So if you want to come back and remove the protection You just program this one to a value greater than this one apply it then The protection have been removed not the content and now we can program whatever we want here again Really simple and if you are doing it with a program on the STM32, it will be exactly the same Though this is the first step Now I would like we go to a more complex one with the protection of the SRAM So the purpose now is to check the SRAM to write protection and we will do this same QBD First I check in the reference manual of the L476 the SRAM2 address is Okay We will launch this QBD. We generate a project for the nuclear In the main loop we will adjust this test which is a red pin of a blue button B1 GPO port will be associated to the blue button of the board if it's press I mean if the GPIO is zero then we will configure registers to protect the SRAM Let's switch to the QBD now So I launched the STM32 QBDE and I will create a new project for my nuclear boards So I go in new STM32 project Then I'll get The target selectors. I will select the board selectors and then yeah, I need the 476 Edgish, yeah, we've got the nuclear one which corresponding to mine Next Like SRAM2 project and Finish Yes, you should initialize all the peripherals with a default mode that way we have the blue button already configured I would say Okay My code is ready. My pinout is correct. I've got my blue button defined just here So I will read this value and divine this value is equal to zero then I will configure the protection. So Let's go to the main Here we've got the main function and The main loop so I will write just after And I will test the GPIO associated to the blue button She'll GPIO I could press control space to have proposal Yeah, I want to do a read pin function. I Know that it started with B1 control space Zip or then again B1 control space the pin and If I need read Zero Then I Will modify the system Register, so it was a cis CFG resistor. This is already defined in the stack And we will use the This could be equal to 0x1, okay so This should be good. Let's save Let's compile and now I propose to debug so So I was able to connect everything is started as you can see I could put a breakpoint just there I'm started. I'm not reaching this breakpoint. So, okay, the code is okay If I break now and if I want to see memory, so I Will request a show view the memory and Here I would like to check the SRAM So here we already have some usage I can write whatever I want No restriction about this access if I continue If I break again, the value is still there, okay? So now if I continue if I press the blue button now Then as you can see I'm just Breaking in the in this assignment. I can still modify it and Now if I just step over this one Now any access would be declined. There is some error now. It's no more possible So if I reset the ball to just doing this The system config register would be reset and now I should be able To write again Okay, so this is really bad X but show you this protection of the SRAM 2 that could be done dynamically in that the code