 Hello, and welcome back to the last chapter of the STM32 L4 workshop. In this chapter, we are going to look at some tips and tricks so that we can optimise our audio player that we have just created in the previous section and make it a lot more greener or lower current. What we're going to do, we're going to start from exactly where we've left off in the previous section, at the end of step six where we had just added the display screen to our project. We're now going to reattach our multimeter to JP5, pins number one and two, and we're going to measure the current consumption of our application. At the moment, my board is currently running at about 15 mA in stop mode and about 17 mA in run mode. So how are we going to actually get current consumption out of our application? So we're going to have a look at what we can do within the architecture side of the STM32 L4. ARM have provided us with a Cortex N4F core, which gives us floating point variables, multiple bus structures and 12 cycle interrupts instructions. So we're going to use some of these features, primarily the interrupts, to weight the system up from various low power modes. So this is the low power modes selection we have available for the STM32 L4 and we're now going to start integrating these low power modes into our application. So we're going to play around with the sleep mode, low power run, stop modes, things like that, so that we can reduce the current consumption of the device itself. So in the ARTOS, we have multiple tasks running. I think we have four tasks in total running in our application. In between each of these tasks, the device will go into an idle state, just like the Windows PC goes into its idle state when it's running. In the idle state, the Cortex N4 core is still running around the equivalent of an empty loop. This empty loop is consuming a reasonable amount of power. So what we can do inside the ARTOS, we can go to what's called a tickless mode. This means that rather than running around the idle state all the time, we will then drop into a sleep mode and this should substantially reduce our average current consumption for our application. So what does tickless mode do inside the ARTOS? Well it stops the kernel and waits on an interrupt for bringing the MCU back out of the low power mode. There is a direct command inside the ARTOS called use tickless idle and this generates a macro that will put the device into the sleep state inside the Cortex M3s and M4 cores and the wake-up from the sleep state is via an event or an interrupt controlled by the ARTOS itself. So how do we enable tickless mode? This is controlled through the Cubemax tool and it's in the config and parameter section of the free ARTOS configuration and all we need to do is change the mode from currently disabled to an enabled state. So let's give this a try out. So we're going to open our audio player IOC file, so the Cubemax project from where we left off. We're going to go into the free ARTOS configuration as you have just seen and enable tickless mode. We're going to generate the project. Then we need to add one line of code inside our free ARTOS.c file to specify exactly which low power mode we're going to go into. Then we will build and run our code and we will compare how much current consumption we have saved to what we currently have now on our eval board. So if we go into our project where we left off and we go into the free ARTOS and look for config and parameters and then we need to scroll down until we find use tickless idle and then we need to enable our tickless idle and apply and OK. And then we go into project and generate our code. We still get the warning for our free ARTOS using the SysTick timer, so we want to generate our code. So now we want to open the folder where we have just generated our project.