分享到plurk 分享到twitter 分享到facebook

版本 4a8751dc86068d973e35cf044c621c18321617ed

embedded/Lab1

Changes from 4a8751dc86068d973e35cf044c621c18321617ed to 911de445ba0a4ba869d55326cf433f8168aa7b0f

=============
QEMU Modeling
=============

Prerquisites
------------
- sudo apt-get install zlib1g-dev libsdl1.2-dev
- http://0xlab.org/~jserv/tmp/toolchain-2012_03.tar.bz2
  - Extract to Directory /usr/local/csl/arm-2012.03
    - cd  /
    - tar jxvf toolchain-2012_03.tar.bz2
    - http://192.168.20.141/toolchain-2012_03.tar.bz2
- `PATCH </embedded/Lab1/0001-Fix-build-due-to-old-APIs.patch>`_


STM32 Overview
--------------
- Powerful but Cheap
  - Wireless Connectivity
  - Computing/Prototyping
  - One for most use cases
  - open source: http://code.google.com/hosting/search?q=label:STM32 
  - http://0xlab.org/~jserv/tmp/CM-STM32.pdf

.. image:: /STM32-P103-01.jpg

STM32 + QEMU
------------

.. code-block:: prettyprint

    git clone git://github.com/beckus/stm32_p103_demos.git
    git clone git://github.com/beckus/SandboxQemu2.git qemu_stm32

    cd qemu_stm32
    git am 0001-Fix-build-due-to-old-APIs.patch
    ./configure --disable-werror --enable-debug \
        --enable-debug-tcg \
        --target-list="arm-softmmu" \
        --extra-cflags=-DDEBUG_CLKTREE \
        --extra-cflags=-DDEBUG_STM32_UART \
        --extra-cflags=-DSTM32_UART_NO_BAUD_DELAY \
        --extra-cflags=-DSTM32_UART_ENABLE_OVERRUN
    make
    cd ../stm32_p103_demos
    git checkout -b final origin/final
    make all
    make blink_flash_QEMURUN
    make button_QEMURUN
    make uart_echo_QEMURUN

--------------------------------

作業要求
-------
- 設計 STM32 的程式,使得在按下 Button 時,於 UART 輸出 "Hello!"
- STM32 的程式須能與使用者互動,允許透過 UART 下指令控制週邊的狀態,至少要控制 LED 與查詢 Button 的狀態 (如按下的次數)
- (加分) 使用 Software interrupt

繳交作業
-------
- 寄件到 <jserv.tw@gmail.com>
  - 標題: "[HW1]" 開頭,後面加學號與姓名
  - 可以的話,附上一份自介

補充
----
- git log
- git log -p
- export PATH=/usr/local/csl/arm-2012.03/bin:$PATH
- QEMU monitor 中按下 Ctrl-Alt-2 可切換到 serial0,即可作 UART 輸出/輸入測試
- QEMU monitor 中按下 Ctrl-Alt-2 可切換到 serial0,即可作 UART 輸出/輸入測試,而按下 Ctrl-Alt-1 可切回 QEMU monitor