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.
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.
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.
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.