saving_flash_space
- Remove string duplication (search binary with string utility to find out how much space you can save)
- Use integer error codes rather than showing error strings
- Literal pool usage reduction
- e.g. when going from ARM to Thumb
- group globals into structures
- .sinit usage (construct instead simple global structs)
- selectively enable optimization for some files
- refactoring duplicate code
- reduce usage of standard library functions
assertions
#define ASSERT(expr) \ if (expr) \ {} \ else \ aFailed(F_NUM, __LINE__) trap() { #ifndef NDEBUG #define _BKPT __ASM(“bkpt 0″) while(1); #endif }
http://blog.feabhas.com/2013/02/developing-a-generic-hard-fault-handler-for-arm-cortex-m3cortex-m4/
http://blog.frankvh.com/2011/12/07/cortex-m3-m4-hard-fault-handler/
http://www.drdobbs.com/an-exception-or-a-bug/184401686
http://www.embedded.com/electronics-blogs/other/4023329/Assert-Yourself
https://interrupt.memfault.com/blog/asserts-in-embedded-systems
saving_flash_space.txt · Last modified: by admin