 ని నాంలి నికింరి. సిఎ అలి ని ాకూసి సిందినీ. సిలూలి కిలూలాల౰ి సికిందాంర్తీ అలూలి సిలూ ఆరందిలూడిలూ ెలూలి మరూలూ పయరూ ఆంరి మం going to spend some time on programming tools that are running on the development platform it could be a PC running in the windows or running a Linux OS so we have some tools running on the development platform when I say development platform it is not the ARM based hardware platform that is the target platform development platform is where we develop the software that needs to run on the processor so this programming tools are running on the development platform so we will spend some time on understanding them and how to interface them with the assembly and see programming software so the focus of this discussion is going to be on just a brief overview ok a very top level overview of various tools available and based on the processor that we choose the tool that we need to use will ask for the design so that will change so this discussion is only to give you a flavor of what are the tools available and I urge people to go into those tools specifically based on the processor that is being used especially if an HFC suppose you are buying an ARM based solution from the third party there will be so many companies making the keep using the ARM core so then I have a demo tool and the OS integrated already so based on the development platform the tools may differ so the idea here is to give you a overview of what are the tools available so that any tool that you look at you will be familiar with the overall functioning of them and what they do so that once you read the manual of those specific tools you will understand them better so after talking here based on you know talking about some tools on ARM based development platform you know that is what is being supplied by ARM as a development platform there are some standards defined by ARM for how to interface a C program or a C program for that matter with the assembly of ARM okay to generate a executable and executable okay so an executable could be built only with a C source type or C and assembly and then of course some libraries coming along with the ARM tools this could be supplied by ARM or a third party tool vendor or a social vendor so it could come from any various sources but they all comply some standard which ARM has defined that is called ARM procedure called standard for a particular programming language to be interface with the assembly of ARM and then how it uses the registers in the processor so we will study them in little bit more in detail and then we look at a sample implementation okay using metagraphics tool so this is going to be our focus today in this lecture okay let us just understand what are the various you know means that you know you are offering or whatever you call are related to the tools okay this is what you will hear more often about tool chain so let me define what it is in software okay now we are all talking about software okay so as I mentioned let me I will be showing you a picture about how the target platform is going to do a dialog on the platform here let us see what is the tool chain is in software a tool chain is a set of programming tools that are used to create a product a product could be an executable okay it is not something you can see or touch but this is an executable coming out okay the software which will be downloaded into the target hardware and then the tools may be used in a chain that means one after the other this tool is used first and then each output is set to the another tool then that output will go out to another tool then finally what you get is an executable which can be downloaded onto the target platform to run that and see how it is okay so the tool chain is used basically to develop this software tool chain is used widely to refer to any set of links or interrelated development so they are all interrelated because they understand one format so this tool generates an output and the next tool in the chain should know what is the format of this particular chain and how to interpret it then only it will be able to use this input to generate an output so they are interrelated it is not that you can connect to tools which do not understand each other a simple software development tool chain consists of a compiler link loader to transform a set of high level language code files into an executable program or a language so you can have multiple C files okay and then compile them generate multiple OVJ files then objectify them okay then we may have ASM files also that will be assembled by an assembler which is a compiler right and then this is an assembler so assembler and generator now to file okay it would be dot you know yes and then what you do all these OVJ files and file coming out of this assembler you can use a linker to link them all okay to generate a linker so linker format also dot is to perform a linker and now we can actually generate an executable when we say executable then we know that the code or data all those links are placed somewhere in a memory okay we know where it exactly goes so there may be a separate tool for loader could be used or we could use the linker we could add a separate another scatter file folder okay I will explain that in the next discussion scatter file is actually decides where this particular code or data segments reside in the memory okay so this will be the executable now let some time you may not be interested in generating an executable but you are interested in getting a library that means it may not be a final program executable but it is a part of the program may be you know it gives all the floating point operations captured there so if anyone wants to use this library they can interact with their own code and generate an executable so linker the library is not an individual executable because it needs to be connected to another set of process you know code to generate an executable but it is an intermediate executable so we could do any of these things based on know what is an input to a particular tool and know what you want to do it okay so there are different possibilities let us know I will explain you some of the things so it also provides interfaces to the operating system what I mean by operating system interface means the the final executable may it will have may have an image of the OS also integrate with that okay or may be OS is running already and then know if it is a Linux or something may be you can download only your application and then copy it into your hard disk and then run it as a separate application so that is the difference it depends on whether it is an embedded word or it is in a PC word where you have a OS already running there and then you generate an executable and run it on that so we might in the case of normally in the embedded a scenario the OS is also interest you know integrated with the application and then a single executable or an image is loaded into the hard disk so OS is already there in it along with your own application code so when the processor reset happens and then it comes up OS comes first and then it is yes know gives the control to the application that you have made and then it runs on the hardware so there must be some way of connecting these two okay OS calling the application or application calling some routine also OS so that kind of the interfaces are also provided by the tool what is the deep other I will explain the test hold on the complex for it such as a video game these tools for an example there is a software tool that I have been explaining now a typical video game if you want to do then there are tools to take sound effects music or three-dimensional models or animation and the further tools for combining these with the finished product so this is a software tool change as far as the video game development is concerned okay so tool change is not specific to only the compiler and to use that it could be a tool change for developing a video game where you will have different types of tools to be connected together to generate an output product so in a typical compiler linker output product to be a library or it could be an executable okay now let us talk about ARM based development so this is a typical environment I was talking about so this is a development platform okay let us have a clarity on that okay this is a development platform and this is a target platform okay so what I mean by that is this where this is the chip what you can see is a ARM processor okay now this is connected to the development platform to a JTAG port okay this is an interface we I will talk about this little bit more in the next person so you may wonder what is the need for this JTAG right the reason being the executable are the building the library tools things are done in this dashboard and once that is done then it needs to be finally put into the target hardware therefore giving the power and then you know you may be giving a button here somewhere and then restarting that you know starting that particular application so and then not only that not only loading the software through this table we also debug it what I mean by debug it since the debugger is what is running here we will have all the necessary features to look at the program control okay you can stop the particular program execution and then look at all the register content whatever the tool that we have seen in the simulator it does not have an hardware interface but we can have a hardware interface and then run the software and then get the output from the hardware and then we will be able to look at all the register content variable whatever variables we are modifying at a different point in time during the execution so the debugger helps us in providing that kind of a interface so that we will be able to see what is being done by the software whether is there any no mistake or is there any bugs in the code is it behaving the way it is expected to so those kind of things can be done before the application is tested fully debug fully and then it can be released to the final product so this target platform need not be the final platform so it could be a development platform we might have this if only in the final may be a product goes into a car or it could go into a missile so they may have the same processor on processor what we are using here but it may not have all these interfaces to the debugger and connecting and then setting it so before we put our code into this target final product what is being done is we use the similar processor in the development as a development platform and then test the software then run through a lot of test cases not through test cases a set of test cases to make sure that different scenarios you generate different inputs or timing scenarios and verify that the software is taking you know meeting all the requirements and it is very stable and reliable in the development platform and then take it to the final in the target platform ok in the target platform I would say that it is also a closer to the target the actual target but it is used as a development for the development so may be we can call them as the target hardware and then the development platform this whole thing could be considered as a development platform because we are using this also is not a final target hardware that we are using it could know it is intermediate stage where it has got all the provisions to be connected and then we will be able to see what is happening there ok and then finally it will be put into the final product where you will be able to see that it works as a point to the specification so this is what normally done in any development stage so what are the tools are used in the PC ok this is a typical scenario where I have shown this in the beginning of this lecture so C source files they can even consider it as a C++ or any other file any other source also but according to the tools will change once the source file changes so there are C header files and then what it generates is an object code and may be we can have an assembler also which is taking in assembly files so you may wonder which are the things will be in C source and which are will be in normally the time critical modules will be implemented in assembly and then most of the functionalities will be implemented in a higher level language so what is the need for going in for assembly because some of the things which you want to have a you know closer control on how much time it takes how it you know executes those things if you want to a time critical routine if you want to write it then it is better to go in for a assembly file because optimise it making use of all the features of the processor and create a executable which is in terms of code size as per the performance is better I am not saying that the compiler will not generate very optimal code there are so many optimisation flags and there are very good technologies in the compiler generation that they also develop or they also generate output file which are closer to our assembly file whatever you do but still you understand the your application scenario much better than what you see as compiler could do and what how can you communicate that to the compiler so there may be some limitation on what you can do with the C source file what about you know I will have a language so we can develop a you know critical routine in assembly and then use standard features of library you know I will tell you some examples of where we use libraries simple example is printer we do not want to implement printer which is already standardised and it is available as a library so there is no point in spending time in writing a printer protein there are so many library files which are already implemented and there are very optimal implementation of that is available for a particular target platform so we can use those library files and link it here only what you do is we provide a scatter file to give a memory map of the final hardware where it is supposed to be running so your target hardware may have a flash somewhere or a RAM somewhere in a some memory they are mapped to that particular addresses so you have to make sure that our data or stack reside in this kind of in this memory okay or OS may be there so those things we have to mention it in the link file and then generate an executable so this is what is done in the using the different tools and the different software okay so what are the development tools so this is the development studio it is a professional software development solution for Linux base embedded systems it covers all the stages in development from boot code and kernel port into application developers and profiling what is the profiling you have to know which part of the module is taking more time okay you may be interested to know that in the application and then if it is suppose very critical and you feel that it is taking more time may be you may decide to optimize this much better than what you have done earlier with the tool compiler tool and then still if you feel that it is not making your requirement may be we have to write a assembly of that exact same of you know part of that or maybe a sub portion of that in assembly and then see how it performs so this kind of measuring the time taken by a particular to know routine is all possible with the profiling tools okay it includes the tools development today includes an ID okay it is a you know integrated development environment at least it is a you know language or you know platform which is useful to develop okay so this ID is eclipse based so it is very easy to interface with that you can add on you can forth even the simulator that we are using is an eclipse based platform okay I am sorry that is the different thing I am talking about so let us not bother about those tools this particular development studio is eclipse based so compilation tools they are fully feature graphical debugger okay I told you what is a debugger simulation model maybe your target platform is model maybe you can use a simulation model to run that in the software itself in the PC so without having a target hardware the whole thing can be simulated in the PC along with the your software running on them so there are so many examples of Linux 4 and then basically they are also used by the semiconductor companies who build the SOS based on the so when the you know semiconductor companies they build an SOC with the ARM they they finally they will be they will be selling the SOC along with their software okay to other vendors who will be using their chip with their hardware so why the semiconductor companies you know building the SOC and then they need to check okay this may be an in-house OS or it could be a Linux or any other best-quality OS or freeware and then they will be adding their own library so for them to do the basic software that needs to be run on the ARM as well as the you know the SOC SOC in the sense it will have other peripheral name and use and cache so they may have to optimize this those things and then develop away more than the application developer even the semiconductor companies were building SOCs based on ARM will be using these tools what are the debugging tools DX train is one so ARM Bieber and trace hardware unit what is the trace hardware unit is actually ARM processor is there okay it will have its own trace buffer it is called some trace buffer I will take it to be so while the program is running it will be there is some information in the trace buffer which can be downloaded to a PC so what is the need for it suppose the software is running in the hardware and you want to know at a particular time when there is a crash or the software is fading and then exception is raised you want to know what has happened which has led to that particular crash so the trace module is the behavior of different you know the values of registers or you know memory what all the things what is going to change those things are captured there so which can be downloaded and then you know the detailed analysis can be done on that I will put to verify or identify the program it could be a memory problem corruption or it could be a software bug or a pointer may be a character all that can be debug using a trace hardware okay so it enables to connect a software debug to ARM processor based target using a hardware interface such that a j tag or a serial wire debug okay this is where j tag is the joint instruction group so this is the generic hardware as well as software definition to verify and then get the values of particular processor or achieve so it can actually go into that and then get those bit pattern out okay so basically even configure the particular values in the registers or peripherals or even we can make the ARM processor to run up to instructions by feeding in some data into it so the j tag is an interface hardware interface which can be understood by the debugger okay and while building the chip also that j tag support should be built into it okay so generally a j tag cable can be connected and then we can talk to the hardware through this j tag hardware interface the debugger understand how to make use of it and the hardware has a support for that so this much of no overview is enough maybe you can read more about j tag it also enables collection of trace from a device trace means a different capture of data from for non-intensive debugger code okay so it is a comprehensive solution for development and debugging a complex that is the you know summary so trace is an essential tool for absorbing complex timing related issues as I told you you know whether any particular module is taking more time maybe that also can be required or any particular interruptives are coming there is maybe some event is happening at a particular time then the system is crashing so this kind of very specific events can also be traced and then analyzed to find out the cause for a problem it enables course analysis of a software issue which doesn't need for any module which is a software or hardware problem so actually in most of the real time scenarios we do not want to tweak the code or tweak the code in the sense add more elements or modify the product final software which is going to be running in the hardware and then debug it we want to debug the exact hardware which is going to be in the system so if that is to be done then we need to have a hardware support which is a trace buffer and trace hardware unit so that we don't have to change the software image or add more modules to the software to get some information about what is happening inside so the hardware only gets you information about what has happened while the software is running in the hardware so that we can debug it and then analyze the issue and fix it during the development phase so compiler toolchain ARM compiler toolchain can be used to build programs from any language I will have a language or assembly and then ARM and then C C++ compiler normally used or called ARM CC ARM CC if you call it as a vectorize compiler it will work which is you know SIMD that I talked about VFP it supports this feature so that vector instructions can be integrated along with your software of course if you are using VFP then we need to have invoke this otherwise the normal ARM CC compiler may not understand your vectorize VFP is a instruction and then ARM and ARM assembler is ARM ASM and linker is ARM link and if you want to build a library then you that ARM app driver AR means then what is this so by normally the output format is called AL embedded linking end okay this format may not be compatible to a particular hardware okay so from else to some different binary format okay more than the hardware we want to use some tools may be flash tools or a loaded tool to load the binary file that has been generated into the hardware okay so you may have to use a flash memory is there we may have to write the executable the code has to be flashed into the flash which is there in the hardware so that may mean the format something different from which is linker generated executable comes out of the ARM tool so there is the ARM tool which converts that L format to a compatible binary format which could be understood by the flash the flashing device or maybe a loader to load into the hardware okay the image has to be finally put into it so what the image may have it may say that in this particular address in a particular binary code okay so that all the assembly instructions converted into encoded into a 32 bit format no it will be giving the address and then what is the content so address content so it may be expressed in some particular format so that wherever that is mapping to this in the flash device in that location it has to be put so it is a time consuming job of flashing it so there are different tools available there can only particular format then we can have this tool to convert that from the output coming out of the tool train that is the ARM tool train and then put it into the hardware hardware so that is the job of this then what other formats suitable to RAM tools okay support libraries as I mentioned some of the functions are USB related things are even calling a main domain remember recall I mentioned that stack pointer for all the modes have to be initialized so that could be a library and we can feed that information also or it could be done by OS OS also may be integrated so those things also have to be finally integrated with your application and then finally executable sketch got and that will be put into the RAM or a flash using these tools okay there are some application binary interfaces okay that is called EBA okay what is this so ABA for ARM architecture with a collection of standards some open and some three to ARM architecture it regulates the inter operation of binary files and development tools in the spectrum of ARM architecture based execution environment so there are some standards I will explain you with some examples so that you understand so those things have to be if the development tools need to adhere to these ABA which has been defined by ARM so that suppose no different companies are developing tools for the ARM architecture so when you have OBJ files from this and then some other OBJ files from there and then if you want to link maybe you want to even libraries are generated by some some tools and then you want to integrate it with the output tools coming from output files coming from other tools so there should be some standard defined so that there is some uniformity and then they can inter operate otherwise there will be too much of confusion in terms of who will develop in the library with which tool and with version of the tool so there are too much of unambiguity can come in when the output files are only interacted with the rest of the files that we have so there should be some standard to be followed so that is defined by this ABI and then all the tool vendors will be following that now it would be useful for from their metal to major operating systems such as ARM line so what is bare metal? bare metal means that just the processor is there and memory is there, no other hardware is there ok there is no OS running there so if you want to run your code without any OS then you know we have to take care of locating and putting everything and then if you are creating multiple files how do you move from one to the other or this is with that so that is the bare metal method otherwise you may have a loaded OS and then you have to add only your application so ABI for ARM architecture includes ok this is standard ARM architecture procedure cost standard and executable useful format and what is for you know this is the executable file ok how particular sections are defined how static data is defined how globally variables are defined how they are looked at so this kind of there is a standard format for that and ARM has defined something specific to its own register specific details ok so else format is generic to any cloud it is not under assuming any particular else format is common for any so ARM has to map to the else format so it may say that my register r0 is mapped to some other register which is defined by my r1 is mapped to this so this kind of a register format which is to ARM is defined in this document on the office how to understand the debug information in the executable when you are using a pc for debugging your software you are interested in looking at a particular variable value where actually a variable value may be a integer a but it may be finally converted to some assembly some address in a data area so how do you link this address with the label that a variable a so this kind of information is captured here in a debug format so the base platform ABA is a C++ ABA exception handling ABA runtime ABA so it may take 10 or 15 hours to even go into each of these details to talk about it but the intent of this particular address is to give you an overview and when you go into those tools and documentation you will be able to appreciate what is given there so now our focus for this class is going to be to understand how do we link C source file and then assembly file and how do we talk to each other how there are some parameters from C if suppose you want to parse it how it is done in there so by generating a C file converting a C file into a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .