Skip to main content

Tổng hợp tài liệu về embedded programming

Brief
Tài liệu về lĩnh vực này thì nhiều vô kể. Có những tập dầy hàng nghìn trang bằng tiếng anh. Trình độ tiếng anh thì cùi bắp, ngại đọc, nhiều khi cũng ko hiểu rõ.
Dười đây là một số tài liệu tôi đã review qua, cảm thấy dùng được và note lại lên đây. Hi vọng nó sẽ có ích.
Một số link cũng bao gồm những thứ funny dành cho lập trình viên nói chung, rồi cách làm việc trong lĩnh vực "code kèo"

01. Developer’s Best Practices Tutorial
Nôm na, tài liệu này được viết bởi một lão có hơn 16 năm trong lĩnh vực lập trình.
Lão ấy bảo:
".. with your day-2-day life and find so many hidden facts which are very obvious(rõ ràng) but we never gave our serious attention to them..."
Mất 2 ngày trong cuộc đời để tìm ra một đống những điều hay ho mà một thằng developer ko bao giờ để ý đến cả.
- Đưa ra 8 bài tập để luyện các thói quen tốt cho 1 chú developer:
Best Practice 1- Keep Reading Existing Software Source Code  ................  6
Đọc code của thằng khác quả là nhiệm vụ chán ngắt và buồn ngủ. Viết code mới cho nhanh.
Tuy nhiên, muốn thành nhà văn giỏi, ta không thể chỉ viết và viết...ta phải đọc hàng trăm quyển tiểu thuyết rồi. Tương tự vậy, khi đọc code của thằng khác(hoặc code của mình viết mấy năm trước thôi), mình sẽ thấy nó "thối" như nào...và đương nhiên, thông minh chuyên copy code như mấy ông coder mà không biết để tránh những chỗ thối ấy khi kế thừa thì buồn quá nhỉ :D
Bên cạnh đó, khi đọc code của thằng khác, mình còn học được một đống thứ như  indentation,  comments,  history  header,  function  structure  etc...) Mấy nỗi mà có "beautiful source code"

Best Practice 2 - Complete your documents before next step....................  8
"Documentation is the Key"
Nôm na là phải viết document cẩn thận. Khi viết doccument thì phải trả lời một loạt các câu hỏi liên quan. Nó giúp mình cover được gần hết các trường hợp, chỉ ra được là cái module source code đấy inpact đến thằng nào, rồi đã thực hiện hết các test case chưa....vvvv

Best Practice 3 - Follow the defined standards, don't create it  .................  10
"Follow the Standards"
Về cơ bản là có hàng ti tỷ coder đã đi trước, mình nên có 1 cái convention, coding style cho thống nhất. Nó giúp cho việc đọc code, maintain, fix bug trở nên dễ chịu hơn
Một số rules quan trọng như:
  File Naming convention
  Function & Module Naming convention
  Variable Naming convention
  History, Indentation, Comments
  Readability guidelines
  List of do's and don.ts

Best Practice 4 - Code should be written to be reviewed.  ........................  12
Accept criticism but don't criticize  ............................................  13
Testing is the Religion  ..............................................................  14
Best Practice 5 - Testing to be followed like a religion.  ............................  14
If you don't want to follow it? You will be in trouble!   ................  15
Celebrate every bug you find  ...................................................  15
Keep the Assets Safely  ............................................................  16
Best Practice 6 - Keep your Code and Documents Safely.  ......................  16
Multiple copies create confusion  ..............................................  16
Password sharing is strictly prohibited  .....................................  17
Handy Tools and Techniques  ..................................................  18
Best Practice 7 - Keep your Tools & Techniques Handy  ..........................  18
Few Essential Tools  .................................................................  18
Always keep adding new tools & techniques in your box  ........  19
Eager to Learn  ..........................................................................  20
Best Practice 8 -Leave the ego behind, Be eager to learn.  ......................  20

Comments

Popular posts from this blog

[STM32] How to configure Timer 1, Channel 3 is PWM 1kHz, duty cycle 20% to control BLDC motor

 To configure Timer1 for a 1 kHz PWM signal with a 20% duty cycle on an STM32H7S3L8 microcontroller, follow these steps: 1. Understand the Timer Parameters PWM Frequency : 1 kHz → Period = 1 ms. Duty Cycle : 20% → ON time = 0.2 ms. The timer’s clock frequency is derived from the APB clock (e.g., TIMCLK). Let’s assume you know the APB clock frequency. The Timer prescaler and auto-reload register (ARR) define the PWM frequency. 2. Compute Timer Parameters Formula: PWM Frequency = Timer Clock (Prescaler + 1) * (ARR + 1) \text{PWM Frequency} = \frac{\text{Timer Clock}}{\text{(Prescaler + 1) * (ARR + 1)}} PWM Frequency = (Prescaler + 1) * (ARR + 1) Timer Clock ​ For 1 kHz PWM: A R R = Timer Clock PWM Frequency ∗ ( Prescaler + 1) − 1 ARR = \frac{\text{Timer Clock}}{\text{PWM Frequency} * (\text{Prescaler + 1)}} - 1 A RR = PWM Frequency ∗ ( Prescaler + 1) Timer Clock ​ −...

[Mentorship] First day at work - question for your co-workers (casual and friendly tone)

Summary Learn essential tips to make a positive first impression on your first day at a new job, ensuring success and connection with colleagues. Highlights⏰ Be punctual: Arrive early to show commitment. ( 15 minutes before your shift ) 🚫 Avoid gossip: Maintain professionalism and integrity. ❌ Don’t ask for time off: Show dedication to your new role. 🤝 Firm handshake: A confident greeting sets a great tone. 📚 Ask questions: Engage with your new role actively. 🗂️ Organize your workspace: Keep your area tidy for respect. ☕ Accept social invites: Build rapport with co-workers. Key Insights ⏳ First Impressions Matter: Your colleagues will form opinions quickly, so be on your best behavior right from the start. 🌟 Professional Appearance: Dressing smartly conveys seriousness about your role and can positively influence how others perceive you. 💬 Communication is Key: A warm greeting and engaging dialogue can help break the ice and make you more approachable. 📝 Active Learning: Asking ...

[Git] Handle trailing space when patching with git

After complete coding one module in development branch. Next phase is merging. Obviously, you can merge source code automatically without no errors happen. However, life is not dream. Create a patch git diff HEAD > newTariff.patch Apply patch git apply newTariff.patch then problem happens Problem git apply newTariff.patch:106: trailing whitespace. patch does not apply Route cause: Nguyên nhân: Do trong source code có những dấu space thừa (ô vuông màu đỏ hình dưới) Some whitespaces is existed in your patch. (red area in below pictures) Fix Clean white space and patch again. Cách khắc phục Xóa những dấu space này đi và thực hiện patch lại Make up after complete coding. Find and clean whitespace before create patch file. Sửa sau khi code xong Kiểm tra sau khi code xong có lỗi này không git diff HEAD --check Prevent whitespace by manually when typing source code Sửa ngay khi đang code =>Bật chức năng hiển thị các dấu whitespace, hoặc remove trailing ...