More Related Content
Similar to 專題-2017Linux Driver 實現 (20)
More from IttrainingIttraining (20)
專題-2017Linux Driver 實現
- 3. 引言
• 有過系統程式軟韌體撰寫及單晶片韌體開
發的經驗,所以想練習撰寫Linux Driver.
• 練習撰寫Linux Driver(Pi_v3用I2C通Gsenser),
生成Kernel Module(.ko),再寫一支APP測試
(讀X,Y,Z值).
• Pi 透過CoAP協定並申請ARMmbed伺服器,在ARMmbed註冊裝置,架設簡單網站
(jQuery,javascrip, Node.js)使用ARMmbed服務,在網站讀取傳送資料
- 5. 軟硬體架構
• 軟體- C, Linux-rpi-4.4.y,相關code
• 硬體-BCM2837(Pi_v3), LIS3DH(Gsenser)
• Pi_v3參考用Linux-rpi-4.4.y版本撰寫Kernel
Module(文件相關有Kernel Module, I2C Driver),
硬體看datasheet暫存器位址,開始撰寫.c檔並
編譯成.ko檔測試
• 撰寫.c檔參考相關資料,一步步在Pi_v3上測
試.ko檔並重複dmesg kernel 訊息
- 7. 結論
• 從實做User space到Kernel space,關鍵是了解
Kernel space的觀念和實做Kernel API, Linux是
一個龐大架構的OS(I2C),即使是User space
APP的撰寫也和Kernel Module息息相關,要不
斷的釐清觀念並寫code驗證結果,同時寫
code也是可以訓練邏輯能力
- 8. 分工
• 陳柏翰-Coding, Trace code, test code(dmesg),
Cross compile , Google reference, PPT, Report,
Demo, Resume.
• 范老師-提供相關Code,技術指導.
• Joseph-技術指導.
- 9. 參考文獻
• Linux Device Drivers (THIRD EDITION) -Jonathan Corbet,
Alessandro Rubini, and Greg Kroah-Hartman
• https://www.google.com.tw/
• Linux: https://github.com/raspberrypi/linux/tree/rpi-4.4.y
• Linux-rpi-4.4.y:Document
• I2C Driver:
http://venkateshabbarapu.blogspot.tw/2012/11/i2c-driver-
in-linux.html
• LIS3DH PDF:
http://www.st.com/content/ccc/resource/technical/docum
ent/datasheet/3c/ae/50/85/d6/b1/46/fe/CD00274221.pdf/
files/CD00274221.pdf/jcr:content/translations/en.CD002742
21.pdf