8 years, 4 months ago.

How to program after compiling?

Hi, I have compiled a program using the online compiler but I don't know to program to my ARM uc. I am using this ARM uc for the first time and I am using an online compiler also for the first time. Can anybody help me?

1 Answer

8 years, 4 months ago.

Which board with the ARM uc are you using ? If the board is MBED enabled then your board will enumerate as a USB drive (flash drive) letter. So after you compile, save the compiled binary file onto the drive letter linked to the adapter board and the rest will be automatic. The MBED code on the target board will take this compiled binary file and reflash the CPU to run your custom code. Summary : Drag and drop the compiled file onto the drive letter linked to the adapter board (check your Device Manager for details of the drive letter for your CPU adapter board). If in doubt, post back more details of your CPU board. Hope this helps.

Accepted Answer

Yes my board is MBED enabled. And the uc I am using is ARM CORTEX M3 LPC1768. So I have to drag and drop the saved compiled binary file to the USB flash drive?

posted by Sachin D 06 Jan 2016

That is correct Sachin. Simply drag & drop the compiled binary file onto the drive letter and often the target CPU board will flash some LEDs to note the upload and flash programming. Immediately after completion of this code refresh, the CPU will reset automatically and run your custom code. Have fun !

posted by Sanjiv Bhatia 06 Jan 2016

What should i do to refresh? I dropped the file and refreshed but nothing is happening.

posted by Sachin D 06 Jan 2016

And also if i want to run another code on my uc should i delete the current binary file and then add the file which i want to run?

posted by Sachin D 06 Jan 2016

Every time you drag & drop a fresh file, the CPU flash memory is automatically refreshed. Nothing extra needs to be done. Suggest you start with the simple blink code to test that the toolchain is working correctly for you. Go here and select the IMPORT THIS PROGRAM button on the right side of the webpage:

https://developer.mbed.org/teams/mbed/code/mbed_blinky/

Also, in the imported program there is always a MBED library. Be sure to mouse select the MBED library inside your compiler code tree and select the UPDATE on the right side of the compiler page. This is important and then the MBED library will be updated to the latest release. We found this to be an issue and unless you perform this update, your code may not work as advertised. As noted, start with the BLINKY code and confirm you are able to blink the onboard LED present on your CPU board. Then change the delays in the code to get comfortable with the C code -> compile and save onto the drive letter again - did the delays between LED flashes change as expected ? Then move on from there. MBED is an amazing tool and the cost is even better :) You will save hours of coding using this tool.

Specifically - you do not need to erase the older program on your target board. Once you drag & drop a new program binary image, the board will automatically erase the older version of the flash memory. Really nice and simple.

posted by Sanjiv Bhatia 06 Jan 2016

Thanks for the information Sanjiv. Really helpful.

posted by Sachin D 06 Jan 2016