ICOMP-UNC / -AFKS-

This project involves the development of an STM32F103C8T6 BluePill MCU to monitor and display - in real time -electrical parameters such as current, voltage, power factor, and energy consumption in kWh.
MIT License
4 stars 0 forks source link

Firmware Testing and Troubleshooting #15

Closed francolop closed 1 week ago

francolop commented 1 week ago

Create a guide to verify the firmware is running correctly. Include a troubleshooting section for common issues during build, flashing, or execution

francolop commented 1 week ago

Guide to Verify the Firmware is Running Correctly

  1. Verifying Firmware Execution Use Serial Output: Check if debug messages are printed via UART to confirm the firmware is running. LED Indicators: Verify if LEDs are turning on/off or blinking as expected for different states. Peripherals: Test connected peripherals (e.g., LCD, sensors, motors) to ensure they respond correctly.

  2. Troubleshooting Common Issues Firmware Not Flashing: Ensure correct platformio.ini configuration and USB connection. Rebuild the firmware and verify that drivers are installed for ST-Link. Code Builds But Doesn’t Run:

Check for uninitialized peripherals or incorrect microcontroller configuration. Verify logic in the firmware and ensure proper watchdog timer handling. Serial Communication Issues:

Double-check baud rate settings and TX/RX pin connections. Ensure serial peripheral is correctly initialized. Debugging Code Halts: Use a debugger to step through code if execution halts unexpectedly. Check for memory issues or unhandled resets.

  1. Additional Tips Use an oscilloscope or logic analyzer to verify signal integrity for interfaces like PWM or I2C. Write unit tests to check specific modules or functions. Check for system resets due to Brown-Out or power instability