شعار Riscv Mcu Debug

Riscv Mcu Debug

المجتمع
easyzoom
riscv-mcu-debug

Use when debugging RISC-V microcontrollers, bare-metal firmware, RTOS bring-up, OpenOCD or GDB sessions, traps, CSRs, startup code, or flashing failures

نظرة عامة

الناشرeasyzoom
المستودعaix-skills
اسم المهارةriscv-mcu-debug
النجوم
39
التفريعات
5
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها easyzoom على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Riscv Mcu Debug في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/easyzoom/aix-skills/tree/main/skills/riscv-mcu-debug
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق 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/riscv-mcu-debug .claude/skills/riscv-mcu-debug
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Riscv Mcu Debug في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Riscv Mcu Debug تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Riscv Mcu Debug بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

RISC-V MCU Debug

Overview

Use this skill to debug RISC-V MCU firmware systematically. Identify the exact core, SoC, debug module, toolchain, memory map, and trap state before changing startup code, linker scripts, flash settings, or machine-mode configuration.

When To Use

Use this skill when:

  • The target is a RISC-V MCU or bare-metal RISC-V SoC.
  • The user mentions OpenOCD, GDB, JTAG, RISC-V debug module, mstatus, mcause, mepc, mtvec, trap handlers, startup code, or linker scripts.
  • Firmware cannot flash, stops before main, traps, hangs, or has no UART/log output.

Do not use this skill for Cortex-M, 8051, embedded Linux application debugging, or general C code review without target evidence.

First Questions

Ask for:

  • Exact chip, board, and core if known, such as RV32IMAC, RV32E, RV64, F/D extension, or vendor core name.
  • Toolchain: GCC, LLVM, vendor IDE, Zephyr, RT-Thread, or bare metal.
  • Debug path: OpenOCD, vendor GDB server, J-Link, WCH-Link, onboard probe, or UART bootloader.
  • Current symptom: cannot connect, cannot flash, no boot, trap, hang, no log, or peripheral failure.
  • Available artifacts: ELF, MAP, linker script, startup file, OpenOCD config, UART log, trap dump, or GDB transcript.

Workflow

  1. Confirm the target profile. RISC-V MCU behavior depends on XLEN, extensions, privilege mode, vendor CSRs, debug module, and memory map.

  2. Classify the failure phase. Use connect, flash, reset/startup, trap, runtime hang, peripheral bring-up, or RTOS scheduling.

  3. Establish a non-destructive debug session. Prefer halt/reset-halt and symbol loading before flash erase or startup rewrites.

  4. Collect trap and reset evidence. Record pc, sp, mstatus, mcause, mepc, mtval, mtvec, and key memory addresses.

  5. Check linker and startup alignment. Confirm reset address, vector/trap base, RAM origin, stack top, .data copy, .bss zeroing, and main call path.

  6. Ask before risky operations. Mass erase, option bytes, boot mode, security locks, and vendor flash config changes require explicit approval.

OpenOCD And GDB Checks

Useful patterns:

bash
openocd -f interface/<probe>.cfg -f target/<target>.cfg
riscv64-unknown-elf-gdb build/firmware.elf
riscv-none-elf-gdb build/firmware.elf

GDB baseline:

gdb
target extended-remote :3333
monitor reset halt
info registers
p/x $pc
p/x $sp
p/x $mcause
p/x $mepc
p/x $mtval
p/x $mtvec
bt

Check:

  • pc points to a valid executable region.
  • sp points inside RAM and is aligned.
  • mtvec points to the intended trap handler.
  • mepc maps to source or disassembly.
  • OpenOCD target config matches the exact chip or debug module.

Trap Debugging

When a trap occurs:

  1. Preserve state before reset.
  2. Read mcause, mepc, mtval, mstatus, and mtvec.
  3. Decode whether the cause is interrupt or exception.
  4. Map mepc to a symbol and instruction.
  5. Check whether mtval contains a bad address or instruction.

Common causes:

  • Illegal instruction due to wrong ISA flags, such as compiling for rv32imac but running on a core without compressed instructions.
  • Misaligned access or unsupported unaligned loads/stores.
  • Executing from erased flash or wrong boot address.
  • Stack pointer outside RAM.
  • Trap vector not initialized or not aligned as required.
  • Accessing peripheral addresses before clocks or bus bridges are ready.
  • M-mode interrupt enable or PLIC/CLIC setup mismatch.

Startup And Linker Checks

If firmware fails before main():

  • Confirm linker script flash/RAM origins match the exact SoC.
  • Confirm reset entry address agrees with boot ROM or flash mapping.
  • Confirm stack top is valid and aligned.
  • Confirm global pointer gp and small data sections are initialized if used.
  • Confirm .data and .bss initialization.
  • Confirm trap handler is installed before enabling interrupts.
  • Confirm compiler ABI, ISA string, and startup assembly agree.

Flashing Checks

If flashing fails:

  • Separate connect, erase, program, and verify failures.
  • Check probe wiring, target voltage, reset, and JTAG/SWD-equivalent pin mux.
  • Lower adapter speed.
  • Confirm flash algorithm and target config match the chip.
  • Ask before mass erase or security unlock.

Verification

Before claiming progress:

  • State chip/core, XLEN, ISA string if known, probe, debug server, and toolchain.
  • Confirm whether GDB can halt and read registers.
  • Report pc, sp, mcause, mepc, mtval, and mtvec when trap-related.
  • Confirm flash erase/program/verify status separately if flashing was attempted.
  • List destructive actions skipped or awaiting approval.

Common Failures

  • Using the wrong -march or -mabi for the actual core.
  • Assuming all RISC-V MCUs have the same interrupt controller.
  • Resetting before reading trap CSRs.
  • Debugging C code before confirming startup assembly and linker origins.
  • Using a near-match OpenOCD target config without checking memory map and flash algorithm.

Example

User:

text
RISC-V 小板下载后进 trap,串口没有日志。

Agent:

  1. Asks for chip, core/ISA, probe, OpenOCD config, ELF, and trap register dump.
  2. Connects halt-first and reads pc, sp, mcause, mepc, mtval, and mtvec.
  3. Maps mepc to source or disassembly.
  4. Checks ISA flags, stack range, trap vector, and linker origins before editing code.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Riscv Mcu Debug؟

Use when debugging RISC-V microcontrollers, bare-metal firmware, RTOS bring-up, OpenOCD or GDB sessions, traps, CSRs, startup code, or flashing failures

لماذا تستخدم Riscv Mcu Debug على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Riscv Mcu Debug عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Riscv Mcu Debug في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/easyzoom/aix-skills/tree/main/skills/riscv-mcu-debug. يقرأ TypingMind ملف SKILL.md الخاص بها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Riscv Mcu Debug؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Riscv Mcu Debug؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Riscv Mcu Debug معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Riscv Mcu Debug مجانية؟

نعم. نشرها easyzoom على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇