MCU Development Note for ODM - longge-lee/doc_test GitHub Wiki

Top of Contents

MCU Development Note for ODM

1 Introduction

1.1 Purpose of the Document

Help developers and ODM be attentive to and comprehend the built-in MCU functions, including self-calibration, that are essential for models during the development and testing phases.

1.2 Overview of MCU Development

1.2.1 Types

Two types for different display models

  • MCU on color sensor module
  • MCU on motherboard (CVD projects only)

1.2.2 MCU main functions

  • MCU firmware upgrade
  • Motor and sensor control
  • Self-calibration (manual and auto)
  • Auto execution by appoitment and periodically
  • Factory reset
  • Communication with scaler
  • Error detection and error message sending

1.2.3 Block Diagram

1.3 Scope and Objectives

Ensure information of ASUS and ODMs are synchronized

1.3.1 Color sensor module models

  • PA32UCXR
  • PA24US

1.3.2 MCU on motherboard models

  • PA32DC
  • PA27DCE
  • MH3281A
  • HA3281A



# 2 Hardware Requirement ## 2.1 Microcontroller * With Silicon Labs MCU EFM32LG990F256G on mothorboard or color sensor module. * Cable and connector for debug board.

2.2 Peripheral Connections

  • MCU firmware debug board: Silcon Labs EFM32 Leopard Gecko Starter Kit (STK, ex. EFM32LG-STK3600)
  • STK cables and connectors for computer and color sensor module.

3 Firmware Development

3.1 Development Environment Setup

3.2 GPIO functions

There are three input pins, a ouptput pin and a test pin used in MCU flow as the table.

Definition Description Pin Input/Output
Scaler_INFO Scaler inform MCU scaler event is triggered PD1 Input
FW_UPGRADE Scaler inform MCU to upgrade PD2 Input
MCU_INFO Ouput high if MCU is in AP mode PD3 Output
PSU_ON Scaler inform MCU to enter sleep mode PC13/PC15 Input
TP9 MCU testing pin PC3 Input/Output
  • The PSU_ON is PC13 in color sensor board and defined as PC15 in MCU on motherboard projects.
  • The TP9 is a test pin.

3.2.1 Input pins

MCU will polling these pins in main loop and will be wake up if the interrupt triggered by scaler.

Definition Pin Active Polling (ms) Interrupt trigger MCU Board
Scaler_INFO PD1 Low 1 N/A Both
FW_UPGRADE PD2 Low 100 N/A Both
PSU_ON PC13 High 1000 Falling edge For MCU on color sensor board
PSU_ON PC15 Low 1000 Rising edge For MCU on motherboard

3.2.2 Output Pin

The pin MCU_INFO (PD3) will be high if MCU running in AP code.

3.2.2 Test Pin

The pin TP9 (PC3) is a test pin which can be set input or output for testing and debugging.

3.2.3 GPIO Interrupt Handler

Interrupt routines are defined in system_emf32lg.h and this project use PSU_ON in GPIO_ODD_IRQHandler only.

3.3 MCU Flows

3.3.1 Firmware upgrade flow

3.3.1.1 MCU bootloader version is B01T00 or later.

3.3.1.2 MCU bootloader version is B00TXX.

3.3.2 All reset flow

All reset function will clear the user mode preset data and restore all registers to factory state. Scaler wiil enter flash reboot and pop-up a message box for power saving mode selection.

3.3.2 Main flow

All reset function will clear the user mode preset data and restore all registers to factory state. Scaler wiil enter flash reboot and pop-up a message box for power saving mode selection.

3.3.3 Self-Calibrarion flow

3.4 Initialization

3.4.1 GPIO

  • MCU_info
  • Sleep_pin

3.4.2 Backup real time clock

3.4.3 Motor and sensor

3.5 Communications

MCU commnicate with scaler by I2C and GPIO

3.5.1 Scaler event

3.5.2 MCU event

3.5.3 Flash reboot

3.5.4 Sleep and wake

3.6 Power Management

(1) Low Power Modes

  • Energy mode 3
  • Backup mode

(2) Sleep and Wakeup Strategies

  • Power saving mode
    • Normal-sleep
    • Deep-sleep
    • DC-Off
  • Wake-up event
    • Self-calibration appointment setting
    • GPIO
    • Burtc camparsion

8. Error Handling and Fault Tolerance

(1) Exception Handling

8. Security Considerations

(1) Encryption and Authentication

(2) Secure Boot (if applicable)

IV. Integration and Testing

1. MCU and Hardware Integration

(1) Connection of MCU with Peripherals

(2) System Integration

2. Software Integration

(1) Firmware upgrade

  • USB flash drive:
  • Scaler bin file: MODELNAME.bin
  • MCU bin file: MODELNAME_M.bin
  • Text file: binfname.txt ( Text content should be MODELNAME_M.bin ) Example: Model Name PA32XXX
    • PA32XXX.bin for Scaler
    • PA32XXX_M.bin for MCU
    • binfname.txt (Text content is PA32XXX_M.bin)
    • Press the two buttons simultaneously for 3 seconds

(2) Functional Testing

  • Input source:
    • Yes : auto or manual execution
    • No : auto execution only
  • Power saving mode:
    1. Power saving - normal level (1). MCU enter normal sleep mode
    2. MCU awake as the appointment time up
    3. MCU enter auto execution and start self-calibration
    4. MCU enter normal sleep mode again after all targets self-calibration accomplished
    • Power saving - deep level

    • MCU will enter DC-off after all targets self-calibration accomplished DC off : MCU will enter energy mode

               Back to DC-off after all targets self-calibration accomplished
          AC off :
           MCUwill enter backup mode 
           AC 
           
           (1)	Normal-sleep
           (2)	Deep-sleep
           (3)	DC-off
           (4)	AC-off => AC-on => normal-sleep/deep-sleep (AC-off ζœŸι–“η„‘δΊ€ι›†εˆ°ι η΄„ζ™‚ι–“)
           (5)	AC-off => AC-on => normal-sleep/deep-sleep ((AC-offζœŸι–“ζœ‰δΊ€ι›†εˆ°ι η΄„ζ™‚ι–“)
      
3. Performance Testing
    (1) Benchmarking
    (2) Stress Testing
4. Validation and Verification
    (1) Compliance Testing
    (2) Regulatory Testing (if applicable)

Error code:

Troubleshooting:

V. Documentation

1. Hardware Documentation
    (1) Schematics
    (2) PCB Layout
2. Firmware/Software Documentation
    (1) Code Comments
    (2) API Documentation
3. User Manual
    (1) MCU Features
    (2) Troubleshooting Guide

VI. Conclusion

1. Summary of Achievements
2. Lessons Learned
3. Recommendations for Future Development

This outline provides a structured approach to documenting the MCU development process for ODM, covering both hardware and firmware/software aspects. Depending on the specific requirements of your project, you may need to adjust and expand each section accordingly.

⚠️ **GitHub.com Fallback** ⚠️