Difference between revisions of "ST Nucleo-F103RB Workshop"

From media_wiki
Jump to: navigation, search
Line 3: Line 3:
 
'''STM32 Nucleo User Manual'''<br>
 
'''STM32 Nucleo User Manual'''<br>
 
https://www.st.com/resource/en/user_manual/dm00105823-stm32-nucleo-64-boards-mb1136-stmicroelectronics.pdf <br>
 
https://www.st.com/resource/en/user_manual/dm00105823-stm32-nucleo-64-boards-mb1136-stmicroelectronics.pdf <br>
 +
'''STM32 Nucleo Main Web Page'''<br>
 +
https://www.st.com/en/evaluation-tools/nucleo-f103rb.html<br>
 +
 
The NUCLEO-F103RB development board uses the STM32F103RBT6 as the target processor.  (The is the same processor used on "Blue Pill" boards.)
 
The NUCLEO-F103RB development board uses the STM32F103RBT6 as the target processor.  (The is the same processor used on "Blue Pill" boards.)
 
It was after playing with the "Blue Pill" boards that I decided I need a REAL STMicro development board.  This board is a rock solid development board with on-board ST-Link loader / debugger.
 
It was after playing with the "Blue Pill" boards that I decided I need a REAL STMicro development board.  This board is a rock solid development board with on-board ST-Link loader / debugger.
Line 20: Line 23:
 
* UART2 connects the target processor to the ST-Link, providing a USB COM port connection on the host computer.  Uses PA2 for TX, and PA3 for RX.
 
* UART2 connects the target processor to the ST-Link, providing a USB COM port connection on the host computer.  Uses PA2 for TX, and PA3 for RX.
 
* ST-Link connects to TCK (PA14), TMS (PA13)
 
* ST-Link connects to TCK (PA14), TMS (PA13)
https://www.st.com/en/evaluation-tools/nucleo-f103rb.html<br>
+
 
  
 
<strong>External STLink V2:</strong><br> https://www.st.com/resource/en/user_manual/dm00026748-stlinkv2-incircuit-debuggerprogrammer-for-stm8-and-stm32-stmicroelectronics.pdf<br>
 
<strong>External STLink V2:</strong><br> https://www.st.com/resource/en/user_manual/dm00026748-stlinkv2-incircuit-debuggerprogrammer-for-stm8-and-stm32-stmicroelectronics.pdf<br>

Revision as of 02:42, 30 August 2020


STM32 Nucleo User Manual
https://www.st.com/resource/en/user_manual/dm00105823-stm32-nucleo-64-boards-mb1136-stmicroelectronics.pdf
STM32 Nucleo Main Web Page
https://www.st.com/en/evaluation-tools/nucleo-f103rb.html

The NUCLEO-F103RB development board uses the STM32F103RBT6 as the target processor. (The is the same processor used on "Blue Pill" boards.) It was after playing with the "Blue Pill" boards that I decided I need a REAL STMicro development board. This board is a rock solid development board with on-board ST-Link loader / debugger.

Processor: STM32F103RBT6
128KB Flash
20KB SRAM
72MHz clock
Single-cycle multiplication and hardware division
2.0 to 3.6 V application supply and I/Os

Hardware

  • Green LED, LD2, connected to PA5, illuminates when driven high
  • Blue PushButton, B1, connects to PC13, grounding the signal when pressed
  • 32,768Hz crystal oscillator, LSE, used for Real Time Clock (RTC)
  • 8MHz HSE, is provided by the 8MHz crystal oscillator from the attached ST-Link, into PD0
  • UART2 connects the target processor to the ST-Link, providing a USB COM port connection on the host computer. Uses PA2 for TX, and PA3 for RX.
  • ST-Link connects to TCK (PA14), TMS (PA13)


External STLink V2:
https://www.st.com/resource/en/user_manual/dm00026748-stlinkv2-incircuit-debuggerprogrammer-for-stm8-and-stm32-stmicroelectronics.pdf

Firmware
https://www.st.com/en/evaluation-tools/nucleo-f103rb.html
https://www.st.com/en/embedded-software/stm32cubef1.html

ST Website for the STM32F1 family: http://www.st.com/stm32f1

Getting Started

1 Open STM32CubeMX
2 Create New Project using "Start My project from ST Board" selector button
3 In the "Commercial Part Number" box, enter NUCLEO-F103RB
4 The board will display in the lower right part of the screen.  Select the board.
5 Click on Start Project in upper right corner of window
6 A dialog will be displayed, asking "Initialize all peripherals with their default Mode ?"
   Select Yes
7 Using the Clock Configuration tab, a 64MHz SYSCLK is configured by default.  This can be adjusted to 72MHz if desired.
8 Using the Project Manager tab, give the project a name.  Something like "Blinky" will work well.
9 Within this same tab, select MDK-ARM for "Toolchain/IDE".  This instructs the Keil uVision application to be used.
10 Select GENERATE CODE button in upper right corner.
   (You may get a dialog box indicating you are missing some dependencies.  Select "Yes" to download them now.)
11 Select Open Project when prompted.
   (Keil may need to run it's package installer if it doesn't have support for the board.  This will take some time.  Don't click anything!)
12 Within Keil IDE, before we make any changes / additions to the code, let's make sure it builds.  Click on Project -> Build Target
   You can use the short-cut icon, available in the tool-bar, to Build(F7)
13 Within the project view, open the project, and then the Application/User/Core folder and then double click main.c
14 The LED GPIO should already have initialization code within MX_GPIO_Init().
   Find the infinite loop inside the main() function, and add the following two highlighted lines of code:
 
 /* Infinite loop */
 /* USER CODE BEGIN WHILE */
 while (1)
 {
   HAL_GPIO_TogglePin(LD2_GPIO_Port,LD2_Pin);
   HAL_Delay(500);
   /* USER CODE END WHILE */

   /* USER CODE BEGIN 3 */
 }
 
 NOTE:
 Be sure to always place your code between the USER CODE BEGIN and USER CODE END comments
 This will protect your code from being removed should you make changes using the STM32CubeMX again.

14 Click Build (F7)
15 Click Download (F8)
16 At this point the board should now contain your code.  Press the reset button to watch it run.

Arduino IDE Support
Using the Arduino Board Manager for the "duino" family
https://www.instructables.com/id/Quick-Start-to-STM-Nucleo-on-Arduino-IDE/
http://www.emcu.eu/2017/03/13/how-to-use-stm32-and-arduino-ide/