This is the hw03 sample. Please follow the steps below.
-
Fork this repo to your own github account.
-
Clone the repo that you just forked.
-
Under the hw03 dir, use:
-
maketo build. -
make cleanto clean the ouput files.
-
-
Extract
gnu-mcu-eclipse-qemu.zipinto hw03 dir. Under the path of hw03, start emulation withmake qemu.See Lecture 02 ─ Emulation with QEMU for more details.
-
The sample is a minimal program for ARM Cortex-M4 devices, which enters
while(1);after reset. Use gdb to get more details.See ESEmbedded_HW02_Example for knowing how to do the observation and how to use markdown for taking notes.
-
Edit main.c.
-
Make and run like the steps above.
-
Please avoid using hardware dependent C Standard library functions like
printf,malloc, etc.
-
How do C functions pass and return parameters? Please describe the related standard used by the Application Binary Interface (ABI) for the ARM architecture.
-
Modify main.c to observe what you found.
-
You have to state how you designed the observation (code), and how you performed it.
Just like how you did in HW02.
-
If there are any official data that define the rules, you can also use them as references.
-
Push your repo to your github. (Use .gitignore to exclude the output files like object files or executable files and the qemu bin folder)
- If you volunteer to give the presentation next week, check this.
★★★ Please take your note here ★★★ 1.從main.o檔和qemu中觀察幾個register發現各個程式的任務:
1.r3適用於兩函數間數值之傳遞。
2.r7功用在於地址的取值與存值進入地址的連結,其中r0/sp類似其輔助。另外,r7還有另外的任務用於協助兩函數 地址的存放。
3.lr(linker register)與一般用法一樣,作為兩函數間branch的媒介。
2.因為我設計的的程式因素,所以觀察其main.o中bl/bx/b.n的關係:程式會在這以下地址不段輪迴---00000000,00000026
3.程式截圖: !1st_time_in_fn_try