 Okay, let's move to the demos. As this webinar is fairly short, I'll be moving through them relatively quickly. However, the step-by-step instructions are included in the PDF version of the slides that you can download as part of this webinar package. So let's take a quick look at the board that we're going to be using. This is the STM32 MP135DK, or the Discovery Kit. We power it from the USB-C cable on the right-hand side, and we use the USB micro-connection to connect to our laptop, which implements a connection to the built-in ST-Link V3 on the board, and also implements a virtual comport. We need to make sure that the board is configured to boot into developer boot, and we do this from the boot switch settings here. So let's go to cube IDE, and the first thing that we will do is we will open up this example project. So go to file, open projects from file system, and now we need to browse to our cube IDE firmware repository. Normally this is in your user directory, so in my case it's youngCHR, and we go to STM32 cube repository, and here we have the MP135 bare metal hull repository. So we go into there, we go into projects, we go to this directory here because it's the DK board we're using, then we want examples, and we're going to use a UART example this time around. So let's go to UART, we'll pick the UART receive transmit console example, and then we select cube IDE. So now we just select this folder, click on select, and it will recognize that it's a cube IDE project, and we click finish. So this will import the project into our IDE, and if we expand the project we can see the project structure here. The first thing we'll notice is that there's a readme.txt file, which is an information file that tells us about this particular project. So in this case it's a UART example using UART4, and it's implementing a transmit receive link to our computer running something like Territerm or Hyperterminal. The directory structure on the left-hand side we can see, the document we've just been looking at will be in the docs directory here. We have the application directory under user, and here's where we have the main.c, we can double-click it to open it into our code editor perspective, and then we have the device drivers that are in the drivers sub-directory. So we have the main hull device drivers themselves, like UART drivers, reset and clock control drivers, etc. And then we also have simsys startup files, you start up files, and then we have some BSP components. So for components that aren't ST, but that are on the board that we use, we have a components BSP sub-directory. So here we have, for example, an IO expander, an I2C IO expander that we use on the board. Now we need to make sure that we select the correct tool chain, so to do that we click the top level of the project, right-click, and select properties. And here we need to go to C++ build, settings, and just make sure that we select the correct tool chain. So here we go, click on apply and close. Now we can build this project by clicking the build icon or the hammer button, and that will go and build the project. While that's building it'll only take a moment or two, but we'll take this opportunity to have a quick look at the the main C file. So we can see that we've got a couple of few functions defined. So one for system clock config, this sets up the clock tree for the device. We've got some initialization for the GPO and initialization for the UART. If I scroll down to the main part of the main function, we can see that the first thing we do is we call a function called HAL init, and this configures the HAL, and it'll be very familiar to you if you've ever used any of our Qubemex HAL firmware libraries for any of our microcontroller families. Then we call the system clock and config function which sets up the NPU clock tree, and then we've got a block of conditional code that tests to see whether we've got this macro defined to use DDR. All of the peripheral examples are configured to run from SRAM initially, and so in that case we're not using DDR, and so we set up the PIMIC IC or the PYM management IC on the on the board if you're using one. However if you are using DDR then if you remember that we need to configure the DDR controller first before we execute code from it. So in that case the DDR controller will have already been configured, the PIMIC will have been configured, so we don't want to rerun that block of code again. Scrolling a little further down we can see that the GPIO init function is called and the UART function is called, and then we move to our main program loop which is simply using some print statements out to our UART and allowing us to send characters back and process those. So in the meantime we've seen we should see that the program has built, we have zero errors just one warning, and we can see on the right hand side if I turn off my camera for a moment you'll be able to see that we have the build analyzer and this shows all of the regions defined in memory for the device. So we have sysram base which is the internal SRAM where we intend to run our program from, some other smaller blocks of SRAM and then the DDR itself. Now what we want for this example is for it to be completely contained within the SRAM and we can see that actually that's the case because none of the other regions are being used at all. These regions are defined by our linker script, we can take a quick look at the linker script, if we double click on it here we'll see that we've defined the memory regions, this is what's showing up in the memory regions area, and we have a couple of lines that define how this program is going to be built. So we have an alias called RAM and RAM is currently mapped to sysram base which means this example is is linking into sysram. If we commented that out and replaced it with this line then we'd be linking into DDR. So then that's all we need to do to configure this project to build so it runs in DDR. Of course then we need to set the use DDR macro. So we built it, we've had a quick look at the memory regions, now we want to download it onto our board. So to do that we select the top level of project, we select the debug icon and select the drop-down box and select debug as STM32C C++ application and this will connect to the board, pull up a debug perspective and the thing to note here if we click on the debugger tab we can see that we're using SWD link via ST link, we're using OpenOCD to provide the interface to the ST link cable itself and we're using GDB as the debugger. So we can click connect or sorry click on OK and it will connect to the board and we'll see in the console that we connect to the board and we download the code. This is asking me if I wish to swap to the debug perspective and I want to debug so this is exactly what we want to do. So we click switch and it downloads code to the board and it hits a breakpoint that's set by default at the first instruction after main. This is QBID is based on Eclipse and so we have all of the standard Eclipse debugging functions like step into, step over and step out of. If we want to just test this example we can simply click on the resume button but before I do that let's make sure that I have a serial console running connected to my board. This is TerraTerm and this is connected to the USB micro connection that's connected to the board itself. Now if I hit the resume button on the QBID it will start the program running and we can see in the serial console that we have some serial output. So if I press C to continue it will pull up a test menu and if I type test 1 it will fast toggle and I need to swap to my board. Hopefully you can see that the LED is actually toggling quickly and then it stops. So we can type test 3 and it will exit this program. So that's a very very quick whistle stop tour to show you how easy it is to open the pre-configured examples. So now we'll show you how to quickly create one of your own. So let's just stop this project running click on the stop button and then we'll close this project down so we right click on the project and we select close project. So what we did before was we opened a pre-configured example design now we'll create one completely from scratch so we do this by going file new stm32 project and this will open up the target selector and this will take a second or two. Okay and here we have the target selector so we have the NPU MCU selector board selector and example selectors in this case we want to start completely from scratch so we select NPU selector and we type in we don't have to type in the full part number if you can't remember it we just need MP135F and this will narrow the search for me so it shows all of the SF suffix parts and I can see from this column here that actually this this device is fitted to the DK board so all I need to do is make sure that I've highlighted that row click on next and that will select that device that's on the board is my base part. We need to give it a name let's call it bare metal for example it can be anything of course bare metal. The important thing here is to make sure that we select bare metal as an option not open ST Linux this allows us to create a project that's compatible with our bare metal flow. We need to make sure that we are building an executable and that it's a cube STM32 cube type project so now we can click finish and it's asking me do I want to open the configuration perspective this is a Cubomex configuration perspective so we do and this will take a few moments because it's building a project and it's configuring so we can configure the pin out. This always takes a few moments okay nearly there so it's just populating the windows and in a moment you'll see that we have a view of the actual device itself and the fact that all of these pins are currently not highlighted in color means that we've got a completely unassigned chip. So if we just take a quick look at my presentation for a second and we move here we can see that this is this is a fraction of the schematic of the board and we can see that this NPU pin PA13 is connected to LED4 which means we can toggle this pin and drive the LED so that's what we want to do so if we look for PA13 if I type in PA13 in the search box it will highlight PA13 it's currently unassigned but if I click on it I can select it as a GPIO output so now it's got some color if I zoom in we can see that it's it's it's listed as now as a GPIO output GPIO output let's give it a username by right clicking on it or rather a label and let's say let's give it something like LED PA13 okay here return and now I've given it a user label so that I can more easily identify in the code now if I go to the peripheral configuration column and I look for GPIO and double-click on it we can see now that I have a listing for PA13 and its initial condition is low we need to assign a pin context to it so here we select application and this is this is to to make it clear that it's going to be used at the application level we can leave all the rest by default it's output push pull no pull up no pull down and the user label is the one we assigned PA13 now the clock configurations are up can all be used as default we can make some changes but we don't have so much time to do that so now we can save the file the changes we've made and this will ask us do we want to generate code we say yes and it will open up the C++ perspective so we can actually see the changes we've made and this will now update our project with our and generate an empty project that we can now add code to so if I if I move make sure I move to the C++ perspective and then go and look at the main dot C that's been generated for me so under the sources here we go under core we have source we have main dot C and here we have a very very simple project so we've got two functions defined one to control to configure the clot tree want to configure the GPIO setup and again in in main we call the HAL initialization function we call the GPIO setup and then we put an empty while true loop and this is where we can add our code so we want a function to toggle the LED for example so we have in our firmware library we have a function called HAL underscore GPIO underscore and it's toggle but if I'm a little lazy I can use the eclipse function of autocomplete by pressing control and space and this will pull up that function for me I can hit return and it auto populates with some hints to tell us what I want to put in there we'll come back to that and then we want to delay because we want to be able to see this pin toggle so we can use HAL underscore delay use the same autocomplete function and it's how how delays the function we want so moving back to GPIO toggle it's asking me for a GPIO bank number and if I can't remember what that is but we remember we used a user label and we called it LED PA 13 so if I type LED underscore and then autocomplete it will give me some options okay and it's the bank number I want so this is a automatic curated definition that helps me when I'm coding so it's GPIO port and we can do the same for the LED underscore PA 13 pin number and it's so it's pin and the delay that we need to pass is a delay in milliseconds so we can type 500 for example make sure we've got a semicolon we hit save we hit build it will build we should have zero errors so if we just move back to the project top level of the project we can see that it's populated our memory regions again it's linked correctly because we don't have anything in any of the other regions other than SRAM and now we can simply do what we did before which is create a debug perspective so we go to the bug select debug as STM32C C++ application and this will open up a debug configuration we don't need to change anything in it at all we just click on okay and it will connect to the board download the code and it should stop at the first break first instruction after main which in this case is Halinit we can simply run it by clicking on the resume button and we should hopefully be able to see a toggling LED at 2 Hertz so there we go a very very quick overview of how to import an example into QBIDE and then how to create one of your own so I hope that's been useful please bear in mind that the complete instructions are in the PDF and thank you very much we'll move on to the final Q&A