 Let's create a simple hardware semaphore example. Hardware semaphore example description. We can reuse a previous example from the Worldcore debugging. These were three buttons and three LEDs, but we can create as well the completely new empty example for STM32WL55 devices. The important components within this example would be USART2, which is connected to STLINK and it's visible as a virtual comport. And hardware semaphore would be the protector of this USART2 and it would allow both cores to use this peripheral to display simple messages. USART2 would be configured within Cortex-M4 core and additionally in MainWire1 loop for both cores we will perform some simple data sent over this communication interface. As already mentioned, USART2 will be protected by selected hardware semaphore and this hardware semaphore will be selected as well to generate interrupts in case it will be released. In this case, both cores will have unique access to this USART2 communication interface and will avoid collision between those two. To create a project we may use STM32CUBemix and then generate the code to the selected truth tool chain or we can use STM32CUB IDE. In my case, I would use the second option. Within this project I will use STM32CUB IDE with STM32WLCUB library. As you can see, I have already opened my working workspace. I'm creating a new project so I'll go to file new STM32 project. It should initialize shortly the target selector. Our microcontroller, it is STM32WL55JC. It is enough just to put some part of the name. So this is our micro. As you can see, there is a Nucleo, in fact two Nucleo boards equipped with this microcontroller and I just press next. In this part, it is important to check whether this EnableNultyCPU configuration is used because it is activating both cores and creating in fact two projects, one for Cortex-M4 and the second one for Cortex-M0+. I would name the project Hardware-Sema4, so HCM and I press finish. We can see on the left side that the project is already created for Cortex-M0+, and for Cortex-M4. Okay, we are starting with an STM32CUBemix perspective which allows us to select the peripherals and initially configure them to create the basic skeleton of both applications. What we would need within this exercise would be USART2 which is connected to S-Telling and visible via virtual COM port on our PC and we will use a Hardware-Sema4 to communicate between both cores. So the first thing is to select USART2, it is within connectivity. We can select this show context just to see what has been selected for which core and USART2 is over here, we will select it for both cores. We can just double-click on it instead of using this part. It is selected for both cores but it will be initialized for within Cortex-M4 as this is the main core which is always starting as the first one after the reset. The mode tool selects asynchronous and will keep the default configuration of USART2 proposed by the tool. So the pod rate 115,000 bits per second, 8-bit world length, no parity and 1-stop bit, no interrupts, no DMAs, just the simplest possible configuration. Then we need to select the Hardware-Sema4, it is within system and core. This is HSM, we would select it for both cores and we will activate it. See, we can see this doesn't require any parameter settings. All coding related to Hardware-Sema4 will be done directly after code generation. Automatically the interrupt is enabled for both cores, for Hardware-Sema4. The last point I would like to do within this part is to just enable the debug interface. We will select serial wire, two wires, so PA13 and PA14. After this I will just verify the clock configuration where you are using the default clock settings coming from MSI and it's set to 4 MHz for both cores. After this we can generate the project, we will use the hardware abstraction layer for all of the modules for both cores. We will not change anything here and I will just press this icon device configuration tool to generate the project for Cortex M0 Plus and project for Cortex M4. Okay, I can see that I have two main.c files opened. As you can see if I toggle between them the proper project is highlighted. So at the moment I'm moving main.c file from Cortex M4 and the second one is for Cortex M0 Plus. Thank you for watching this video.