Difference between revisions of "Nucleo Boards"

From RobolaboWiki
Jump to: navigation, search
Line 81: Line 81:
  
 
<h2> Hello World </h2>
 
<h2> Hello World </h2>
Open STM32CubeIDE
+
In this Section a Hellow World (led blinking) example will be programmed on a NUCLE-F446RE board:
 +
 
 +
<ul>
 +
<li> Open STM32CubeIDE </li>
 +
<li> Select where to store the workspace </li>
 +
<li> Start new STM32 project </li>
 +
<li> Select board selector and Search part number Nucleo-F446RE. Press Next </li>
 +
<li> Chose a Project name (e.g. ledp) and keep the rest of parameters as they are. Press Finish</li>
 +
<li> Initialize all peripherals with their default Mode? --> Yes </li>
 +
<li> This kind of project is ssociated with the STM32CubeMx prespective. Do you want to open this perspective now? --> Yes. Download will start  </li>
 +
<li> Go to Src -> main.c. Look for while(1) in the main(void) function, and fill it as follows:
 +
<pre>
 +
while (1)
 +
{
 +
  /* USER CODE END WHILE */
 +
  HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
 +
  HAL_Delay(100);
 +
  /* USER CODE BEGIN 3 */
 +
}
 +
/* USER CODE END 3 */
 +
</pre> </li>
 +
 
 +
<li> Go to Project -> Build All (Ctrl+B or Hammer) </li>
 +
<li> Go to Run -> Debug. <br>
 +
Select STM32 MCU C/C++ Application and Press OK </li>
 +
<li> Leave all configuration propeties as they are and Press OK </li>
 +
<li> About the debug perspective say Switch </li>
 +
<li> Go to Run -> Resume (F8 or Green Arrow). The led should be blinking. <li>
 +
 
 +
 
 +
  </li>
 +
 
 +
 
 +
</ul>

Revision as of 13:34, 29 July 2019


STM32CubeIDE

Installation

Linux

Last release of STM32CubeIDE can be obtained here: https://www.st.com/en/development-tools/stm32cubeide.html.
For Debian like distributions (e.g. ubuntu), download the STM32CubeIDE-DEB file. To download it, you will need to provide name and a valid email address.

Unzip the file (e.g. <FILE> = en.st-stm32cubeide_1.0.1_3139_20190612_1256_amd64.deb_bundle)

unzip <FILE>.sh.zip

It will generate a .sh file. Give it permits for execution.

chmod 777 <FILE>.sh

Finally, execute the installation

sudo ./<FILE>.sh

You must accept all license agreements.


Windows

Last release of STM32CubeIDE can be obtained here: https://www.st.com/en/development-tools/stm32cubeide.html. .
For Windows like distributions, download the STM32CubeIDE-Win file. To download it, you will need to provide name and a valid email address.

Unzip the file and execute the binary. Follow all steps and accept all conditions.

MAC

Hello World

In this Section a Hellow World (led blinking) example will be programmed on a NUCLE-F446RE board:

  • Open STM32CubeIDE
  • Select where to store the workspace
  • Start new STM32 project
  • Select board selector and Search part number Nucleo-F446RE. Press Next
  • Chose a Project name (e.g. ledp) and keep the rest of parameters as they are. Press Finish
  • Initialize all peripherals with their default Mode? --> Yes
  • This kind of project is ssociated with the STM32CubeMx prespective. Do you want to open this perspective now? --> Yes. Download will start
  • Go to Src -> main.c. Look for while(1) in the main(void) function, and fill it as follows:
    while (1)
    {
      /* USER CODE END WHILE */
      HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
      HAL_Delay(100);
      /* USER CODE BEGIN 3 */
    }
    /* USER CODE END 3 */
    
  • Go to Project -> Build All (Ctrl+B or Hammer)
  • Go to Run -> Debug.
    Select STM32 MCU C/C++ Application and Press OK
  • Leave all configuration propeties as they are and Press OK
  • About the debug perspective say Switch
  • Go to Run -> Resume (F8 or Green Arrow). The led should be blinking.