-
Notifications
You must be signed in to change notification settings - Fork 2
STM32F103C8T6
| Model | STM32F103C8T6 |
| Core | ARM 32 Cortex-M3 CPU |
| Debug mode | SWD |
| Max. frequency | 72MHz |
| Flash memory | 64K |
| SRAM | 20K |
| Power, I/O | 2.0-3.6V |
| Size | 53.34mm x 22.86mm |
Įkrovos konfigūraciją nustato BOOT0 ir BOOT1 lygis
| BOOT1(PB2) | BOOT0(BOOT0) | Boot mode |
|---|---|---|
| X | 0 | User Flash memory |
| 0 | 1 | System memory (bootloader) |
| 1 | 1 | Embedded SRAM |
Aplinkos paruošimas
-
Sudiegiam GNU Tools for ARM Embedded Processors (gcc-arm-none-eabi-4_9-2014q4-20141203-win32.exe) iš https://launchpad.net/gcc-arm-embedded
-
Baigus diegima prieš Finish uždedam varnelę ant Add path to environment variable
-
Parsisiunčiam Eclipse IDE for C/C++ Developers (eclipse-cpp-luna-SR2-win32-x86_64.zip) iš https://www.eclipse.org/downloads/
-
eclipse-cpp-luna-SR2-win32-x86_64.zip išpakuojam į C:\eclipseARM
-
Sukuriam direktoriją D:\Projects\eclipseARM
-
**Eclipse **programoje per Help->Install New Software pridedam GNU ARM Eclipse:http://gnuarmeclipse.sourceforge.net/updates
-
Pažymim GNU ARM C/C++ Cross Compiler, GNU ARM C/C++ Documentation (Placeholder), GNU ARM C/C++ Generic Cortex-M Project Template, GNU ARM C/C++ Packs (Experimental), GNU ARM C/C++ STM32Fx Project Templates ir spaudžiam Next, Next, Finish ir restartuojam Eclipse
-
New Project->C++ Project, įrašom Project name, pasirenkame Executable->STM32F10x C/C++ Project, Cross ARM GCC ir spaudžiam Next
-
Pasirankam tokius nustatymus
| Chip family | STM32f10x Medium Density |
| Flash size (KB) | 64 |
| RAM size (KB) | 20 |
| External clock (Hz) | 8000000 |
| Content | Empty (add your own content) |
| Use system calls | Freestanding (no POSIX system calls) |
| Trace output | None (no trace output) |
Next, Next, Next ir Finish
- Nustatom lss (extended listing) sukūrimą Project->Properties einam C/C++ Build->Settings, Build Steps skiltį ir uždedam varnelę Create extended listing
| arm-none-eabi-objdump parametrai | |
|---|---|
| -d | Parodo instrukcijas (disasembliuoja) |
| -D | Padaro tą patį kaip ir -d tik viską paverčia instrukcijomis (neskiria duomenų nuo instrucijų) |
| -S | Padaro tą patį ką ir -d, tik susieja instrukcijas ir išeities kodą |
| -l | Papildomai rodo iš kokio failo yra kodo dalis |
| -z | Paprastai disasembliuojant "0" užpildytus blokus praleidžia. Šis parametras disasembliuoja ir parodo šiuos blokus |
-
Kad parasčiau butų valdyti kodą einam į Window->Preferences, tada C/C++->Editor->Folding uždedam varneles: Enable folding of preprocessor branches (#if/#endif) ir Enable folding of control flow statements (if/else, do/while, for, switch)
-
Spaudžiam Build
-
Parsiunčiam STM32 and STM8 Flash loader demonstrator (stsw-mcu005.zip) iš http://www.st.com/web/en/catalog/tools/PF257525 ir sudiegiam
-
Įjungiam įkrovos programą: BOOT0 jungiam į 3,3V, o BOOT1 jungiam į GND
-
Sujungiam modulį su USB į serial keitiklį (USB to Serial converter) taip: A9 (USART1_TX) jungiam prie RX, A10 (USART1_RX) prie TX, GND prie GND, 3,3V prie 3,3V
-
Paleidžiam Demonstrator GUI, nustatom Port Name, Boud rate į 256000 ir spaudžiam Next, Next
-
Pažymim Download to device, nurodom .hex, pažymim Erase necessary pages ir Jump to the user program, kad po įrašymo iškarto paleistu įkeltą programą
