-
Notifications
You must be signed in to change notification settings - Fork 2
2.3.1 Derinimas (angl. debugging) su STLINK GDB Server
blahlt edited this page Apr 27, 2020
·
3 revisions
- Jei dar neturim tai iš http://www.emb4fun.de/archive/stlink/index.html parsisiunčiam stlink-20130324-win.zip ir išpakuojam į C:\stlink-20130324-win
- Konsoleje paleidžiam C:\stlink-20130324-win\bin\st-util.exe ir jei prijungtas prietaisas per ST-LINK V2 gaunam pranešimą:
STLINK GDB Server v0.5.6 (Mar 24 2013 10:29:19)
Many thanks to the STLINK development team.
(https://github.com/texane/stlink)
2015-07-19T15:53:31 INFO src/stlink-common.c: Loading device parameters....
2015-07-19T15:53:31 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
2015-07-19T15:53:31 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
Chip ID is 00000410, Core ID is 1ba01477.
KARL - should read back as 0x03, not 60 02 00 00
Listening at *:4242...
Pagal https://github.com/texane/stlink/issues/147 STLINK GDB Server nepalaiko semihosting todėl geriau naudoti OpenOCD
- Eclipse einam į Help->Install New Software...
- Work with: pasirenkam Luna - http://download.eclipse.org/releases/luna ir type filter text įrašom gdb hardware ir po paieškos uždedam varnelę ant C/C++ GDB Hardware Debugging (versija buvo 8.6.0.201502131403) ir spaudžiam Next >, Next >, pasirenkam I accept the terms of the license agreement, Finish ir restartuojam Eclipse
Nuo šio žingsnio tą patį reiks padaryti kiekvienam projektui atskirai
- Norėdami sukurti debuginimo konfigūraciją einam Run->Debug Configurations. Du kartus spaudžiam ant GDB Hardware Debugging
- C/C++ Application laukelyje nurodom projekto .elf failą iš Debug katalogo
- Project laukelyje nurodom projektą
- Einam į Debugger skiltį ir GDB Command laukelyje nurodom kelią iki GDB (ne x86, bet specialiai skirtą ARM, pagal nutylėjimą jis yra C:\Program Files (x86)\GNU Tools ARM Embedded\4.9 2014q4\bin\arm-none-eabi-gdb.exe)
- Uždedam varnelę ant Use remote target ir Port Number nurodom 4242 (pagal nutylėjimą šio porto klausosi Texane ST-UTIL. Jį galima pakeisti paleidinėjant st-util.exe ir nurodant -p parametrą)
- Spaudžiam Apply, kad išsaugotume konfigūraciją ir Debug
- Paklausus ar pakeisti perspektyvą į Debug spaudžiam Yes ir debuginam