Spread the love

After the Introduction to Arm Cortex-M Microcontrollers with STM32F4 family in lesson 1 and Understanding Development Environment of STM32F4 Discovery Board in lesson 3, we will head to Getting started with STM32F4 Discovery baord with CooCox IDE.

                        So, in this lesson our first step would be connecting the Discovery board with computer by installing  ST-LINK/V2 USB driver and then we took our second step, in which we set-up CooCox IDE with ARM toolchain so that we can develop application on that.

I have divided this lesson in two parts named as ST-LINK USB Driver and CooCox IDE .

When you connect your Discovery board with PC, your PC will not detect the board until driver of discovery board installed. This driver is called ST-LINK USB driver. Here is the steps to install and detect the discovery board.

Step 1: Connect the STMicroelectronics Discovery board to a USB port of your computer. When you connect, the STMicroelectronics Discovery board detection light starts blinking and then stops when your computer detects the Discovery board.

stm32f4_discovery

Step 2: Download ST-LINK/V2 USB driver file on your computer, and extract driver installation executable from the zip file. Double-click on the extracted executable to install the driver software, and follow the installation steps.

Right-click on Device Manager > Other Devices > STM32 STLink and then click Update Driver Software. Select the option ‘Browse my computer for driver software’.

update_driver_software_stm32_st_link

Step 3: Specify the Windows path in the Browse window, for example, “C:\Windows”. After you have detected the driver, you see the STM32F4 Discovery Board listed as shown.

device_manager_stm32f4

You can refer our lesson 2  which is Some useful links for STM32F4 Development for driver download and more.

To develop the application which will run on STM32F4 micrcontroller, we need IDE (Integrated Development Environment). There are many IDEs available in embedded market but we choose CooCox because of its wide community support and Opensource. CooCox is specially developed for the ARM Cortex Cores. To start work with CooCox you need to follow these simple steps:

Step 1: Download CooCox IDE  on your computer, run the setup file by double click on it and install.

Step 2: By installing CooCox IDE is not sufficient to develop application. We need ARM  GNU Cross Compiler which will generate binary(hex here) for our Microcontroller. So download the ARM Gcc comipler and install that.

Step 3: After installing ARM Gcc compiler, we need to set toolchain path for CooCox IDE.

Step 4: To set-up toolchain path, start CooCox IDE and  go to menu Project -> Select Toolchain Path as you can see on below figure.

select_toolchain_path

 Step 5: Then enter the path to location where arm-none-eabi-gcc.exe is located:

GCC_toolchain_path

And that’s it, your IDE is ready to compile code…..

To Download CooCox IDE and ARM Gcc toolchain you can refer lesson 2 which is Some useful links for STM32F4 Development