DOI QR코드

DOI QR Code

Maximum Stack Memory Usage Estimation Through Target Binary File Analysis in Microcontroller Environment

마이크로컨트롤러 환경에서 타깃 바이너리 파일 분석을 통한 최대 스택 메모리 사용량 예측 기법

  • Received : 2017.05.12
  • Accepted : 2017.05.23
  • Published : 2017.06.30

Abstract

Software safety is a key issue in embedded system of automotive and aviation industries. Various software testing approaches have been proposed to achieve software safety like ISO26262 Part 6 in automotive environment. In spite of one of the classic and basic approaches, stack memory is hard to estimating exactly because of uncertainty of target code generated by compiler and complex nested interrupt. In this paper, we propose an approach of analyzing the maximum stack usage statically from target binary code rather than the source code that also allows nested interrupts for determining the exact stack memory size. In our approach, determining maximum stack usage is divided into three steps: data extraction from ELF file, construction of call graph, and consideration of nested interrupt configurations for determining required stack size from the ISR (Interrupt Service Routine). Experimental results of the estimation of the maximum stack usage shows proposed approach is helpful for optimizing stack memory size and checking the stability of the program in the embedded system that especially supports nested interrupts.

Keywords

References

  1. http://catless.ncl.ac.uk/Risks/16.93.html#subj.
  2. http://www.edn.com/design/automotive/4423428/Toyota-s-killer-firmware--Bad-design-and-its-consequences.
  3. D. Bucur, M. Kwiatakoska, "On Software Verification for Sensor Nodes," Journal of Software and Systems, Vol. 84, No. 10, pp. 1693-1707, 2011. https://doi.org/10.1016/j.jss.2011.04.054
  4. J. Regehr, A. Reid, "HOIST: A System for Automatically Deriving Static Analyzers for Embedded Systems," Proceedings of the 11th International Conference on Architectural Support for Programming Languages and Operating Systems, Vol. 32, No. 5, pp. 133-143, 2004.
  5. D. Brylow, N. Damgaard, J. Palsberg, "Static Checking of Interrupt-driven Software," Proceedings of the 23rd International Conference on Software Engineering, pp. 47-56, 2001.
  6. http://infocenter.arm.com/help/topic/com.arm.doc.100166_0001_00_en/arm_cortexm4_processor_trm_100166_0001_00_en.pdf
  7. http://refspecs.linuxbase.org/elf/elf.pdf
  8. D. Park, "Low-Power IoT Microcontroller Code Memory Interface Using Binary Code Inversion Technique Based on Hot-Spot Access Region Detection," IEMEK J. Embed. Sys. Appl, Vol. 11, No. 2, pp. 97-105, 2016 https://doi.org/10.14372/IEMEK.2016.11.2.97
  9. K. Mehlhorn, S. Naher, P. Sanders, "Engineering DFS-based Graph Algorithm," Partially supported by DFG grant SA 933/3-1, 2007.
  10. https://misra.org.uk/
  11. J. Regehr, "Random Testing of Interrupt-driven Software," Proceedings of the 5th ACM international conference on Embedded software, pp. 290-298, 2005.
  12. G. Grancioli, S. Fischmeister, "Tracing Interrupts in Embedded software," Proceedings of the ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems Vol. 44, No. 7, pp. 137-146, 2009.