Difference between revisions of "LPC1768: Keil Project For Bin File"
(Created page with "category: LPC1768 Tutorials =Objective= In this tutorial we will see how to setup a keil project to generate .hex file for LPC1768<br><br> File:00_Lpc7168_Keil.png<br>...") |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[category: LPC1768 Tutorials]] | [[category: LPC1768 Tutorials]] | ||
=Objective= | =Objective= | ||
− | In this tutorial we will see how to setup a keil project to generate . | + | In this tutorial we will see how to setup a keil project to generate .bin file for LPC1768<br><br> |
− | [[File: | + | [[File:01_Lpc7168_Keil.png]]<br><br> |
=Keil Setup Steps= | =Keil Setup Steps= | ||
Line 27: | Line 27: | ||
<html> | <html> | ||
<script src="https://gist.github.com/SaheblalBagwan/cb2cf78aadc724737d79.js"></script> | <script src="https://gist.github.com/SaheblalBagwan/cb2cf78aadc724737d79.js"></script> | ||
+ | </html> | ||
+ | <br> | ||
+ | <html> | ||
+ | <script src="https://gist.github.com/SaheblalBagwan/fe401523c97e4cb2d7e98565e1bd3b06.js"></script> | ||
</html> | </html> | ||
<br> | <br> | ||
Line 42: | Line 46: | ||
[[File:Lpc1768_Keil_11.png]]<br><br> | [[File:Lpc1768_Keil_11.png]]<br><br> | ||
− | <b>Step12:</b> Code is compiled with no errors. The <b>. | + | <b>Step12:</b> Code is compiled with no errors. The <b>.bin</b> file is still not generated.<br> |
[[File:Lpc1768_Keil_12.png]]<br><br> | [[File:Lpc1768_Keil_12.png]]<br><br> | ||
− | = | + | =Setup Bin File Generation= |
− | <b>Step13:</b> Click on <b>Target Options</b> to select the option for generating . | + | <b>Step13:</b> Click on <b>Target Options</b> to select the option for generating .bin file.<br> |
[[File:Lpc1768_Keil_13.png]]<br><br> | [[File:Lpc1768_Keil_13.png]]<br><br> | ||
− | <b>Step14:</b> Set IROM1 start address as 0x0000.<br> | + | <b>Step14:</b> Set IROM1 start address as 0x2000. Bootloader will be stored from 0x0000-0x2000 so application should start from 0x2000<br> |
− | [[File: | + | [[File:Lpc1768_Keil_21.png]]<br><br> |
+ | |||
+ | <b>Step15:</b> Write the command to generate the <b>.bin</b> file from <b>.axf</b> file<br> | ||
+ | Command: fromelf --bin LedBlink.axf --output LedBlink.bin<br> | ||
+ | [[File:Lpc1768_Keil_22.png]]<br><br> | ||
− | <b> | + | <b>Step16:</b> Now enable the linker option to use the IROM1 address from target settings<br> |
− | [[File: | + | [[File:Lpc1768_Keil_23.png]]<br><br> |
− | <b> | + | <b>Step17:</b> .Bin file is generated after a rebuild.<br> |
− | [[File: | + | [[File:Lpc1768_Keil_24.png]]<br><br> |
− | <b> | + | <b>Step18:</b> Check the project folder for the generated .Bin<ER_ROM1> file. <br> |
− | [[File: | + | [[File:Lpc1768_Keil_25.png]]<br> |
<br><br> | <br><br> | ||
− | =Uploading the | + | =Uploading the Bin file= |
− | After generating the . | + | After generating the .bin file check this tutorial for [[LPC1768: Uploading Hex and Bin files|Uploading Hex and Bin files.]]. |
<br><br> | <br><br> | ||
Latest revision as of 16:35, 27 October 2017
Contents
Objective
In this tutorial we will see how to setup a keil project to generate .bin file for LPC1768
Keil Setup Steps
Step1: Open the Keil software and select the New Microvision project from Project Menu as shown below.
Step2: Browse to your project folder and provide the project name and click on save.
Step3: Once the project is saved a new pop up “Select Device for Target” opens, Select the controller(NXP:LPC1768) and click on OK.
Step4: Select the controller(NXP:LPC1768) and click on OK.
Step5: As LPC1768 needs the startup code, click on Yes option to include the LPC17xx Startup file.
Step6: Create a new file to write the program.
Step7: Type the code or Copy paste the below code snippet.
Step8: After typing the code save the file as main.c.
Step9: Add the recently saved file to the project.
Step10: Add the main.c along with system_LPC17xx.c.
Step11: Build the project and fix the compiler errors/warnings if any.
Step12: Code is compiled with no errors. The .bin file is still not generated.
Setup Bin File Generation
Step13: Click on Target Options to select the option for generating .bin file.
Step14: Set IROM1 start address as 0x2000. Bootloader will be stored from 0x0000-0x2000 so application should start from 0x2000
Step15: Write the command to generate the .bin file from .axf file
Command: fromelf --bin LedBlink.axf --output LedBlink.bin
Step16: Now enable the linker option to use the IROM1 address from target settings
Step17: .Bin file is generated after a rebuild.
Step18: Check the project folder for the generated .Bin<ER_ROM1> file.
Uploading the Bin file
After generating the .bin file check this tutorial for Uploading Hex and Bin files..
Downloads
Download the complete project folder from the below link:
https://codeload.github.com/ExploreEmbedded/Explore-Cortex-M3-LPC1768-Stick-DVB-14001/zip/master
Have a opinion, suggestion , question or feedback about the article let it out here!