Research on CPN Automatic Modeling Method of STM32 Program
STM32 microcontrollers contain multiple interrupt program types, and the occurrence and execution of various types of interrupts are uncertain, making it difficult to detect hidden vulnerabilities. Colored Petri Nets (CPN) can model the software system and find vulnerabilities in the program through model detection, but the uncertain triggering of the interrupt will lead to state explosion, and then the model detection cannot be completed, so this paper proposes an automatic modeling method to avoid state explosion for STM32 microcontrollers, which reduces the possibility of state explosion on the one hand, and improves the modeling efficiency on the other hand. Firstly, the program preprocessing is carried out, which is divided into two steps, one is to read, mark and classify and store the STM32 source program, and the other is to perform equivalent class division detection to find the correlation variables between programs to provide support for the subsequent combination model. Secondly, the coarse-grained modeling method proposed by the project team was used to classify and model the main program and interrupt program of STM32, and multiple or one source program sentence was described as a transition. Finally, different types of interrupt predefined model frameworks are designed, and based on the detection results of the previous equivalence class division, the constructed main program model fragments and interrupt model fragments are connected with the corresponding types of interrupt model frameworks at each data interaction point to form a complete model, and the equivalent substitution connects the interrupt model at all locations, so as to cover all interrupts that may lead to errors. In the experimental part, the correctness and effectiveness of the method are verified by an intelligent irrigation example.
Authors
- Wenjie Zhong (ORCID: https://orcid.org/0000-0002-2508-2108)
- Tao Sun (ORCID: https://orcid.org/0000-0001-5277-8699)
- Boyu Zhang (ORCID: https://orcid.org/0000-0002-2175-2741)
Institutions
- Inner Mongolia University (CN)
Publication Details
- Published
- 2025-05-05
- DOI
- https://doi.org/10.1109/cscwd64889.2025.11033435
- Primary Topic
- Advanced Sensor and Control Systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China