Hello, welcome back.
So in this first lesson or in this first practical lesson, we're going to see how to create tasks.
In our free ARTUS real time system, I'm going to create a new project by coming over here, project
new estimate, 32 projects like this over here.
I'll select my board over here, I'll search ASTM 32 for one one.
I'm using DSM three to four one one nucleo, so I'll select this over here and then I'll click next.
Next, it's down here, it's out of the screen.
This is next click next over here and then I'll give this project a name, I'll call it task creation.
And then over here to get to prototype, I'm going to keep it at SDM 32 Cube because we need to go to
SDM 32 Cube to include our Toscano and also to include the Toynbee's.
We could just use empty bay.
If we use empty, we would have to manually include the frittatas files.
We have to go and download the files and manually include them to our path.
So I'll use them to 32 over here.
OK, so I'll click next.
And then I'll click finish.
So it says device configuration to ED associated with device configuration to perspective, do you want
to open this perspective now?
I would say yes.
So this is the the Cuba mix perspective, so I should mention we're not going to be creating our artists
using Cuba mics, we simply need to include the middleware and then select the time we want to use as
the artists can.
Time, Time-Based.
And then we're going to go and quote the task creation to semaphore creation, we're going to quote
all of that from scratch.
And then when we get to where we've learnt all the various APIs of the arm of the Artosis, then then
we'll learn how to.
Enable that use in Cuba without writing code and then learn how to apply something known as the Simms's
ARTUS APIs, but for now we simply going to write the better free ARTUS.
We're going to use the free Arktos functions.
There's a layer on top of free Archos known as Simms's artists, which wraps around a free ARTUS functions.
We shall see how to use those later.
So this is how, Chip, it's giving us an image of it.
I'm going to come over here.
Middleware, drop this and then I'll select free artists over here, and then, as you can see, it's
asking what I want to use Simms's V1 or Simms's V. to isolate Simms's V2.
Right.
So after we've selected.
This this fall opens all this bit here, open scientific parameters, this allows us to configure our
artist parameters.
The version of free artists used here is the ten point two, ten point two point one, and then it's
telling us the system clock, this is our take rate and then maximum name length, we can give our tasks
names.
And this is the number of characters that the name can have, things like that.
So all of this, we would see how to configure them manually so we wouldn't do any configurations here.
OK, let's go other topics here, let's see and when we create this, it automatically creates a task
for us.
So there is this difficult task that is created.
Right, we cannot remove it, so I'll keep it.
I I'll just leave it like this, but when we go to our code, we delete it and start writing the tasks
from scratch.
OK, so once you've included this.
Once you've included the middle where?
Then all you have to do is select your time.
So what we did, just to recap, we came to free toes here on the middle were and then we selected Simms's
V2 two.
That's all we've done so far.
So once that is done, we go into.
We're going to come over here to system call.
And then under system here and a time this year, we're not going to use system, it's recommended to
use a different time base.
So I use time as one as the time base.
OK, so once that is done, one other thing I'll do over here is enable our Ewart's so that we can use
the you out to debug our artists so that you are just connected to a one and two.
One way to enable the you are to module is to simply come to connectivity and then you go to use that
to you are to use its means.
The same thing it's written you Satya because you.
S stands for Universal Synchronoss asynchronous receiver transmitter because we often use just the asynchronous
bits.
We often see just you out without.
Yes.
So it's the same what you.
So I just clicked here, USA to this is the one which is connected to our USB port, our come to mode
over here and then our select asynchronous mode, like I mentioned earlier, and I'll leave everything
here the same.
Right, and then I'll close this.
And then.
Click here to generate the code, this this symbol here.
This auction can be associated with a C slash C++ perspective, do you want to open this perspective?
I'll say yes.
So whenever the perspective is about to switch, we receive a message, OK?
So it says device configuration to update an.
OK, here we go.
So our project is here in the corner here.
The target.
OK.
Let me switch the perspective.
OK, so what are we going to do is I'm going to come to a window here and come to Perspective's.
And then open perspective.
Also, research perspective.
Research over here.
OK, so this the one we are all used to when it comes to clips, you have your project explorer here.
OK, so this is our project.
It's collected all the files, like I said.
Well, we were interested in the.
The path to this project, Mindiola, but Cuba allows us just to click and include.
OK, so before we continue, I'm going to go ahead and increase the font size, I'll come to window
preferences over here.
And then.
Come to general.
Or drop down, general, like this, and then I can come to editors over here.
Let's see Pierrot's.
So, General, over here, editors.
I'll drop down text editors or I can simply open text editors, so general editors, text editors,
colors and phones.
And then this opens and then I click here to edit.
And then over here, I could choose 14, I'll say, OK.
PLI.
That's 14 look big enough.
OK, so I'll close now applying close.
OK, so this is what we have and then so to simplify what we've got here, I'm going to clean.
I'm going to clean everything right, except the the time these and the include, so.
No comment, I'm going to clean this right at this stage, you wouldn't know what this means.
So this is clean as well.
This one to.
This so I'm simply removing the comments so that you see how simple the whole thing is with the comments.
It's hard to know which is which.
OK, so clean this.
Clean this.
Still cleanin comments.
OK, OK, so of sufficiently Klina comments, let's see what we have left.
OK, so this is our main function.
Our main started by calling this function in a hole in it.
This means hardware obstruction.
That's what will host for in it.
And this initializes some hardware stuff.
When you are using Cuba, it's always comes with a hole in it.
We can implement the content of this function ourselves, but that's not the purpose of this course.
So after hole in its hole in it would initialize what time I should be used for our delay function,
for instance, because we can see how delay and gets the amount of delay that we pass as argument to
that particular hole delay function.
So HOLLIN it deals with that stuff.
It would sort it out for us and then their system configured system clock config and this configures
the system clock the clock for the the the main system clock as well as the clock for the various buses.
You should know that our microcontroller has multiple buses and is from these buses that the various
peripherals and modules Gadhia Clock.
So you would have a situation where you have two peripherals with different clock.
The reason why you can have two peripherals and they have different clocks is because they're cerebus
the the on separate buses.
And even apart from that, we can apply a preschooler to each peripheral to reduce its clock.
So anyway, the system clock on fiqh allows us to configure the systems clock as well as the clock for
the various buses and the microcontroller.
And we shall see those.
We shall talk about them when we need them.
So we have APV, one bus, EPB to bus each bus, things like this.
And you can find these names in the comments here.
But that is not the purpose here.
So that's what system config does.
That's what it's done here.
So this system config function has been included here for us.
Does a system config, as you can see over here, right?
There isn't much with this.
So then then we have to use that to you, its function, because we enabled the user to then this was
included and we can find the implementation of this function down here.
So basically, user two was configured to run out one hundred and one hundred and fifteen thousand two
hundred point rates than other configurations were included.
OK, then we have a what are you in it?
And inside this GPL you in it which is the.
The third function or yeah, the third function called here we simply enabling access.
To the sports, you put a remember GPA, you e is where are you at Pinsker are connected to Impey three.
So in order to be able to use them, in order to be able to use that, you are to clock access needs
to be enabled to these pins and thus the cingulate.
That's the thing our.
And interesting for us, and then after that, we have our always canno initialise, and this is Colonel
Initialise comes with.
Simms's artus remember free artosis separate from Simms's Artus free Archos as a real time canno built
by one company, Simms's artists, is a standardization that is applied on top of free artists to make
the free Arktos functions look similar to other Arktos functions.
What I mean by this is with this way of writing, the function always threaten you.
If I'm using a different artists such as call artists, I'll write exactly the same thing and I'll be
able to create a new a new thread dysfunction, always thread new.
If I wanted to create a new thread in a separate Real-Time operating system like Call Art, which is
another popular operating system out there.
If I write this function, it would work the same way as if I write it using free artists.
And what allows this standardization is Simms's artists.
So Simms's Artosis a wrapper around.
And already exist in real time operating system.
So in these initial lessons, like I said, we're not going to be working with are just going to use
the actual functions of three artists.
And then later on we shall see how to use the Simms's ARTUS APIs.
So what I'm going to do is I'm going to delete the out stuff or delete this year.
And yeah, so now we simply have our hardware initialization hole in its system.
Clock Jhpiego.
You oughton it and then let's see.
So when we in Cuba, we saw that there was a difficult task that was there and we couldn't delete it.
So this is the difficult task.
Remember, a task as a task is like a main function.
So you see it has an infinite loop here.
Whenever you see an infinite loop inside a function, that function is is a task.
OK, so I'll delete this.
We don't need this as well.
So this is our time because remember, we select a time we want to be out.
What time is this code was generated because of that?
So this is a short overview of what we collected because we've deleted this task, remove its prototype
from here.
So what we have left is simply our hardware initialization we initialised.
Just the peripherals we use and there is no art or stuff here, no, there's nothing to do with our
here, we've included Simms's or storage and then there's me each and inside me and what we may have
some of our favorite artists.
Let's go inside me agency.
I'll double click this right click.
I'll say open declaration, OK?
So does this mean that each inside mean that each we have estimated to hold each OK, so our free Arktos
head of ours will be included here.
Then we can click here, Simms's, who is.
Knowledge open declaration here.
Let's see.
OK, so this in here, we have free after storage, so our free artosis included here together with
certain definitions of the CMC Sports Apeace, OK, so free actors have all this included for us.
Right.
So let's build and see we've cleaned.
Let's do it and see what we have.
It's building.
So it's built successfully writes.
OK, so we brought you out here to be used as a tool.
So we're going to be we're going to be using the you ought to print various debug information, as well
as feedback that we require from our various tasks.
To do this, we need to install a zero program on our computer to be able to receive or to display what
is received from the popular ones, include terrorism or Real-Time.
If you have any one of these, you can.
You can.
You can keep them without downloading a new one, but for those of you who do not have any serious program,
we're going to download real time.
So you simply open your browser.
And then you're going to search real time over here like this, and then you can just click.
You can click one of these links.
I'll click this first one to see if we get it.
It's open in.
I've read this before, so I just click to accept you over here.
And once this is done, click download over here.
And it says your download will start shortly.
And as you can see over here, it's finished downloading, so click over here to open it.
I say, yes, I've installed this before, by the way, so I see next over here.
Next.
There needs to this is a very straightforward was it.
OK, so Registar Real-Time Automation Server, I don't want to do any of this, um, I don't want to
open read me, so just finish after this.
OK, so we have real time.
Right.
So once that is done, there's one other thing.
OK, let's let's check before we do this other thing.
Um.
So you are on itself, doesn't work with printf in order to use the printf, we have to retarget it.
So we have to implement the Pusha function, which char or put character is a function in C language.
So we have to perform our own implementation of it in order to be able to use printf.
So we have to write and underscore, underscore, io underscore, underscore, put H.E.R over here and
then this would take into a segment.
OK, so there's the function Prototyp so down here we can implement the function.
I'll copy this.
And I implement a function over here, OK?
What we want to do is call the the you are to transmit function.
So if we were if we wanted to transmit a character, we would do whole underscore you at underscore
transmit.
And the first document of this is the address of our Ewart's instance one, this one here.
So this the first document where we.
Piece this over here and then we put the numbers on sign here like this.
So if you want to know more about this function you just highlighted.
We can highlight this and then we'll be told more about it, since an amount of data in blocking mode
when you watch is not disabled.
So it tells us from one parent to parent to me.
There is the first problem here says.
Point out to you what type of structure and then the second paragraph is pointed to the data above the
third parameter, which is the third parameter or argument is the amount of data element.
And then the last argument or parameter is the time out.
Right.
So.
Ampersand right here and then next we.
We see you in St..
We typecast this argument here to you in eight.
And I to point up the name of the argument to see besides this one and then time out, I'm going to
see your over here.
I'm going to see if if like this.
OK, so now.
Let's see, I don't want to use Pranav and I just want to transmit a character, I could have done this.
I could have just pasted this in here and then I'll see, OK?
Oh, see, message, I sent message messages, an array of size one and message has each in its.
And over here, I'll pass messages, arguments, I could see this, OK, and then let's build I'll build
this.
But to show you what we would have to do without doing this.
Let's see.
There's an issue here, control reaches.
And then over here, it says, OK, so we forgot to return.
Remember, this has to return on end.
So do the implementation of gutshot is first.
Do you transmit the documents and then to return the documents?
OK, so I'll do it again.
OK, this is we've got to warning's.
Right over here, we just put the brackets around the scoreboard, so we click to build.
And it's looking good what we want to do.
I want to comment on this implementation that we've just done, so you just hold on control and then
you press the button or you can highlight it and come to source and then select comment over here.
Block comment or Tokyo, your comments.
OK, so let's see.
We don't have anything to do with posture at the moment, and we've just initialized the US.
Click here to build.
And we are transmitting your transmitting this, OK, so to flush onto our board, you have to click
here, click over here, debark.
And then I'll say, OK.
It's opening in the northeast, which.
And then I'm going to open real time.
Here we are.
So come on the porch over here, then I'll select the port, the port for my borders, Port 16, I select
this over here.
And then the boat, as we saw, is one one five two zero zero.
So come over here then, once all of this is done or click open ports, OK, and then I'm going to click
to at this stage, our program is frozen.
Whenever you come to the debug view the program, you or your family would restart and then it will
be frozen.
You have to click play to let it play.
So I click play over here and I can see we are transmitting our h h h h h ok.
Stop.
Right.
So then the question is, what if we want to transmit a sentence?
Are we going to implement character by character?
Or maybe we keep this sentence in a buffer?
We can keep the sentence in a buffer and then just make sure the size is the size of the buffer and
we'll be able to transmit it.
But a more effective way is to use our printf, which we are used to from C language.
So I'm going to uncommented this.
I'm going to delete this, then delete this as well.
This was just a test.
And then over here or Cuccia, I'm going to uncommented as well.
OK, so once we've done this now, I'll come over here.
Right, print of a siff, I mean, see language.
Hello from SDM, then two, and then I'll see you lying carriage return over here and then I'll put
this over here, click over here to build.
So we've got a warning.
OK, the reason we would have a warning is in order to use Pranav, if you have to include Witheridge,
so I'll come over here and see include SDD by the ridge.
OK, click over here to build.
No, no warning.
OK, click debug.
Switch.
OK, and then I'll click play, then I'm going to go to real team.
Going to clear this.
Yes, you can put.
Nothing is showing us stop this.
So let's inspect our targets code again.
This is the prototype and the implementation.
OK, so over here, it's supposed to be under school on the school aisle and then a single underscore
before picture to underscore underscored by a single on the school nova here.
How transmit this over here, C.H..
We've got a pass.
It's us, C.H. Ambersons, over here.
OK, so this has to be exactly the same, just a single mistake.
And to make it work, right, because it exists somewhere, you are trying to provide your own implementation
to replace what already exists.
OK, so this is just to show us how to use print if we still got into the ARTUS bit.
So if.
Yeah.
So just bear with me.
I would say I could just drop this quote and then we move on.
But I want us to figure this together so it's both no error, no warning applicable I had about.
And then switch.
And then, um, let's bring real time side by side is over here, I'll click to run.
Let's be real to.
OK.
Barge trigger Honda, we saw some data hello from ASTM 32, so I'm going to restart real time, OK?
I'm going to open it again.
So I've just opened real time, I come here about rates.
This one one five two zero zero, a drop down over here.
This is the port for my board and then I'll open over here, as you can see, we have hello from ASTM
to this ayliffe.
S.R. is for our line feed carriage return.
OK, so we have a data being transmitted so we can be type in.
Deba from we can be type in debug information from task number one, debug from task number two and
things like that, and this would give us an idea of how the artosis working.
OK, so this order is for this one configuration configuration, our system and the next lesson we shall
get into the task creation itself.
So this order is and I'll see you in the next lesson.
Have a nice day.