Λογότυπο Cortex M Debug

Cortex M Debug

Κοινότητα
easyzoom
cortex-m-debug

Use when debugging Cortex-M microcontrollers, firmware bring-up, SWD/JTAG sessions, faults, startup code, or flashing failures

Επισκόπηση

Εκδότηςeasyzoom
Αποθετήριοaix-skills
Όνομα δεξιότηταςcortex-m-debug
Αστέρια
39
Forks
5
Συνοδευτικά αρχεία
Μόνο οδηγίες
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • Αυτοτελής

    Όλα όσα χρειάζεται το μοντέλο περιλαμβάνονται στις οδηγίες — χωρίς επιπλέον αρχεία για συγχρονισμό.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε από easyzoom στο GitHub. Διαβάστε το πηγαίο περιεχόμενο πριν εγκαταστήσετε τη δεξιότητα.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Cortex M Debug στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/easyzoom/aix-skills/tree/main/skills/cortex-m-debug
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Νέα δεξιότητα → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που διαβάζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/easyzoom/aix-skills.git /tmp/aix-skills
mkdir -p .claude/skills
cp -r /tmp/aix-skills/skills/cortex-m-debug .claude/skills/cortex-m-debug
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Cortex M Debug σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Cortex M Debug μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Cortex M Debug δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλα κατά τη συνομιλία

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

Cortex-M Debug

Overview

Use this skill to debug ARM Cortex-M firmware systematically. Start by identifying the exact MCU, board state, debug probe, toolchain, and failure phase, then choose the safest inspection path before changing flash, option bytes, clocks, or startup code.

When To Use

Use this skill when:

  • The target is a Cortex-M MCU, such as Cortex-M0/M0+/M3/M4/M7/M23/M33/M55/M85.
  • The user mentions SWD, JTAG, J-Link, ST-Link, CMSIS-DAP, OpenOCD, pyOCD, GDB, or vendor IDE debug.
  • Firmware does not boot, cannot be flashed, stops in Reset_Handler, hits HardFault, or has no UART/log output.
  • The task involves vector tables, startup files, linker scripts, clocks, reset behavior, or fault registers.

Do not use this skill when:

  • The target is Cortex-R (use cortex-r5-debug), embedded Linux, RISC-V, AVR, ESP8266, ESP32 Xtensa, or another non-Cortex-M architecture.
  • The user only needs application-level C code review with no target-specific debug context.
  • The request is to modify production firmware or security configuration before collecting baseline evidence.

First Questions

Ask for the minimum context needed:

  • MCU part number and board name.
  • Core family if known, such as Cortex-M0+, M4F, M7, or M33.
  • Current symptom: cannot connect, cannot flash, no boot, crash, hang, wrong peripheral behavior, or no logs.
  • Debug probe: J-Link, ST-Link, CMSIS-DAP, DAPLink, ULINK, or onboard probe.
  • Debug transport: SWD or JTAG.
  • Toolchain and workflow: OpenOCD, pyOCD, J-Link GDB Server, STM32CubeIDE, Keil, IAR, PlatformIO, Zephyr, RTOS, or bare metal.
  • Available artifacts: ELF, MAP file, linker script, startup file, OpenOCD config, boot log, fault dump, or GDB transcript.

Workflow

  1. Classify the failure phase. Use these buckets: probe cannot connect, flash/download fails, reset/startup fails, runtime fault, peripheral bring-up fails, or low-power/wakeup fails.

  2. Establish a non-destructive debug connection. Prefer connect-under-reset when firmware may reconfigure SWD pins, enter low power, or crash immediately.

  3. Confirm target identity. Read the MCU ID, core type, flash size, RAM size, and debug probe target report before trusting assumptions.

  4. Load symbols before changing target state. In GDB, load the ELF symbols first so addresses, functions, and sections are meaningful.

  5. Collect baseline evidence. Record reset PC, SP, vector table address, fault registers if applicable, and whether the image in flash matches the expected build.

  6. Pick the narrowest next check. Do not jump from "no boot" directly to rewriting startup code. Verify reset vector, memory map, clock assumptions, and fault state first.

  7. Ask before destructive actions. Chip erase, option byte changes, mass erase, readout protection changes, boot mode changes, and flash loader changes require explicit user approval.

Debug Connection Checklist

For SWD/JTAG connection issues, check:

  • Probe driver and permissions.
  • Correct target voltage and common ground.
  • SWDIO, SWCLK, RESET, GND, and VTref wiring.
  • Probe speed. Lower the clock for unstable boards, for example 100 kHz to 1 MHz.
  • Reset strategy: normal reset, hardware reset, connect-under-reset, or halt-after-reset.
  • Whether firmware disables debug pins, changes clocks too early, enters sleep, or locks the chip.
  • Whether readout protection, secure debug, TrustZone, or option bytes block access.

Useful command patterns:

bash
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg
arm-none-eabi-gdb build/firmware.elf
JLinkGDBServer -device <device> -if SWD -speed 4000
pyocd list
pyocd gdbserver --target <target>

GDB Baseline

After GDB connects, collect evidence before editing code:

gdb
target extended-remote :3333
monitor reset halt
info registers
x/8wx 0x00000000
x/8wx 0x08000000
info files
bt

For Cortex-M, pay special attention to:

  • sp: should point into valid RAM after reset.
  • pc: should point to Reset_Handler or a valid flash/RAM execution address.
  • Vector table word 0: initial stack pointer.
  • Vector table word 1: reset handler address with Thumb bit set.
  • xpsr: Thumb state and exception state.
  • VTOR: vector table location on cores that implement it.

Fault Debugging

When the target hits HardFault, BusFault, UsageFault, or MemManage:

  1. Stop and preserve the fault state. Do not reset before reading fault registers.

  2. Read core fault registers. Common System Control Block addresses:

text
SCB_CFSR  = 0xE000ED28
SCB_HFSR  = 0xE000ED2C
SCB_DFSR  = 0xE000ED30
SCB_MMFAR = 0xE000ED34
SCB_BFAR  = 0xE000ED38
SCB_AFSR  = 0xE000ED3C
SCB_SHCSR = 0xE000ED24
  1. In GDB, read them:
gdb
x/wx 0xE000ED28
x/wx 0xE000ED2C
x/wx 0xE000ED34
x/wx 0xE000ED38
info registers
bt
  1. Decode the stacked frame. Determine whether MSP or PSP was active, then inspect stacked r0-r3, r12, lr, pc, and xpsr.

  2. Map the faulting PC.

gdb
info symbol <pc>
list *<pc>
disassemble /m <function>

Common causes:

  • Invalid vector table or wrong linker script origin.
  • Stack pointer outside RAM or stack overflow.
  • Calling through a null or corrupted function pointer.
  • Unaligned access on cores/configurations that fault.
  • Executing from erased flash or invalid memory.
  • FPU enabled in compiler flags but not initialized, or ABI mismatch.
  • Interrupt handler missing, weak default handler hit, or wrong IRQ name.

Startup And Linker Checks

If the target fails before main():

  • Confirm the linker script Flash and RAM origins match the exact MCU.
  • Confirm .isr_vector is placed at the boot address expected by the boot mode.
  • Confirm initial SP is within RAM and properly aligned.
  • Confirm Reset_Handler copies .data, zeros .bss, initializes clocks only after safe reset defaults, and calls SystemInit/main in the intended order.
  • Confirm C library initialization is included if C++ constructors or libc startup are required.
  • Confirm vector table relocation, bootloader offset, and application offset agree.

Flashing And Reset Checks

If flashing fails:

  • Identify whether the failure is connect, erase, program, verify, or reset.
  • Confirm the target config matches the MCU family and flash bank.
  • Lower SWD speed and try connect-under-reset.
  • Check target voltage and reset line behavior.
  • Ask before mass erase or option byte changes.
  • Preserve readout protection and security state unless the user explicitly approves changing it.

If flashing succeeds but the board does not run:

  • Compare the programmed address with the linker script origin.
  • Confirm boot pins or option bytes select the expected boot source.
  • Halt immediately after reset and inspect SP/PC.
  • Check whether watchdog, clock setup, or early peripheral init resets the chip.

Peripheral Bring-Up Checks

For UART, GPIO, SPI, I2C, PWM, ADC, or timers:

  1. Confirm the peripheral clock is enabled.
  2. Confirm pin mux/alternate function and electrical mode.
  3. Confirm reset state and initialization order.
  4. Confirm board schematic pin mapping and package pinout.
  5. Confirm interrupt enable, priority, vector name, and handler symbol.
  6. Confirm DMA channel, request mapping, cache, and alignment on cores where relevant.

Safety Rules

  • Do not mass erase, change option bytes, disable protections, alter boot configuration, or flash unknown binaries without explicit approval.
  • Do not assume the MCU family from board branding. Ask for the exact part number or read it from the probe.
  • Do not treat Cortex-M0/M0+ like Cortex-M3/M4/M7 for fault decoding. Some registers and features differ.
  • Do not trust source-level debugging until the ELF, flash image, and running target are confirmed to match.
  • Do not keep retrying at high SWD speed when the target connection is unstable.

Verification

Before claiming progress:

  • State the MCU, core family, probe, transport, and toolchain used.
  • Confirm whether the probe can connect and halt the core.
  • Report reset sp, reset pc, and whether they are in valid memory ranges.
  • If a fault occurred, report fault registers and the mapped faulting symbol/address.
  • If flashing was attempted, report erase/program/verify status separately.
  • List any destructive action skipped or waiting for user approval.

Common Failures

  • Debugging the wrong MCU target config.
  • Forgetting connect-under-reset when firmware disables SWD pins.
  • Fixing startup code before checking reset SP/PC and linker origins.
  • Resetting immediately after a fault and losing the fault state.
  • Ignoring bootloader offsets when the vector table is not at flash base.
  • Assuming all Cortex-M cores expose the same debug and fault registers.

Example

User:

text
STM32 Cortex-M4 固件下载后没日志,怀疑没启动。

Agent:

  1. Asks for MCU part number, board, probe, toolchain, firmware ELF, and whether SWD can connect.
  2. Connects with reset halt and loads symbols.
  3. Checks initial SP/PC, vector table, linker origin, and whether Reset_Handler is reached.
  4. If it faults, reads SCB fault registers before resetting.
  5. Summarizes evidence and asks before erase, option byte changes, or code modifications.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Cortex M Debug;

Use when debugging Cortex-M microcontrollers, firmware bring-up, SWD/JTAG sessions, faults, startup code, or flashing failures

Γιατί να χρησιμοποιήσετε τη δεξιότητα Cortex M Debug στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Cortex M Debug είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη Cortex M Debug στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε το https://github.com/easyzoom/aix-skills/tree/main/skills/cortex-m-debug. Το TypingMind διαβάζει το αρχείο SKILL.md και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Cortex M Debug;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη Cortex M Debug;

Με όσα θέλετε. Εφόσον ένα μοντέλο υποστηρίζει δεξιότητες, μπορείτε να χρησιμοποιήσετε τη Cortex M Debug με αυτό — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama και άλλα — όλα στο TypingMind με τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Cortex M Debug;

Ναι. Δημοσιεύεται στο GitHub από τον χρήστη easyzoom με την άδεια χρήσης MIT. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇