diff --git a/Readme.md b/Readme.md index c2aa480..ac764f8 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ # SSD1306 OLED Servo Control with STM32 Blue Pill -This project demonstrates how to control a servo motor using an IBT_2 (BTS7960) motor driver, an STM32 Blue Pill, and a 128x64 SSD1306 OLED display. The user can control the motor's speed and direction using four push buttons, with real-time feedback on the OLED screen. +This project demonstrates how to control a servo motor using an IBT_2 (BTS7960) motor driver, an STM32 Blue Pill, and a 128x64 SSD1306 OLED display. The user can control the motor's speed and direction using four push buttons, with real-time feedback on the OLED screen. It shows how to use the DAPLink programmer in Arduino IDE v2 with debugging. ## Features @@ -14,7 +14,6 @@ This project demonstrates how to control a servo motor using an IBT_2 (BTS7960) * STM32F103C8T6 "Blue Pill" development board * 128x64 SSD1306 OLED display (I2C) with 4 push buttons (up, down, OK, Back) * IBT_2 (dual BTS7960) motor driver -* * Servo motor e.g.: RS-550 or R-775 * External power supply for the motor 12-24V/5A * Breadboard and jumper wires @@ -47,14 +46,14 @@ The buttons are connected to GPIO pins using the internal pull-up resistors. The The IBT_2 module requires its own power supply for the motor. -| IBT_2 Pin | Blue Pill Pin | Description | -| :-------- | :------------ | :--------------------------- | -| VCC | 5V | Logic Power | -| GND | GND | Logic Ground | +| IBT_2 Pin | Blue Pill Pin | Description | +| :-------- | :------------ | :--------------------------- | +| VCC | 5V | Logic Power | +| GND | GND | Logic Ground | | R_EN | 3.3V | Right Enable (connect to 3.3V) | | L_EN | 3.3V | Left Enable (connect to 3.3V) | -| RPWM | PB0 | Right PWM Signal (Forward) | -| LPWM | PB1 | Left PWM Signal (Reverse) | +| RPWM | PB0 | Right PWM Signal (Forward) | +| LPWM | PB1 | Left PWM Signal (Reverse) | ### DAPLink UART @@ -157,7 +156,7 @@ Here is an example command to upload the sketch using DAPLink: This section describes how to enable **hardware debugging** for the STM32F103 "Blue Pill" board using a **DAPLink / CMSIS-DAP** debugger in **Arduino IDE 2**. By default, the STM32 Arduino core loads the wrong OpenOCD configuration (`dapdirect_swd`, meant for ST-Link). -Until the (bug)[https://github.com/stm32duino/Arduino_Core_STM32/issues/2807] is not fixed, follow these steps to fix it: +Until the [issues/2807](https://github.com/stm32duino/Arduino_Core_STM32/issues/2807) is not fixed, follow these steps to work around it: ### 🧭 1. Locate STM32 Core Folder (Linux) @@ -166,9 +165,9 @@ Open a terminal and navigate to your STM32 Arduino core installation: ```bash cd ~/.arduino15/packages/STMicroelectronics/hardware/stm32/2.11.0/ ``` - Adjust the version number if different (check in Arduino IDE → Tools → Board → Boards Manager). +Adjust the version number if different (check in Arduino IDE → Tools → Board → Boards Manager). -🧰 2. Create or Edit platform.local.txt +🧰 2. Create or Edit `platform.local.txt` Create (or edit) a local override file: @@ -187,19 +186,20 @@ Save and close (Ctrl + O, Enter, Ctrl + X). These lines tell OpenOCD to: - Use the CMSIS-DAP interface (interface/cmsis-dap.cfg) +- Use the CMSIS-DAP interface `interface/cmsis-dap.cfg` - Use standard SWD transport (select_swd.cfg) instead of dapdirect_swd +- Use standard SWD transport `select_swd.cfg` instead of `dapdirect_swd` 🔁 3. Restart Arduino IDE Completely close and reopen Arduino IDE 2 to apply the new settings. + ⚙️ 4. Configure the IDE In Arduino IDE → Tools, set: - Debug symbols and core logs → Core Logs and Symbols Enabled (-g) +- Debug symbols and core logs → Core Logs and Symbols Enabled (-g) - Optimize → Debug (-Og) +- Optimize → Debug (-Og) Then click the 🐞 Debug icon and press Start Debugging. \ No newline at end of file