Systems and methods for training monitors for high-frequency operation

By storing the training address in non-volatile memory and adjusting the SPI clock delay of the SPI monitor, the data error problem in SPI monitor training at high frequencies is solved, achieving efficient data sampling and system adaptability.

CN123125584APending Publication Date: 2026-11-17MICROCHIP TECHNOLOGY INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202580027171.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2025-03-12
Filing Date
2025-03-13
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively train serial peripheral interface (SPI) monitors at high frequencies, leading to data sampling not meeting the set time, resulting in data errors. Furthermore, tap values ​​are affected by temperature variations and circuit board parasitic effects.

Method used

By storing the training address in non-volatile memory, the application processor (AP) compares the addresses and triggers the training operation, the SPI clock delay of the SPI monitor is adjusted, external SPI flash data is read and compared with a reference value, pass/fail status is stored, and the selected SPI clock delay value is determined and set.

Benefits of technology

This enables efficient training of the SPI monitor at high frequencies, reduces server startup time, and improves data sampling accuracy and system flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123125584A_ABST
    Figure CN123125584A_ABST
Patent Text Reader

Abstract

Systems and methods for training a Serial Peripheral Interface (SPI) monitor for high-frequency operation include: storing a training address in memory; comparing an address accessed by an application processor (AP) with the training address; and providing a reset signal or an interrupt signal to the AP in response to an address match. An iterative training operation is performed to train the SPI monitor for a corresponding SPI clock delay value, the iterative training operation including: adjusting the SPI clock delay of the SPI monitor for the corresponding SPI clock delay value; reading data from an external SPI flash memory; comparing the read data with a reference value; and storing the pass / fail status of the read data. A selected SPI clock delay value is determined, and the SPI clock delay of the SPI monitor is set to the selected SPI clock delay value.
Need to check novelty before this filing date? Find Prior Art

Description

Cross-reference to related applications

[0001] This application claims priority to U.S. Nonprovisional Patent Application No. 19 / 077,616, filed March 12, 2025, and Indian Provisional Patent Application No. 202441018021, filed March 13, 2024, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This disclosure relates in general to serial peripheral interfaces, and more specifically to systems and methods for training serial peripheral interface (SPI) monitors for high-frequency operation. Summary of the Invention

[0003] According to one or more examples, a method is provided for training a Serial Peripheral Interface (SPI) monitor for high-frequency operation. The method may include: storing a training address in non-volatile memory; comparing an address accessed by an application processor (AP) with the training address; providing a reset signal or interrupt signal to the AP in response to an address match between the address and the training address, the provision triggering training of the SPI monitor; performing an iterative training operation to train the SPI monitor for a corresponding SPI clock delay value among a plurality of SPI clock delay values, the training operation including: adjusting the SPI clock delay of the SPI monitor for a corresponding SPI clock delay value among the plurality of SPI clock delay values; reading data from an external SPI flash memory via the AP; comparing the read data with a reference value; and storing a pass / fail status of the read data based on the comparison. Furthermore, the method includes: determining a selected SPI clock delay value for the SPI monitor based on a plurality of stored pass / fail statuses obtained from the training operation; and setting the SPI clock delay of the SPI monitor to the selected SPI clock delay value.

[0004] Adjustments may include setting a corresponding SPI clock delay value in the tap control register of the SPI monitor. The reference value may be obtained from previously stored data values, and the corresponding SPI clock delay value for the current iteration based on the training operation is compared to determine if the read data matches the expected result. Multiple pass / fail states are stored in static random access memory (SRAM). The method may include repeatedly performing training operations for different monitors based on different training addresses that result in another address match through storage, comparison, reset, and trigger selection. The non-volatile memory may be one-time programmable (OTP) memory. The non-volatile memory may be flash memory. The method may include storing mode information in the non-volatile memory. The mode information may indicate the communication mode for an external SPI flash memory. The data read from the external SPI flash memory may be a predefined set of data bytes. The read data may be obtained at a clock frequency higher than the corresponding clock frequency at which the reference value was obtained. Determining the selected clock delay value may include: identifying the lowest index SPI clock delay value that passed the comparison from the stored pass / fail status by matching the read data with a reference value; identifying the highest index SPI clock delay value that passed the comparison from the stored pass / fail status by matching the read data with a reference value; and calculating the average of the lowest index SPI clock delay value and the highest index SPI clock delay value. The selected SPI clock delay value may be an average value.

[0005] According to one or more examples, a system is provided for training a Serial Peripheral Interface (SPI) monitor for high-frequency operation. The system may include: a non-volatile memory for storing a training address; a comparator for comparing an address accessed by an application processor (AP) with the training address; a trigger circuit for providing a reset signal or an interrupt signal to the AP in response to an address match between the address and the training address; and training control circuitry. The training control circuitry may perform a training operation to train the SPI monitor for multiple SPI clock delay values, the training operation including: adjusting the SPI clock delay of the SPI monitor for a corresponding SPI clock delay value among the multiple SPI clock delay values; reading data from an external SPI flash memory via the AP; comparing the read data with a reference value; and storing a pass / fail status of the read data based on the comparison. The training control circuitry may determine a selected SPI clock delay value for the SPI monitor based on the multiple stored pass / fail statuses obtained from the training operation, and set the SPI clock delay of the SPI monitor to the selected SPI clock delay value.

[0006] The triggering circuit may include a communication interface for sending a reset or interrupt signal to the AP. The communication interface may be one of a general-purpose input / output (GPIO), secure internal integrated circuit (I2C), improved internal integrated circuit (I3C), or an interrupt unit. The training circuit may include a tap controller for setting the corresponding SPI clock delay value in the tap control register of the SPI monitor. The training circuit can obtain a reference value from previously stored data values ​​and compare the corresponding SPI clock delay value for the current iteration based on the training operation to determine whether the read data matches the expected result. The training circuit may include SRAM, and multiple stored pass / fail states are stored in the SRAM. The system may include a selection circuit for selecting different training addresses for training different SPI monitors.

[0007] According to one or more examples, a non-transitory computer-readable storage medium is provided that stores instructions that, when executed by a processor, cause the processor to perform a method for training a Serial Peripheral Interface (SPI) monitor for high-frequency operation. Attached Figure Description

[0008] Figure 1 A block diagram is shown illustrating a system for training a Serial Peripheral Interface (SPI) monitor for high-frequency operation, based on one or more examples.

[0009] Figure 2A and Figure 2B A flowchart illustrating a method for training an SPI monitor for high-frequency operation, based on one or more examples, is shown.

[0010] Figure 3A and Figure 3B A flowchart illustrating a block for training an SPI monitor by resetting the application processor, based on one or more examples, is shown.

[0011] Figure 4A and Figure 4B A flowchart illustrating a block for training an SPI monitor by generating an interrupt signal to an application processor, based on one or more examples, is shown. Detailed Implementation

[0012] Reference will now be made to the various examples illustrated in the accompanying drawings, in which the same reference numerals always denote the same elements. These examples may be presented in various forms, and are not limited to those described herein.

[0013] To move toward higher Serial Peripheral Interface (SPI) flash memory frequencies, the SPI monitor can be trained to find a selected timing for receiving (RX) data, which can reduce server startup time. While the controller can easily adjust the clock line and initiate a transmission, this method is not suitable for passive devices such as SPI monitors. At higher frequencies, sampling RX data at the next clock edge may not meet the set timing, leading to data errors. Currently, the tap point is determined in a validation lab. However, temperature variations and board parasitic effects can alter the tap values, rendering pre-programmed values ​​invalid. Therefore, the shortcomings of the existing process can be addressed by systems and methods for training the SPI to monitor higher frequencies.

[0014] Figure 1 A block diagram of a system 100 for training a Serial Peripheral Interface (SPI) monitor 104 for high-frequency operation, exemplified according to one or more examples, is shown. System 100 may include an application processor 102, an SPI monitor 104, non-volatile memory 106, a comparator 108, a trigger circuit 110, training control circuitry 114, and selection circuitry 120. Trigger circuitry 110 may include a communication interface 112 for communicating with application processor 102. Training control circuitry 114 may include a tap controller 116 and static random access memory 118.

[0015] Application processor 102 can serve as the central processing unit of system 100 to orchestrate various aspects of the training process. Application processor 102 can access addresses and perform various operations within system 100. Application processor 102 can initiate training of SPI monitor 104 by accessing an address that can be compared with a training address stored in non-volatile memory 106. Application processor 102 can access an SPI flash address corresponding to a specific location within external SPI flash memory identified during the training process associated with the training address to read data used to calibrate SPI monitor 104. Specifically, application processor 102 can interact with SPI monitor 104, read data from external SPI flash memory, and communicate with other components via trigger circuitry 110.

[0016] Non-volatile memory 106 can store training addresses, mode information, and firmware. In one or more examples, non-volatile memory 106 can be one-time programmable (OTP) memory and flash memory. The training address used for the chip select can act as a trigger to initiate training of the SPI monitor 104. When application processor 102 accesses the training address associated with the chip select, system 100 can initiate training of the corresponding SPI monitor connected to the chip select. Mode information can indicate the communication mode for external SPI flash memory. In one or more examples, the communication mode can be a single-wire communication mode, a two-wire communication mode, and a four-wire communication mode.

[0017] Firmware may be a permanent set of instructions stored in non-volatile memory 106. Firmware may act as middleware between hardware (e.g., application processor 102) and software (e.g., application program). Firmware may provide application processor 102 with specific instructions to perform various tasks related to training the SPI monitor 104. Application processor 102 may fetch and interpret firmware instructions from non-volatile memory 106 during training of the SPI monitor 104. Firmware instructions may guide application processor 102 to access and interpret training addresses. Firmware may instruct application processor 102 to access a specific training address stored in non-volatile memory 106 and identify that specific training address as a trigger for initiating training of the SPI monitor 104. Firmware may provide application processor 102 with instructions to interact with other components of system 100, such as comparator 108, trigger circuitry 110, and training control circuitry 114. These instructions may include sending signals, retrieving data, and performing calculations. The firmware can determine the operations involved in the training process, such as adjusting the SPI clock delay, reading data from the external SPI flash memory, comparing data with reference values, storing pass / fail statuses, and identifying selected tap values. An application processor 102 equipped with its processing capabilities can execute the aforementioned instructions to ensure smooth and efficient training of the SPI monitor 104.

[0018] SPI monitor 104 can monitor and adjust the Serial Peripheral Interface (SPI) clock delay. SPI monitor 104 can facilitate the operation of high-frequency SPI communication. SPI monitor 104 can improve the performance of multiple SPI devices connected to system 100 by adjusting the clock delay. Comparator 108 can compare an address accessed by application processor 102 with a training address stored in non-volatile memory 106. The comparison can be used as a trigger mechanism to signal the initiation of a training operation when an address match is detected.

[0019] Trigger circuit 110 can initiate a training operation based on the comparison result from comparator 108. Trigger circuit 110 can communicate with application processor 102, resetting application processor 102 or generating an interrupt signal in response to address matching, depending on the specific requirements of the training process. Trigger circuit 110 may include communication interface 112, which sends a reset signal or interrupt signal to application processor 102. The communication interface may be one of general purpose input / output (GPIO), secure internal integrated circuit (I2C), improved internal integrated circuit (I3C), and interrupt unit. Application processor 102 can ensure coordination between components of system 100 during the training process.

[0020] Training control circuitry 114 controls the training process, thereby managing data analysis and adjusting the SPI clock delay for SPI monitor 104. Training control circuitry 114 can use application processor 102 to read data from external SPI flash memory. Training control circuitry 114 can compare the read data with reference values. Training control circuitry 114 can obtain reference values ​​from previously stored data values.

[0021] Training control circuitry 114 may include a tap controller 116 for setting tap values ​​in a tap control register, which can be used to tune the clock delay. Training control circuitry 114 may include a static random access memory (SRAM) 118 for storing pass / fail states derived from comparisons of read data and reference values, thereby enabling iterative refinement of the clock delay setting. Training control circuitry 114 can repeatedly adjust, read, compare, and store multiple SPI clock delay values. Training control circuitry 114 can determine a selected SPI clock delay based on multiple stored pass / fail states. Training control circuitry 114 can set a selected SPI clock delay for SPI monitor 104. Selection circuitry 120 can select different training addresses to train different SPI monitors, which provides flexibility to system 100. Selection circuitry 120 can enhance the adaptability of system 100, allowing system 100 to efficiently meet different monitoring requirements.

[0022] Figure 2A and Figure 2B A flowchart 200 illustrating a method for training a Serial Peripheral Interface (SPI) monitor 104 for high-frequency operation, based on one or more examples, is provided. It should be noted that reference will be made to the method described in flowchart 200 for explanation. Figure 1 The components explained in the text.

[0023] Flowchart 200 begins at operation 202. At operation 204, the method may include: storing a training address in non-volatile memory 106. At operation 206, the method may include: comparing an address accessed by AP 102 with the training address. At operation 208, the method may include: resetting AP 102 or generating an interrupt signal to AP 102 in response to an address match. At operation 210, the method may include: triggering training based on an address match. At operation 212, the method may include: adjusting the SPI clock delay for SPI monitor 104. At operation 214, the method may include: using AP 102 to read data from an external SPI flash memory. At operation 216, the method may include: comparing the read data with a reference value. At operation 218, the method may include: storing a pass / fail status based on the comparison. At operation 220, the method may include: repeatedly adjusting, reading, comparing, and storing for multiple SPI clock delay values. At operation 222, the method may include determining a selected SPI clock delay based on multiple stored pass / fail states. At operation 224, the method may include setting a selected SPI clock delay for SPI monitor 104.

[0024] Flowchart 200 terminates at operation 226. It should be noted that flowchart 200 is to be interpreted as having the process operations described above; however, those skilled in the art will understand that flowchart 200 may have more or fewer process operations that can implement all the above examples of this disclosure.

[0025] Figure 3A and Figure 3B A flowchart illustrating, based on one or more examples, for training an SPI monitor 104 by resetting the application processor 102 is illustrated in combination. At operation 300, the application firmware can configure the four-wire mode serial peripheral interface to operate at an SPI clock frequency of approximately 12 MHz for chip select (e.g., CS0#). At operation 302, the application firmware can initiate a read operation to retrieve a predetermined set of bytes from external SPI flash memory. This operation can be targeted at a specified start address. The retrieved data can be stored in internal memory using an existing byte hash. At operation 304, a 30-bit variable named pass_status can be created in static random access memory 118 to store the pass / fail status.

[0026] At operation 306, a reset signal can be initiated based on instructions from the application firmware. At operation 308, data can be read from the external SPI flash memory. At operation 310, the pass_status variable can be initialized so that all bits are set to a logical value of zero (bits Pass_Status[29:0]=0x0). At operation 312, the tap register of the SPI monitor 104 can be programmed using a specific setting designated as "i". The specific setting designated as "i" can represent a specific value within a predefined sequence of tap values ​​to be evaluated during the training process. At operation 314, the method can iterate through the predefined sequence of 30 tap values ​​one by one and program the corresponding tap register within the SPI monitor 104 for each tap value.

[0027] At operation 316, a predefined set of data bytes can be read from an external SPI flash memory using a four-wire mode serial peripheral interface in each iteration. At operation 318, the read data can be compared with a predefined reference value to determine whether the read data matches the expected result based on the specific tap value used during the current iteration. At operation 320, it is determined whether the read data obtained using the current tap value at a clock frequency of approximately 96 MHz matches an earlier reference value received at a clock frequency of approximately 12 MHz. If a match exists between the data at the two frequencies, the pass_status variable can be set to a logic value of 1. At operation 322, the application firmware can initiate a reset signal to the application processor 102. At operation 324, the application firmware can introduce a brief, predetermined delay before releasing the asserted reset signal to the application processor 102.

[0028] At operation 326, the reset, delay, and release can be repeated until the training cycle for chip select is complete. At operation 328, it is determined whether calibration is required. At operation 330, the `pass_status` variable, which holds the pass / fail status of each tap value evaluated during the training process, can be analyzed. At operation 332, two indices can be identified: the index of the first bit in the `pass_status` variable, which is set to logic 1, representing the lowest index tap value that successfully passed the data comparison at a higher clock frequency; and the index of the last bit in the `pass_status` variable, which is set to logic 1, representing the highest index tap value that successfully passed the data comparison at a higher clock frequency. At operation 334, the average of the identified indices can be calculated. The average can represent the average tap value. At operation 336, the average tap value can be programmed into the tap register of the SPI monitor 104 for chip select. At operation 338, the application processor 102 can be signaled that the calculation of the average tap value is complete. At operation 340, it is determined whether training for different chip selects (e.g., CS1#) has been completed. If training for different chip selects has been completed at operation 342, the training process stops. If it is determined at operation 342 that training for different chip selects has not been completed, the method proceeds to operation 300.

[0029] Figure 4A and Figure 4B A flowchart illustrating, based on one or more examples, is provided for training an SPI monitor 104 by generating an interrupt signal to an application processor 102. At operation 400, the application firmware can configure a four-wire mode serial peripheral interface to operate at an SPI clock frequency of approximately 12 MHz for chip select (e.g., CS0#). At operation 402, the application firmware can initiate a read operation to retrieve a predetermined set of bytes from an external SPI flash memory. This operation can be targeted at a specified start address. The retrieved data can be stored in internal memory using an existing byte hash. At operation 404, a 30-bit variable named `pass_status` can be created in static random access memory 118 to store the pass / fail status.

[0030] At operation 406, a reset signal can be initiated based on instructions from the application firmware. At operation 408, data can be read from the external SPI flash memory. At operation 410, the pass_status variable can be initialized so that all bits are set to a logical value of zero (bits Pass_Status[29:0]=0x0). At operation 412, the tap register of the SPI monitor 104 can be programmed using a specific setting designated as "i". The specific setting designated as "i" can represent a specific value within a predefined sequence of tap values ​​to be evaluated during the training process. At operation 414, the predefined sequence of 30 tap values ​​is iterated one by one, and the corresponding tap register within the SPI monitor 104 is programmed for each tap value.

[0031] At operation 416, a predefined set of data bytes can be read from an external SPI flash memory using a four-wire mode serial peripheral interface in each iteration. At operation 418, the read data can be compared with a predefined reference value to determine whether the read data matches the expected result based on the specific tap value used during the current iteration. At operation 420, it is determined whether the read data obtained using the current tap value at a clock frequency of approximately 96 MHz matches an earlier reference value received at a clock frequency of approximately 12 MHz. If a match exists between the data at the two frequencies, the pass_status variable can be set to a logic value of 1. At operation 422, it is determined whether calibration is required. At operation 424, when an interrupt signal is received, the application firmware can instruct the application processor 102 to terminate.

[0032] At operation 426, the `pass_status` variable can be analyzed, which holds the pass / fail status of each tap value evaluated during the training process. At operation 428, two indices can be identified: the index of the first bit in the `pass_status` variable, which is set to logic 1, representing the lowest index tap value that successfully passed the data comparison at a higher clock frequency; and the index of the last bit in the `pass_status` variable, which is set to logic 1, representing the highest index tap value that successfully passed the data comparison at a higher clock frequency. At operation 430, the average of the identified indices can be calculated. The average can represent the average tap value. At operation 432, the average tap value can be programmed into the tap register of the SPI monitor 104 for chip select use. At operation 434, the application processor 102 can be signaled that the calculation of the average tap value is complete. At operation 436, it is determined whether training for a different chip select (e.g., CS1#) is complete. If training for a different chip select is complete at operation 438, the training process stops. If it is determined in operation 436 that training for different chip selections has not been completed, the method proceeds to operation 400.

[0033] Various examples have been disclosed herein in conjunction with the foregoing description and accompanying drawings. It should be understood that describing and illustrating each combination and sub-combination of these examples literally would be an undue repetition. Therefore, all examples can be combined in any manner or combination, and this specification (including the accompanying drawings) should be construed as constituting a complete written description of all combinations and sub-combinations of these examples herein, as well as the ways and processes of preparing and using them, and should support the claims for any such combinations or sub-combinations.

[0034] Those skilled in the art will understand that the examples described herein are not limited to those specifically shown and described above. Furthermore, unless the contrary is mentioned above, it should be noted that all figures are not drawn to scale. Various modifications and variations are possible in accordance with the above teachings.

Claims

1. A method for training a Serial Peripheral Interface (SPI) monitor for high-frequency operation, the method comprising: Store the training address in non-volatile memory; The address accessed by the application processor (AP) is compared with the training address; In response to an address match between the address and the training address, a reset signal or an interrupt signal is provided to the AP, which triggers the training of the SPI monitor; Perform iterative training operations to train the SPI monitor for a corresponding SPI clock delay value among a plurality of SPI clock delay values, the training operations including: For the corresponding SPI clock delay value among the plurality of SPI clock delay values, adjust the SPI clock delay of the SPI monitor; Data is read from an external SPI flash memory via the AP; Compare the read data with the reference value; and The pass / fail status of the read data is stored based on the comparison. A selected SPI clock delay value for the SPI monitor is determined based on multiple stored pass / fail states obtained from the training operation; and Set the SPI clock delay of the SPI monitor to the selected SPI clock delay value.

2. The method of claim 1, wherein the adjustment includes: Set the corresponding SPI clock delay value in the tap control register of the SPI monitor.

3. The method of claim 1, wherein the reference value is obtained from previously stored data values, and the comparison is based on the corresponding SPI clock delay value of the current iteration of the training operation to determine whether the read data is consistent with the expected result.

4. The method of claim 1, wherein the plurality of stored pass / fail states are stored in static random access memory (SRAM).

5. The method according to claim 1, further comprising: The training operation is repeated for different SPI monitors by selecting different training addresses that lead to another address match based on the storage, the comparison, the reset, and the trigger.

6. The method of claim 1, wherein the non-volatile memory is an one-time programmable (OTP) memory.

7. The method according to claim 1, wherein the non-volatile memory is a flash memory.

8. The method according to claim 1, further comprising: Mode information is stored in the non-volatile memory, wherein the mode information indicates the communication mode for the external SPI flash memory.

9. The method of claim 1, wherein the data read from the external SPI flash memory is a predefined set of data bytes.

10. The method of claim 1, wherein the data read is obtained at a clock frequency higher than the corresponding clock frequency at which the reference value is obtained.

11. The method of claim 1, wherein determining the selected SPI clock delay value comprises: By matching the read data with the reference value, the lowest index SPI clock delay value that passes the comparison is identified from the stored pass / fail status; By matching the read data with the reference value, the highest index SPI clock delay value that passed the comparison is identified from the stored pass / fail status; as well as Calculate the average of the lowest index SPI clock delay value and the highest index SPI clock delay value.

12. The method of claim 11, wherein the selected SPI clock delay value is the average value.

13. A system for training a Serial Peripheral Interface (SPI) monitor for high-frequency operation, the system comprising: Non-volatile memory, wherein the non-volatile memory is used to store training addresses; A comparator for comparing an address accessed by an application processor (AP) with the training address; A triggering circuit, wherein the triggering circuit is configured to provide a reset signal or an interrupt signal to the AP in response to an address match between the address and the training address; and Training control circuit, the training control circuit being used for: Perform iterative training operations to train the SPI monitor for a corresponding SPI clock delay value among a plurality of SPI clock delay values, the training operations including: For the corresponding SPI clock delay value among the plurality of SPI clock delay values, adjust the SPI clock delay of the SPI monitor; Data is read from an external SPI flash memory via the AP; Compare the read data with the reference value; and The pass / fail status of the read data is stored based on the comparison. A selected SPI clock delay value for the SPI monitor is determined based on multiple stored pass / fail states obtained from the training operation; and Set the SPI clock delay of the SPI monitor to the selected SPI clock delay value.

14. The system of claim 13, wherein the trigger circuit includes a communication interface for sending the reset signal or the interrupt signal to the AP.

15. The system of claim 14, wherein the communication interface is one of a general purpose input / output unit (GPIO), a secure internal integrated circuit (I2C), an improved internal integrated circuit (I3C), and an interrupt unit.

16. The system of claim 13, wherein the training circuit includes a tap controller for setting the corresponding SPI clock delay value in the tap control register of the SPI monitor.

17. The system of claim 13, wherein the training circuit obtains the reference value from previously stored data values, and the comparison is based on the corresponding SPI clock delay value of the current iteration of the training operation to determine whether the read data is consistent with the expected result.

18. The system of claim 13, wherein the training circuitry includes SRAM, and the plurality of stored pass / fail states are stored in the SRAM.

19. The system of claim 13, further comprising a selection circuit for selecting different training addresses for training different SPI monitors.

20. A non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium comprising instructions that, when executed by a processor, cause the processor to: Store the training address in non-volatile memory; The address accessed by the application processor (AP) is compared with the training address; In response to an address match between the address and the training address, a reset signal or an interrupt signal is provided to the AP, which triggers the training of the SPI monitor; Perform iterative training operations to train the SPI monitor for a corresponding SPI clock delay value among a plurality of SPI clock delay values, the training operations including: For the corresponding SPI clock delay value among the plurality of SPI clock delay values, adjust the SPI clock delay of the SPI monitor; Data is read from an external SPI flash memory via the AP; Compare the read data with the reference value; and The pass / fail status of the read data is stored based on the comparison. A selected SPI clock delay value for the SPI monitor is determined based on multiple stored pass / fail states obtained from the training operation; and Set the SPI clock delay of the SPI monitor to the selected SPI clock delay value.