docs: a step-by-step first program on EmbSim's micro:bit board

オープン
#195 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
82/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c, markdown
領域
documentation

調査の方向性

Read the Cortex-M3 walkthrough in docs/manual/getting-started.md, the board table, and tests/harness/thumb-m0/boot.c and io.c; build the toolchain and run the documented program with embsim --board microbit --stats. Capture the commands and output as printed, including the librt.a link step for __aeabi_uidivmod, and explain the ARMv6-M instruction set difference. Finish when a fresh clone can follow the walkthrough and make embdoc && ./embdoc check passes.

索引モデルが issue の本文から書いたものです。

説明

documentation good first issue

Context. Getting started walks through a first program on a Cortex-M3, step by step. The roadmap asks for a getting-started page for each EmbSim board. The BBC micro:bit (a Cortex-M0) is a good next one. Its row in the boards table already gives the target (thumbv6m-none-eabi), the harness (tests/harness/thumb-m0) and the link flags (-e reset -Ttext 0x0 -Tdata 0x20000000), but there is no walkthrough.

Where.

  • docs/manual/getting-started.md: the "Cortex-M3, step by step" section is the model, and the board table is around line 491. Add a "micro:bit (Cortex-M0), step by step" section next to it, or a page under docs/manual/ linked from there; ask in the comments if unsure which.
  • tests/harness/thumb-m0/: its boot.c and io.c are the start-up code and the output functions.
  • embsim --board microbit: runs the image.

Steps.

  1. Write the same small program as the Cortex-M3 section, then compile, link and run it with embcc, embld and embsim --board microbit --stats.
  2. One difference you will meet: ARMv6-M has no divide instruction, so the harness's io.c calls __aeabi_uidivmod, and the link fails with undefined symbol '__aeabi_uidivmod' until the compiler runtime is linked. Build it with make rt-embedded (or sh tools/build-rt.sh thumbv6m-none-eabi build/libc/thumbv6m-none-eabi for this target alone), put build/libc/thumbv6m-none-eabi/librt.a last on the embld line, and explain this in the section.
  3. Paste the commands and the output exactly as printed. Do not edit the output.
  4. Say what else differs from the Cortex-M3 version: ARMv6-M's smaller, mostly 16-bit instruction set.
  5. Run make embdoc && ./embdoc check.

Done when a reader with a fresh clone can follow the section from make embcc embld embsim to the program's output on EmbSim's micro:bit, the output shown is the real one, and ./embdoc check passes.

Before you start: the contributor's guide has the rules. A new test counts only after it has failed against the code before your change, and a commit subject reads area: summary. Questions are welcome in the comments or in Discussions.

主要言語
C
スター
1
フォーク
2
平均マージ
20時間 55分
マージ済み PR(30日)
73

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

EmbLinkOs/EmbCC のほかの issue

EmbLinkOs/EmbCC の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。