Difference between revisions of "HANcoder/STM32/Getting Started Guide Flashing With The ST Link"
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{HANcoder}} | {{HANcoder}} | ||
− | Downloading the software program to the flash memory of the | + | Downloading the software program to the flash memory of the micro controller can be done with the help of the ST-Link. This chapter assumes the ST-Link utility is already installed. If this is not the case the installation procedure can be found[[HANcoder/STM32/Getting_Started_Installing_The_ST_Link| here]]. |
==Software program reconfiguration== | ==Software program reconfiguration== | ||
Line 12: | Line 12: | ||
==Uploading the software with the ST-link== | ==Uploading the software with the ST-link== | ||
− | For programming the | + | For programming the micro controller with the ST-Link, make sure that:<br/> |
• The ST-Link is connected to the Olimexino STM32 board through an ARM-JTAG-20-10 adapter from Olimex.<br/> | • The ST-Link is connected to the Olimexino STM32 board through an ARM-JTAG-20-10 adapter from Olimex.<br/> | ||
• The ST-Link is connected to the PC’s USB port.<br/> | • The ST-Link is connected to the PC’s USB port.<br/> | ||
Line 23: | Line 23: | ||
The following screen should appear:<br/> | The following screen should appear:<br/> | ||
− | [[File:GettingStartedGuideSTM32_STlinkUtility1.png|800px]] | + | [[File:GettingStartedGuideSTM32_STlinkUtility1.png|800px]]<br/> |
+ | |||
Next click “Program and Verify” in the Target menu or simply press CTRL+P<br/> | Next click “Program and Verify” in the Target menu or simply press CTRL+P<br/> | ||
− | [[File:GettingStartedGuideSTM32_STlinkUtility2.jpeg|800px]] | + | [[File:GettingStartedGuideSTM32_STlinkUtility2.jpeg|800px]]<br/> |
+ | |||
Click on '''Browse''' and choose the .srec file you want to flash to the controller, located in the same folder as the Simulink model:<br/> | Click on '''Browse''' and choose the .srec file you want to flash to the controller, located in the same folder as the Simulink model:<br/> | ||
− | [[File:GettingStartedGuideSTM32_STlinkUtilityBrowse.png|600px]] | + | [[File:GettingStartedGuideSTM32_STlinkUtilityBrowse.png|600px]]<br/> |
+ | |||
The following screen will appear:<br/> | The following screen will appear:<br/> | ||
− | [[File:GettingStartedGuideSTM32_STlinkUtilityFlash.png|600px]] | + | [[File:GettingStartedGuideSTM32_STlinkUtilityFlash.png|600px]]<br/> |
− | Press start and the flash procedure will start. The program is now flashed on the | + | |
+ | Press start and the flash procedure will start. The program is now flashed on the micro controller and is ready to use. The following message will appear in the console of the STM32 ST-Link Utility:<br/> | ||
''Flash memory programmed in 4s and 509ms<br/> | ''Flash memory programmed in 4s and 509ms<br/> | ||
Verification…OK''<br/> | Verification…OK''<br/> | ||
+ | |||
+ | ==Flashing the bootloader== | ||
+ | The bootloader can be flashed onto the Olimexino in exactly the same way as a program from Simulink. The bootloader files can be found in:<br/> | ||
+ | ‘\Target\bootloader\Demo\ARMCM3_STM32_Olimex_Olimexino_GCC\Boot\bin’ use the openbtl_olimex_olimexino_can.srec for the CAN bootloader and the openbtl_olimex_olimexino_usb.srec for the USB bootloader.<br/> | ||
+ | |||
+ | ''NOTE: Make sure that after the bootloader is flashed on the Olimexino, the ST-LINK is disconnected from the development board'' | ||
+ | |||
+ | |||
+ | [[HANcoder/STM32/Getting_Started_Guide_Flashing_With_The_Bootloader| Alternative way to flash(using the bootloader and Microboot)]]<br/> | ||
+ | |||
+ | [[HANcoder/STM32/Getting_Started_Guide_Build_Test| Previous step (Test the build procedure)]]<br/> | ||
+ | [[HANcoder/STM32/Getting_Started_Installing_The_Virtual_COM_port| Next step (Installing the virtual COM port)]]<br/> |
Latest revision as of 09:52, 31 March 2017
Downloading the software program to the flash memory of the micro controller can be done with the help of the ST-Link. This chapter assumes the ST-Link utility is already installed. If this is not the case the installation procedure can be found here.
Software program reconfiguration
Before the software program can be flashed via the ST-Link a minor reconfiguration has to be done. This reconfiguration step can be performed entirely in the Simulink model. Open the Simulink model as described in Select Simulation -> Configuration Parameters… from the menu.
In the Real-Time Workshop configuration screen, add “HANcoder_BOOTLOADER=0” to the Make command and click OK.
Now the software program is properly configured for the use without the bootloader.
Uploading the software with the ST-link
For programming the micro controller with the ST-Link, make sure that:
• The ST-Link is connected to the Olimexino STM32 board through an ARM-JTAG-20-10 adapter from Olimex.
• The ST-Link is connected to the PC’s USB port.
• Power is supplied to the Olimexino board (in the figure with usb).
Start the STM32 ST-Link utility, located in the Start Menu under All Programs\STMicroelectronics\STM32 ST-Link Utility
Connect to the target by clicking the “connect” button or by simply pressing “Enter”.
The following screen should appear:
Next click “Program and Verify” in the Target menu or simply press CTRL+P
Click on Browse and choose the .srec file you want to flash to the controller, located in the same folder as the Simulink model:
The following screen will appear:
Press start and the flash procedure will start. The program is now flashed on the micro controller and is ready to use. The following message will appear in the console of the STM32 ST-Link Utility:
Flash memory programmed in 4s and 509ms
Verification…OK
Flashing the bootloader
The bootloader can be flashed onto the Olimexino in exactly the same way as a program from Simulink. The bootloader files can be found in:
‘\Target\bootloader\Demo\ARMCM3_STM32_Olimex_Olimexino_GCC\Boot\bin’ use the openbtl_olimex_olimexino_can.srec for the CAN bootloader and the openbtl_olimex_olimexino_usb.srec for the USB bootloader.
NOTE: Make sure that after the bootloader is flashed on the Olimexino, the ST-LINK is disconnected from the development board
Alternative way to flash(using the bootloader and Microboot)
Previous step (Test the build procedure)
Next step (Installing the virtual COM port)