Difference between revisions of "LPC2148 Keil Setup for .bin file"
(Created page with "category: LPC2148 Tutorials In this tutorial we will see how to setup a keil project to generate .bin file for LPC1768<br><br> File:01_Lpc7168_Keil.png<br><br> =Keil...") |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
=Keil Setup Steps= | =Keil Setup Steps= | ||
<b>Step1:</b> Open the Keil software and select the New Microvision project from Project Menu as shown below.<br> | <b>Step1:</b> Open the Keil software and select the New Microvision project from Project Menu as shown below.<br> | ||
− | [[File: | + | [[File:LPC2148KeilSetup01.png]]<br><br> |
<b>Step2:</b> Browse to your project folder and provide the project name and click on save.<br> | <b>Step2:</b> Browse to your project folder and provide the project name and click on save.<br> | ||
− | [[File: | + | [[File:LPC2148KeilSetup02.png]]<br><br> |
− | <b>Step3:</b> Once the project is saved a new pop up “Select Device for Target” opens, Select the controller(NXP: | + | <b>Step3:</b> Once the project is saved a new pop up “Select Device for Target” opens, Select the controller(NXP:LPC2148) and click on OK.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup03.png]]<br><br> |
− | |||
− | |||
− | <b> | + | <b>Step4:</b> As LPC2148 needs the startup code, click on <b>Yes</b> option to include the <b>Startup</b> file.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup04.png]]<br><br> |
− | <b> | + | <b>Step5:</b> Create a new file to write the program.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup05.png]]<br><br> |
− | <b> | + | <b>Step6:</b> Type the code or Copy paste the below code snippet.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup06.png]] |
<html> | <html> | ||
− | <script src="https://gist.github.com/SaheblalBagwan/ | + | <script src="https://gist.github.com/SaheblalBagwan/909eeca444c2a2a24aa0e9442bb00a07.js"></script> |
</html> | </html> | ||
<br> | <br> | ||
− | <b> | + | <b>Step7:</b> After typing the code save the file as <b>main.c</b>.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup07.png]]<br><br> |
− | <b> | + | <b>Step8:</b> Add the recently saved file to the project.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup08.png]]<br><br> |
− | <b> | + | <b>Step9:</b> Add the main.c to the project.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup09.png]]<br><br> |
− | <b> | + | <b>Step10:</b> Build the project and fix the compiler errors/warnings if any.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup10.png]]<br><br> |
− | <b> | + | <b>Step11:</b> Code is compiled with no errors. The <b>.bin</b> file is still not generated.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup11.png]]<br><br> |
=Setup Bin File Generation= | =Setup Bin File Generation= | ||
− | <b> | + | <b>Step12:</b> Click on <b>Target Options</b> to select the option for generating .bin file.<br> |
− | [[File: | + | [[File:LPC2148KeilSetup12.png]]<br><br> |
− | <b> | + | <b>Step13:</b> Set IROM1 start address as 0x2000. Bootloader will be stored from 0x0000-0x2000 so application should start from 0x2000<br> |
− | [[File: | + | [[File:LPC2148KeilSetup21.png]]<br><br> |
+ | |||
+ | <b>Step14:</b>Enable the linker setting to use the IROM1 address as configured in above step. | ||
+ | [[File:LPC2148KeilSetup24.png]]<br><br> | ||
<b>Step15:</b> Write the command to generate the <b>.bin</b> file from <b>.axf</b> file<br> | <b>Step15:</b> Write the command to generate the <b>.bin</b> file from <b>.axf</b> file<br> | ||
− | Command: fromelf --bin | + | Command: fromelf --bin KeilSetup.axf --output KeilSetup.bin<br> |
− | [[File: | + | [[File:LPC2148KeilSetup22.png]]<br><br> |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | <b> | + | <b>Step16:</b> .Bin file is generated after a rebuild. Check the project folder for the generated .bin file. <br> |
− | [[File: | + | [[File:LPC2148KeilSetup23.png]]<br> |
<br><br> | <br><br> | ||
=Uploading the Bin file= | =Uploading the Bin file= | ||
− | After generating the .bin file check this tutorial for [[ | + | After generating the .bin file check this tutorial for [[LPC2148: Uploading .bin file|Uploading Bin files.]]. |
<br><br> | <br><br> | ||
Latest revision as of 15:41, 30 July 2016
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:LPC2148) and click on OK.
Step4: As LPC2148 needs the startup code, click on Yes option to include the Startup file.
Step5: Create a new file to write the program.
Step6: Type the code or Copy paste the below code snippet.
Step7: After typing the code save the file as main.c.
Step8: Add the recently saved file to the project.
Step9: Add the main.c to the project.
Step10: Build the project and fix the compiler errors/warnings if any.
Step11: Code is compiled with no errors. The .bin file is still not generated.
Setup Bin File Generation
Step12: Click on Target Options to select the option for generating .bin file.
Step13: Set IROM1 start address as 0x2000. Bootloader will be stored from 0x0000-0x2000 so application should start from 0x2000
Step14:Enable the linker setting to use the IROM1 address as configured in above step.
Step15: Write the command to generate the .bin file from .axf file
Command: fromelf --bin KeilSetup.axf --output KeilSetup.bin
Step16: .Bin file is generated after a rebuild. Check the project folder for the generated .bin file.
Uploading the Bin file
After generating the .bin file check this tutorial for Uploading 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!