STM32 Upload executable file in STM32CubeIDE
#
ProgrammerST-LINK/V2 μ ν/νΈννμ μ΄μ©νμλ©΄ λ©λλ€. μ€μ μ λ°λΌ UART, USB DFU λ±μ μ¬μ©ν μλ μμ΅λλ€.
#
Boot modeBOOT1 | BOOT2 | Boot mode | Aliasing |
---|---|---|---|
X | 0 | User Flash memory | User Flash memory is selected as the boot space |
0 | 1 | System memory | System memory is selected as the boot space |
1 | 1 | Embedded SRAM | Embedded SRAM is selected as the boot space |
- User Flash memory: (0x08000000)μμ μμνλ μΌλ°μ μΈ λΆν μ λλ€. ST-LINK/V2λ₯Ό μ¬μ©νλ©΄ μ¬μ©μκ° μ€ν νμΌμ μ λ‘λ ν λ, νλμ λ©λͺ¨λ¦¬μ μ€ν νμΌμ΄ λ€μ΄λ‘λ λ©λλ€. λ°λΌμ 첫 λ²μ§Έ μ΅μ μΌλ‘ λΆν ν κ²½μ° μ¬μ©μκ° μμ±ν μ€ν νμΌμ΄ λ°λ‘ μ€νλ©λλ€.
- System memory: (0x1FFFF000)μμ μμνλ λΆν μ λλ€. μμ€ν λ©λͺ¨λ¦¬μλ κΈ°λ³Έμ μΈ λΆνΈλ‘λκ° μμ΅λλ€. μ΄ λΆνΈλ‘λλ μ λ‘λμ μ¬μ©λ ν΅μ μ μ΄κΈ°ννκ³ ν΄λΉ ν΅μ μ΄ μμλ λκΉμ§ κΈ°λ€λ¦½λλ€. ν΅μ μ ν΅ν΄ μ¬μ©μκ° μ€ν νμΌμ μ λ‘λνλ©΄, νλμ λ©λͺ¨λ¦¬μ λ€μ΄λ‘λ λ©λλ€. 보λλ§λ€ μ§μνλ ν΅μ λ°©λ²μ΄ λ€μνκΈ° λλ¬Έμ AN2606 λ¬Έμλ₯Ό μ°Έκ³ νμκΈ° λ°λλλ€.
- Embedded SRAM: (0x20000000)μμ μμνλ λΆν μ λλ€.
tip
보λλ₯Ό 보면 B0, B1 κ³Ό κ΄λ ¨λ νμ΄ μμ΅λλ€. ν΄λΉ νμ Vccμ μ°κ²°νλ©΄ μνκ° 1 μ΄ λκ³ , GNDμ μ°κ²°νλ©΄ μνκ° 0 μ΄ λ©λλ€. User Flash memoryμ System memoryλ₯Ό μ£Όλ‘ μ¬μ©νκ² λκΈ° λλ¬Έμ B1λ GNDμ κ³ μ νκ³ B0λ§ λ°κΏκ°λ©° μ¬μ©νλ©΄ λ©λλ€.
#
UARTUARTλ‘λ νλμ λ©λͺ¨λ¦¬μ μ€ν νμΌμ μ§μ μ λ‘λ ν μ μκΈ° λλ¬Έμ, λΆνΈλ‘λμ λμμ λ°μμΌ ν©λλ€. λΆνΈλ‘λλ₯Ό μ¬μ©νκΈ° μν΄ λΆνΈ λͺ¨λλ System memoryλ₯Ό μ ννλ©΄ λ©λλ€. λ°λΌμ B1μ GNDμ B0λ Vccμ μ°κ²°ν©λλ€. μ€ν νμΌμ μ λ‘λν λ€μλ λΆνΈ λͺ¨λλ₯Ό λ€μ User Flash memoryλ‘ λ°κΎΌ ν, 리μ λ²νΌμ λλ¬μΌν©λλ€.
보λλ§λ€ UART νμ΄ λ€λ₯΄κΈ° λλ¬Έμ λΆνΈλ‘λκ° μ§μνλ ν΅μ κ³Ό νμ νμΈ ν΄μΌν©λλ€. STM32F103 보λμ κ²½μ° UART1μ μ¬μ©νκΈ° λλ¬Έμ USBtoUARTμ 보λμ UART1μ μ°κ²°νλ©΄ λ©λλ€.
#
ST-LINK/V2
ST-LINK/V2λ₯Ό μ¬μ©νλ©΄ νλμ λ©λͺ¨λ¦¬μ μ€ν νμΌμ΄ λ°λ‘ μ λ‘λ λκΈ° λλ¬Έμ λΆνΈ λͺ¨λλ User Flash memoryλ₯Ό μ ννλ©΄ λ©λλ€. λ°λΌμ B1, B0 λͺ¨λ GNDμ μ°κ²°ν©λλ€.
μμ κ°μ μλ¬λ₯Ό 보면 System memory λͺ¨λλ‘ 1ν μ λ‘λ ν λ€μ User Flash memoryλ‘ λ³κ²½ ν μ¬μ©νμκΈ° λ°λλλ€.
#
Upload#
STM32CubeIDE- Run -> Debug Configurations
- STM32 Coretex-M C/C++ Application -> <project> Debug -> Debugger ν
- Debug probe -> ST-LINK
- GDB Server Command Line Options
- SWD, JTAG μ€ μ ν
- Check ST-Link S/N -> Scan
- Click Apply -> Debug
μ€μ νμλ Run -> Run or Debug λλ Run or Debug(F11) λ²νΌμ λλ¬ μ λ‘λνκ³ λλ²κΉ νλ©΄ λ©λλ€.