Embedded thoughts

1. The circuit board must have a power indicator light, which can quickly judge when there is no power.

2. The circuit board must have a heartbeat light. When the chip crashes, it can be found immediately. The different states of the program running can also be indicated by the heartbeat light.

3. Variable naming, with a prefix to indicate the classification. For example, TEST_LED, represents the led of the test class. LED_TEST, which represents a light called test of the LED class. Classification is different. Similarly TEST_KEY and KEY_TEST are also classified differently.

4. The bootloader and IAP should be implemented separately. The bootloader is only responsible for which program to start, and the IAP is implemented with the application. Applications with self-upgrade requirements should use chips with larger flash. The space layout can be boot loader + config + A application + B application. A and B can be upgraded in rotation to ensure that the upgrade will not crash, and it can be rolled back to the top version.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324522668&siteId=291194637