PhotoElectricChefs
  • Shifted
  • Home
  • FHM
  • Tutorials
    • Home Made PCB (DIY)
    • ARM Tutorials>
      • Introduction
      • The Arduino style of programming
      • C++ Programming
      • Implementation
      • Your First Program
      • Compiling & Uploading
      • STM STUDIO
      • Acknowledgements
    • AVR Tutorials>
      • Introduction
      • Getting Started
    • Arduino Tutorials>
      • Getting Started -Installation
      • Hello world Program - LED Blink
      • Button Interface - Digital Input
      • Fading LED - Analog output
      • Communication -Serial
      • Digital Voltmeter - Analog Input
  • Electronics -An Idea
    • Batteries
    • Voltage and Current dividers
  • Blog
  • Contact Us
  • Untitled

Compiling & Uploading

         1.  Details of  compiling the project are as follows:

Once the CPP file is ready to be compiled, go to the msys.bat file and open it. Once it loads, type the command as

make blink.bin

where, blink is the name of your file, but .bin is a must.

If it compiles successfully there is no problem, otherwise recheck your program. Usually there is some case sensitive problem.Otherwise any arduino code can be ported to the ARM architecture without problem.

Once it compiles, you’ll see a blink.bin file next to your cpp file.


        2.    Uploading to the board.
Before we upload to the board. We need to do a small adjustment which is specific for each ARM board. After compiling above, enter the next command as follows.
make blink.flashstlink

This should open a new notepad file. Do not do anything. Just close the file.
Now you are ready to upload. Install the STM-LINK UTILITY if you haven’t already and open it.
Click on File->open and open the blink.bin file from the folder.

Thist will load the file. Then, click Target->Connect. If everything went well and the board is connected, it will connect to the target. If it says STLINK not detected, it is because you haven’t installed the driver or that it is not detected in the right USB port. Try changing the USB PORT.
Picture
Once connected, again click TARGET->PROGRAM AND VERIFY to upload the program.
Once uploaded you can test is by first disconnecting by clicking the TARGET-Disconnect button and hitting the reset button on the board.
Remember to load the bin file EVERYTIME the program is changed and compiled again.
Previous
Next
Powered by Create your own unique website with customizable templates.