嘉立創(chuàng)地闊星STM32F103C8T6 arduino ch340串口燒錄
因?yàn)槭掷锩嬗幸粋€(gè)ESP-01S的下載器,芯片是CH340的,想著應(yīng)該能用的話,就暫時(shí)不用買(mǎi)ST-LINK或USB轉(zhuǎn)TTL模塊了。
燒錄時(shí)老是忘記細(xì)節(jié),每次遇到報(bào)錯(cuò)都要排查一遍,特別麻煩,特此記錄一下燒錄前的檢查項(xiàng)。
Sketch uses 14200 bytes (21%) of program storage space. Maximum is 65536 bytes. Global variables use 2184 bytes (10%) of dynamic memory, leaving 18296 bytes for local variables. Maximum is 20480 bytes. maple_loader v0.1 Resetting to bootloader via DTR pulse # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=38372, tid=0x0000000000008198 # # JRE version: Java(TM) SE Runtime Environment (8.0_451) (build 1.8.0_451-b10) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.451-b10 mixed mode windows-amd64 compressed oops) # Problematic frame: # C [jSSC-2.8_x86_64.dll+0xb5db] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # An error report file with more information is saved as: # C:\Users\alpha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2022.9.26\win\hs_err_pid38372.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. #
物料清單
嘉立創(chuàng)地闊星開(kāi)發(fā)板STM32F103C8T6
CH340燒錄(我這里用的是ESP-01S的下載器)


檢查項(xiàng)一
連線
| STM32F103C8T6 | CH340 |
| 3V3 | 3V3 |
| GND | GND |
| A09 (TX) | TXD |
| A10 (RX) | RXD |
引腳圖

檢查項(xiàng)二
跳線帽如下
| BT1 | 0 |
| BT0 | 1 |

檢查項(xiàng)三
打開(kāi)STM32CubeProgrammer測(cè)試連接。
先選UART;再選Port;最后點(diǎn)connect。如果連接成功,可以關(guān)掉STM32CubeProgrammer,防止端口占用。

連接成功如圖所示:

檢查項(xiàng)四
打開(kāi)Arduino,檢查開(kāi)發(fā)板燒錄配置,upload method修改為"Serial"。

燒錄成功

附上測(cè)試代碼
/* * Test program for the STM32F103C8T6 */ #include "Arduino.h" int counter = 0; // const int PA1 = 11; // const int PA3 = 13; void setup() { Serial.begin(9600); Serial.println("Hello, World!"); pinMode(PA3, OUTPUT); pinMode(PA1, OUTPUT); } void loop() { Serial.println("Hello, World!!!" + String(counter)); counter++; delay(1000); digitalWrite(PA3, HIGH); digitalWrite(PA1, HIGH); delay(1000); digitalWrite(PA3, LOW); digitalWrite(PA1, LOW); delay(1000); }

浙公網(wǎng)安備 33010602011771號(hào)