How to create a ‘.Bin’ file in keil Tool
This is a Post that tells you how to create and upload bin file to lpc2148.It is an easy method to upload the code.When you connect the arm stick it shows as a mass storage device and you can paste the code into it.We can avoid the flashing time by using this method.
Creating a project
1.Open keil software , select project and click on new microvision project.
2.Select the location where you want to store the program.
5.Press Yes button.
7.After creating new file , type the code and save with extension ‘.c ‘.
8.Add the saved file to source Group
1. Select Target option to generate ‘.Bin’ file.
2. Set IROM1 start address 0X3000. Boot loader will be stored from 0X0000-0X3000, so application will be stored from 0X3000.
3. Choose Linker setting. Select ‘Use memory layout from target option‘ to use the IROM1 address as configured in set up.
Command: fromelf –bin “led.axf” –output “led.bin”
6.Rebuild the project . You can see the ‘.Bin’ file in the project folder
To upload the bin file to LPC2148, first you have to flash the secondary boot loader to the controller using flash magic software.Then you should shot the USB pin to internal USB at the bottom of the arm stick , default it is connected to external USB. Remove the jumpers on the arm stick (ISP,JTAG) and connect the arm stick to PC using USB cable. Then it is detected as mass storage device in your PC. Just open the device and delete the old .bin file in the mass storage device and paste the new file. Press the reset button then the code will work.
How to flash a ‘hex’ to LPC2148
1. Open flash magic software.
7. Click on Start button to flash the program.
After flashing hex file, remove the jumper (ISP,JTAG). Then you should shot the USB pin to internal USB at the bottom of the arm stick, default it is connected to external USB and connect the ARM stick to your PC. You can see that arm stick is detected as mass storage device.
Press Reset button. Now your application is running on the board.