The demands placed on developers to get results quickly can result in critical steps being skipped at the beginning of firmware implementation. In order to save time in the debugging phase, consider these ten suggestions as starting points before every writing any application code.
1) Setup a directory structure that includes but is not limited to
– MCU Drivers
2) Use relative paths to the workspace and project when adding files and search paths.
3) Use the build folder to use multiple toolchains with the same code base.
4) Setup the white and tab spacing in all toolchains so that the code remains readable in any tool.
5) Setup a static analysis tool at the start. Setup the analyzer to monitor for firmware errors and also check adherence to coding standards.
6) Setup a UART and printf early in the project implementation in order to get debug information.
7) Don’t forget to setup the assert macro once printf is up and running!
8) Setup a baseline code repository use git or svn.
9) Setup Doxygen to generate a software manual automatically
10) Use design patterns and code templates to quickly develop the lower layers of code
Implementing just a few of these suggestions at the start of project implementation can increase efficiency and even catch bugs early in the development.