A comprehensive detection method for on-machine power-on flash
Patent Information
- Application Number
- CN202611451774.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-18
- Publication Date
- 2026-10-30
AI Technical Summary
传统产测无介质读写校验环节,无法提前识别Flash介质本身的可靠性缺陷,后续使用中存在写入异常风险
本发明提供的一种整机上电Flash综合检测方法,通过在产测阶段由设备侧固件自主执行Flash擦写测试和固件完整性校验,形成“工具烧录校验+整机上电复检”的配合关系,能够有效弥补SMT工具单侧校验的盲区,识别因虚焊、制程后置损伤导致的隐性数据损坏,降低不良流入用户侧的风险;通过基于固件版本与生成时间的门控机制,仅在信息有效且匹配时执行分区MD5比对,兼顾了检测准确性与量产效率,减少了无基准误判和多余耗时;同时,失败告警拦截与通过后自动清理校验文件的闭环设计,既保障了不良产品的拦截,又保持了出厂状态的纯净,实现了可控的量产自测闭环,显著提升了嵌入式设备量产环节的可靠性与效率。
Smart Images

Figure CN123017117A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of testing technology, and in particular to a comprehensive testing method for the flash memory of a fully powered-on device. Background Technology
[0002] Embedded devices require Flash testing during mass production to ensure the reliability of the storage medium and the integrity of the firmware programming. Existing solutions involve on-device testing during the production testing phase, primarily consisting of two types: first, Flash erase / write testing, where test data is written to the writable configuration directory and read back for comparison to confirm normal read / write capability; second, programming integrity verification, where, when the firmware version matches the generation time, the corresponding Flash partition is read according to the partition list, its MD5 hash is calculated, and compared with the expected value. If all values match, the test is successful; otherwise, the production test fails and an alarm is triggered. These tests are used to promptly detect and intercept products with Flash anomalies or poor programming.
[0003] However, existing technical solutions have the following drawbacks. First, traditional solutions rely solely on the instantaneous verification of the programming tool under SMT fixture crimping conditions, reflecting only the instantaneous state at the moment of programming and lacking the ability to verify the actual working condition of the entire device. After the board is removed from the fixture, it may be affected by process factors such as handling vibration, static electricity, and board stress, or there may be hidden soldering problems such as poor soldering or cold soldering of Flash pins. This can lead to situations where the contact is normal when the fixture is crimped and the programming verification is qualified, but the contact is unstable and partition data is damaged during actual operation of the entire device. Such failures are random, and the device can often still be powered on normally. Conventional functional tests are difficult to cover, leading to hidden defects leaking to the user end and causing problems such as device crashes, firmware abnormalities, and functional failures. Second, existing verification mechanisms only compare the firmware programming content and do not perform effectiveness tests on the actual erase / write and read / write consistency of the Flash storage medium. Some Flash memory exhibits hardware issues such as unstable read / write operations. While firmware may be successfully programmed and pass SMT verification if the correct storage area is hit, subsequent device operation, upgrades, and configuration saving require repeated erasing and rewriting of the corresponding area, leading to write failures, data loss, and incorrect saving. Traditional production testing lacks a media read / write verification step, making it impossible to identify inherent reliability defects in the Flash media in advance, thus posing a risk of write anomalies during subsequent use.
[0004] Therefore, there is an urgent need in this field for a method that can autonomously complete Flash comprehensive testing on the equipment side when the whole machine is powered on, so as to make up for the blind spot of single-sided verification of SMT tools, identify post-process damage and media read / write abnormalities, and ensure mass production yield. Summary of the Invention
[0005] The purpose of this invention is to provide a comprehensive Flash detection method for the entire machine upon power-on, so as to solve the problems existing in the prior art.
[0006] To achieve the above objectives, the present invention provides the following solution: This invention provides a comprehensive Flash detection method for a whole machine upon power-on, comprising the following steps: S1. After the device is powered on, it enters the production test mode, starts the production test program, and executes the Flash test process. S2. Determine whether to perform the test: Determine whether there are any production test configuration traces on the device, or whether the current partition form is suitable for this test. If there are production test configuration traces or the current partition form is not suitable for the test, skip the subsequent Flash test and continue with other production test items; otherwise, proceed to step S3. S3. Flash erase / write test: Create a test file in the writable configuration directory, write test data, and then read it back for comparison. If the read / write fails or the read content is inconsistent with the written content, the Flash medium is determined to be abnormal, the production test fails, and an alarm is triggered to block it; if they are consistent, proceed to step S4. S4. Determine whether to perform a flashing integrity check: Read the onboard verification information. If there is no verification information, or the firmware version and generation time in the verification information do not match the current firmware, skip the integrity check and proceed to step S6; if they match, proceed to step S5. S5. Partition integrity comparison: According to the partition list in the verification information, read the corresponding Flash partitions in sequence, calculate the MD5 and compare it with the expected value. If all are consistent, the burning is deemed successful; if any partition is inconsistent, the burning is deemed unsuccessful, the production test fails and an alarm is triggered. S6. Clean and Continue: After the Flash test passes, delete the onboard verification file to avoid duplicate verification, and continue the subsequent production testing process.
[0007] Preferably, in step S3, the writable configuration directory is a configuration partition where data can be written during device firmware runtime, and the test file writing and readback comparison operation is completed independently by the device-side firmware during the production testing phase, without relying on external burning tools.
[0008] Preferably, in step S4, the onboard verification information is written by the burning process and includes the firmware version number, firmware generation time and partition list. The partition list records the identifier of each partition to be verified and the corresponding expected MD5 value.
[0009] Preferably, in step S5, the MD5 calculation and comparison are performed by the device-side production test firmware. When all comparison results are consistent, the overall Flash burning status is determined to be qualified. If any partition is inconsistent, a production test failure alarm is triggered to intercept hidden faults caused by poor soldering, process damage, or poor post-processing.
[0010] Preferably, in step S6, the deletion of the onboard verification file is performed after the Flash test passes, so that the device is in a state without verification files when it leaves the factory, avoiding repeated triggering of verification in the future, and ensuring the purity of the factory environment.
[0011] Preferably, in step S2, the production test configuration trace is a mark left on the storage medium during the previous production test process on the device, used to determine whether Flash testing has been performed and to prevent duplicate testing.
[0012] Preferably, the method further includes, when the detection fails in step S3 or step S5, outputting an alarm signal through the production testing program and stopping the subsequent production testing process, so that defective products are intercepted in the production testing stage.
[0013] This invention also provides a comprehensive flash detection device for the entire machine upon power-on, comprising: The storage unit is used to store firmware, writable configuration directory, onboard verification information, and test files. The detection unit is used to perform Flash erase and write tests, create test files in the writable configuration directory, write test data, and read back for comparison. The verification unit is used to read the onboard verification information, and when the firmware version and generation time match, it performs MD5 calculation on the Flash partition according to the partition list and compares it with the expected value. The control unit is used to delete the onboard verification file after the Flash test passes and to control the continuation or termination of the production testing process.
[0014] Preferably, the detection unit and the verification unit are automatically triggered by the device-side test firmware after the whole machine is powered on, and are used to realize secondary verification under the whole machine's working condition in addition to the verification by the SMT programming tool, so as to identify cold solder joints or post-process damage.
[0015] Preferably, the control unit triggers an alarm and blocks the product from leaving the factory when the erase / write test is abnormal or the MD5 comparison fails. After the test passes, the verification file is cleaned up to maintain the factory state, thus forming a closed loop for mass production self-testing.
[0016] The present invention achieves the following beneficial technical effects compared to the prior art: This invention provides a comprehensive Flash testing method for the entire device upon power-on. By having the device-side firmware autonomously perform Flash erase / write tests and firmware integrity verification during the production testing phase, a cooperative relationship of "tool programming verification + overall device power-on re-inspection" is formed. This effectively compensates for the blind spots of single-sided verification by SMT tools, identifies hidden data corruption caused by poor soldering or post-processing damage, and reduces the risk of defective products flowing to the user side. Through a gating mechanism based on firmware version and generation time, partitioned MD5 comparison is performed only when the information is valid and matches, balancing detection accuracy and mass production efficiency, and reducing misjudgments without a benchmark and unnecessary time consumption. At the same time, the closed-loop design of failure alarm interception and automatic cleaning of verification files after success not only ensures the interception of defective products but also maintains the purity of the factory state, realizing a controllable mass production self-test closed loop, significantly improving the reliability and efficiency of the embedded device mass production process. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 The flowchart of the whole machine power-on Flash comprehensive testing method provided by the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] The purpose of this invention is to provide a comprehensive Flash detection method for the entire machine upon power-on, in order to solve the problems existing in the prior art.
[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] Example 1: To address the issues in existing technologies where flash memory testing during mass production relies solely on instantaneous verification by SMT programming tools, which fails to identify cold solder joints and post-processing damage, and where the lack of effective testing of the actual erase / write / read / write consistency of the flash storage medium leads to the risk of subsequent write anomalies, such as... Figure 1As shown, the following preferred technical solutions are provided.
[0023] A comprehensive Flash testing method for a powered-on device includes the following steps. First, after powering on, the device enters production testing mode, starts the production testing program, and executes the Flash testing process. Then, it determines whether to perform the test by checking if there are any production testing configuration traces on the device or if the current partition configuration is suitable for the test. If production testing configuration traces exist or the current partition configuration is unsuitable for testing, the subsequent Flash test is skipped, and other production testing items continue; otherwise, the Flash erase / write test step is initiated. In the Flash erase / write test, a test file is created in the writable configuration directory, test data is written, and then read back for comparison. If the read / write fails or the read content is inconsistent with the written content, the Flash medium is deemed abnormal, the production test fails, and an alarm is triggered. If they match, the step of determining whether to perform a burning integrity verification is initiated. In this step, onboard verification information is read. If there is no verification information, or the firmware version and generation time in the verification information do not match the current firmware, the integrity verification is skipped, and the cleanup and continuation step is initiated directly; if they match, the partition integrity comparison step is initiated. In the partition integrity comparison step, the corresponding Flash partitions are read sequentially according to the partition list in the verification information. The MD5 hash is calculated and compared with the expected value. If all values match, the burning process is considered successful. If any partition does not match, the burning process is considered unsuccessful, the production test fails, and an alarm is triggered. Finally, the cleanup and continue step is performed. After the Flash test passes, the onboard verification file is deleted to avoid duplicate verification, and the subsequent production test process continues.
[0024] Furthermore, in the Flash erase / write test step, the writable configuration directory is the configuration partition where data can be written during device firmware runtime. The test file write and read-back comparison operations are completed independently by the device-side firmware during the production testing phase, without relying on external programming tools. This design ensures that the testing process is performed under real-world operating conditions, thereby reflecting the read / write reliability of the Flash in actual operating conditions.
[0025] Furthermore, in the step of determining whether to perform a firmware integrity verification, the onboard verification information is written by the firmware programming process. This information includes the firmware version number, firmware generation time, and partition list. The partition list records the identifier of each partition to be verified and its corresponding expected MD5 value. This gating mechanism ensures that subsequent MD5 comparisons are only performed when the verification information completely matches the current firmware, avoiding misjudgments caused by information mismatches.
[0026] Furthermore, in the partition integrity comparison step, MD5 calculation and comparison are performed by the device-side production test firmware. When all comparison results are consistent, the overall Flash programming status of the device is deemed qualified. If any partition is inconsistent, a production test failure alarm is triggered to intercept hidden faults caused by poor soldering, process damage, or post-processing defects. This step enables timely detection of data corruption issues under overall device operating conditions that are difficult to cover during the production test phase.
[0027] Furthermore, in the cleanup and continue step, the deletion of the onboard verification file is performed after the Flash test passes, ensuring that the device leaves the factory without a verification file. This avoids repeated verification triggers and maintains the purity of the factory environment. This step helps simplify the factory process, reduce unnecessary duplicate tests, and prevent residual verification files from interfering with the normal operation of the device.
[0028] Furthermore, in the step of determining whether to perform a test, the production test configuration trace is a mark left on the storage medium during the previous production test process on the device. This trace is used to determine whether a Flash test has already been performed, preventing duplicate tests. This design can improve mass production efficiency and avoid unnecessary duplicate tests on the same batch of products.
[0029] Furthermore, this method also includes outputting an alarm signal and stopping subsequent production testing processes when Flash erase / write tests or partition integrity comparison tests fail, thus intercepting defective products during the production testing stage. This design ensures that defective products do not flow into subsequent processes or to the user end, thereby reducing after-sales risks.
[0030] This invention also provides a comprehensive Flash testing device for a whole machine upon power-on, comprising a storage unit, a testing unit, a verification unit, and a control unit. The storage unit stores firmware, a writable configuration directory, onboard verification information, and test files; the testing unit performs Flash erase / write tests, creates test files in the writable configuration directory, writes test data, and reads it back for comparison; the verification unit reads the onboard verification information, performs MD5 calculations on the Flash partitions according to the partition list when the firmware version and generation time match, and compares the MD5 with the expected value; the control unit deletes the onboard verification file after the Flash test passes and controls the continuation or termination of the production testing process.
[0031] Furthermore, the detection and verification units are autonomously triggered by the device-side testing firmware after the entire machine is powered on. This allows for a secondary verification under full-machine operating conditions, in addition to the verification performed by the SMT programming tool, to identify cold solder joints or post-processing damage. This device can compensate for the blind spots of instantaneous verification in existing SMT programming tools, improving the comprehensiveness of mass production testing.
[0032] Furthermore, the control unit triggers an alarm and blocks product shipment when the write test fails or the MD5 comparison fails. After the test passes, the verification file is cleaned to maintain the product in its factory condition, forming a closed-loop self-testing system for mass production. This closed-loop design effectively ensures the quality of products leaving the factory, while automating and standardizing the testing process and improving production efficiency.
[0033] This invention has illustrated its principles and implementation methods using specific examples. The descriptions of these embodiments are merely illustrative of the method and its core ideas; furthermore, those skilled in the art will recognize that modifications may be made to the specific implementation methods and application scope based on the principles of this invention. Therefore, the content of this specification should not be construed as limiting the invention.
Claims
1. A comprehensive testing method for flash memory upon power-on of a complete machine, characterized in that, Includes the following steps: S1. After the device is powered on, it enters the production test mode, starts the production test program, and executes the Flash test process. S2. Determine whether to perform the test: Determine whether there are already production test configuration traces on the device, or whether the current partition form is suitable for this test. If there are production test configuration traces or the current partition form is not suitable for the test, skip the subsequent Flash test and continue with other production test items. Otherwise, proceed to step S3; S3. Flash erase / write test: Create a test file in the writable configuration directory, write test data, and then read it back for comparison. If the read / write fails or the read content is inconsistent with the written content, the Flash medium is determined to be abnormal, the production test fails, and an alarm is triggered to block it; if they are consistent, proceed to step S4. S4. Determine whether to perform a flashing integrity check: Read the onboard verification information. If there is no verification information, or the firmware version and generation time in the verification information do not match the current firmware, skip the integrity check and proceed to step S6; if they match, proceed to step S5. S5. Partition integrity comparison: According to the partition list in the verification information, read the corresponding Flash partitions in sequence, calculate the MD5 and compare it with the expected value. If all are consistent, the burning is deemed successful; if any partition is inconsistent, the burning is deemed unsuccessful, the production test fails and an alarm is triggered. S6. Clean and Continue: After the Flash test passes, delete the onboard verification file to avoid duplicate verification, and continue the subsequent production testing process.
2. The method for comprehensive Flash detection upon power-on of the entire machine as described in claim 1, characterized in that, In step S3, the writable configuration directory is a configuration partition where data can be written during device firmware runtime. The test file writing and readback comparison operations are completed independently by the device-side firmware during the production testing phase, without relying on external burning tools.
3. The method for comprehensive Flash detection upon power-on of the entire machine as described in claim 1, characterized in that, In step S4, the onboard verification information is written by the burning process and includes the firmware version number, firmware generation time and partition list. The partition list records the identifier of each partition to be verified and the corresponding expected MD5 value.
4. The method for comprehensive Flash detection upon power-on of the entire machine as described in claim 1, characterized in that, In step S5, the MD5 calculation and comparison are performed by the device-side production test firmware. When all comparison results are consistent, the overall Flash burning status is determined to be qualified. If any partition is inconsistent, a production test failure alarm is triggered to intercept hidden faults caused by poor soldering, process damage, or poor post-processing.
5. The method for comprehensive Flash detection upon power-on of the entire machine as described in claim 1, characterized in that, In step S6, the deletion of the onboard verification file is performed after the Flash test passes, so that the device is in a state without verification files when it leaves the factory, avoiding repeated triggering of verification in the future, and ensuring the purity of the factory environment.
6. The method for comprehensive Flash detection upon power-on of the entire machine as described in claim 1, characterized in that, In step S2, the production test configuration trace is a mark left on the storage medium during the previous production test process on the device, used to determine whether Flash testing has been performed and to prevent duplicate testing.
7. The method for comprehensive Flash detection upon power-on of the entire machine as described in claim 1, characterized in that, The method also includes outputting an alarm signal and stopping the subsequent production testing process through the production testing program when the detection fails in step S3 or step S5, so that defective products are intercepted in the production testing stage.
8. A comprehensive flash detection device for a whole machine upon power-on, characterized in that, include: The storage unit is used to store firmware, writable configuration directory, onboard verification information, and test files. The detection unit is used to perform Flash erase and write tests, create test files in the writable configuration directory, write test data, and read back for comparison. The verification unit is used to read the onboard verification information, and when the firmware version and generation time match, it performs MD5 calculation on the Flash partition according to the partition list and compares it with the expected value. The control unit is used to delete the onboard verification file after the Flash test passes and to control the continuation or termination of the production testing process.
9. The integrated flash detection device for power-on of the entire machine as described in claim 8, characterized in that, The detection unit and the verification unit are automatically triggered by the device-side production test firmware after the whole machine is powered on. They are used to perform a secondary verification under the whole machine's operating conditions, in addition to the verification by the SMT programming tool, in order to identify cold solder joints or post-process damage.
10. The integrated flash detection device for power-on of the entire machine as described in claim 8, characterized in that, The control unit triggers an alarm and blocks the product from leaving the factory when the erase / write test is abnormal or the MD5 comparison fails. After the test passes, the verification file is cleaned up to maintain the factory state, forming a closed loop for mass production self-testing.
