Data transmission method and device based on DAPLink
By introducing preset cycle reading and sleep mode into DAPLink, the problem of long USB communication time between DAPLink and the host computer is solved, the data sampling accuracy is improved and the power consumption is reduced, and the data transmission efficiency and accuracy are solved. improvement.
Patent Information
- Application Number
- CN202411028222.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, the USB communication time between DAPLink and the host computer is long, which makes it impossible to further improve the data sampling accuracy. Especially when the target chip memory data changes rapidly, there is a risk of omitting the variable change process.
By introducing a preset cycle into DAPLink to read the target chip data cyclically, and return multiple data at once when receiving a read instruction, combined with the sleep mode and data deletion mechanism, the data transmission efficiency and accuracy are improved.
It achieves an improvement in data sampling accuracy, reduces data transmission time, reduces data transmission errors and DAPLink storage pressure, while maintaining low power consumption in low-power mode.
Smart Images

Figure CN118760633A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the DAPLink technical field, and in particular to a DAPLink-based data transmission method and device. Background Art
[0002] See also Figure 1 and Figure 2 The host computer sends a command to obtain the memory address data of the target chip through USB, and DAPLink reads the memory address of the target chip through SWD. DAPLink responds to the acquired data to the host computer through USB, and the host computer displays the acquired data using a curve; assuming that the host computer reads once in a 1ms cycle, the data accuracy is 1ms.
[0003] Then, if we want to further improve the accuracy to 100us, it is impossible to do so, because the USB communication between the host computer and DAPLink takes nearly 100us to transmit a packet of data. It can be seen that the existing technology is limited by the long time required for data transmission between the host computer and DAPLink, resulting in the inability to further improve the accuracy of the data obtained by the host computer. When the memory data of the target chip changes rapidly, there is a risk of missing the variable change process. Summary of the invention
[0004] The present application provides a data transmission method and device based on DAPLink, which can improve the data sampling accuracy.
[0005] In a first aspect, an embodiment of the present application provides a data transmission method based on DAPLink, which is applied to DAPLink, where DAPLink connects a host computer and a target chip respectively; the method comprises:
[0006] Receive the address instruction from the host computer and store the address information in the address instruction;
[0007] Receive the start instruction from the host computer, cyclically read the target data corresponding to the address information in the target chip according to the preset period, and store the multiple target data read cyclically;
[0008] Receive the read instruction from the host computer and send the stored target data to the host computer;
[0009] The preset period is smaller than the reading period of the reading instruction sent by the host computer.
[0010] Furthermore, the method further comprises:
[0011] After each target data is sent to the host computer, the stored target data is deleted.
[0012] Furthermore, it also includes:
[0013] After reading the target data, it enters a dormant state until the next read or until a read instruction is received.
[0014] Furthermore, the preset period ranges from 10 microseconds to 10 milliseconds.
[0015] Furthermore, the operating main frequency when reading and sending each target data is 168 MHz.
[0016] In a second aspect, an embodiment of the present application provides a data transmission device based on DAPLink, which is applied to DAPLink, and DAPLink is respectively connected to a host computer and a target chip; the device includes:
[0017] An address module is used to receive an address instruction from a host computer and store the address information in the address instruction;
[0018] The reading module is used to receive the start instruction of the host computer, cyclically read the target data corresponding to the address information in the target chip according to a preset period, and store the multiple target data read cyclically;
[0019] The sending module is used to receive the reading instruction of the host computer and send the stored target data to the host computer;
[0020] The preset period is smaller than the reading period of the reading instruction sent by the host computer.
[0021] Furthermore, the device also includes a deletion module, which is used to delete each stored target data after sending each target data to the host computer.
[0022] Furthermore, the device also includes a sleep module, which is used to enter a sleep state after reading the target data until the next reading or receiving a read instruction.
[0023] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of a DAPLink-based data transmission method as in any of the above embodiments are performed.
[0024] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of a DAPLink-based data transmission method as in any of the above embodiments are implemented.
[0025] In summary, compared with the prior art, the technical solution provided in the embodiment of the present application has at least the following beneficial effects:
[0026] The embodiment of the present application provides a data transmission method based on DAPLink. After storing the address information sent by the host computer, the target data corresponding to the address information in the target chip is cyclically read according to a preset period. Since the preset period is smaller than the reading period of the read instruction sent by the host computer, when responding to the read instruction, the read multiple target data can be sent to the host computer, thereby improving the data sampling accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A wiring diagram of a host computer and a target chip in the prior art is provided for an exemplary embodiment of the present application.
[0028] Figure 2 A communication timing diagram between a host computer and a target chip in the prior art is provided for an exemplary embodiment of the present application.
[0029] Figure 3 A flowchart of a DAPLink-based data transmission method is provided for an exemplary embodiment of the present application.
[0030] Figure 4 A timing diagram of a data transmission method based on DAPLink is provided as an exemplary embodiment of the present application.
[0031] Figure 5 A structural diagram of a DAPLink-based data transmission device provided as an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0033] Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of this application.
[0034] See also Figure 3 The embodiment of the present application provides a data transmission method based on DAPLink, which is applied to DAPLink, where DAPLink connects a host computer and a target chip respectively; the method includes:
[0035] Step S1, receiving an address instruction from a host computer and storing the address information in the address instruction.
[0036] Step S2, receiving a start instruction from the host computer, cyclically reading target data corresponding to the address information in the target chip according to a preset period, and storing a plurality of target data cyclically read.
[0037] Step S3, receiving a read instruction from the host computer, and sending each stored target data to the host computer.
[0038] The preset period is smaller than the reading period of the host computer sending the reading instruction. The value range of the preset period can be set to 10 microseconds to 10 milliseconds, which can be adjusted according to the size of the DAPLink storage space.
[0039] Specifically, receiving address instructions, starting instructions, reading instructions and sending target data are all implemented through the USB interface.
[0040] See also Figure 4 Assume that the host computer reads data in a 1ms cycle, that is, the reading period is 1ms. At this time, DAPLink reads the target data of the target chip in a preset period of 100us. When DAPLink receives the read instruction, it returns 10 packets of target data read in 1ms at one time, thereby achieving a data sampling accuracy of 100us.
[0041] The above embodiment provides a data transmission method based on DAPLink. After storing the address information sent by the host computer, the target data corresponding to the address information in the target chip is cyclically read according to a preset period. Since the preset period is smaller than the reading period of the read instruction sent by the host computer, when responding to the read instruction, the read multiple target data can be sent to the host computer, thereby improving the data sampling accuracy.
[0042] In some embodiments, the method further comprises:
[0043] After each target data is sent to the host computer, the stored target data is deleted.
[0044] Specifically, in order to avoid repeatedly sending old data, the stored target data is cleared after the target data is sent. This not only avoids the mistaken sending of old target data, but also reduces the storage pressure of DAPLink.
[0045] Furthermore, the method further comprises:
[0046] After reading the target data, it enters a dormant state until the next read or until a read instruction is received.
[0047] In fact, although cyclically reading the target data can improve data accuracy, it inevitably increases the operating power consumption of DAPLink. Therefore, if the preset cycle is 1ms and it takes 500us to read the target data, the remaining 500us will enter the sleep state, that is, the low power consumption state of DAPLink (DAPLink master chip supports low power consumption mode).
[0048] Furthermore, the operating main frequency when reading and sending each target data can be adjusted from 192 MHz to 168 MHz, thereby improving the data sampling accuracy while reducing the required power consumption.
[0049] See also Figure 5 Another embodiment of the present application provides a data transmission device based on DAPLink, which is applied to DAPLink, and DAPLink is respectively connected to a host computer and a target chip; the device includes:
[0050] The address module 101 is used to receive the address instruction from the host computer and store the address information in the address instruction.
[0051] The reading module 102 is used to receive a start instruction from a host computer, cyclically read target data corresponding to address information in a target chip according to a preset period, and store a plurality of target data cyclically read.
[0052] The sending module 103 is used to receive a read instruction from a host computer and send each stored target data to the host computer.
[0053] The preset period is smaller than the reading period of the reading instruction sent by the host computer.
[0054] In some embodiments, the device further includes a deletion module 104 for deleting each stored target data after sending each target data to the host computer.
[0055] In some embodiments, the device further includes a sleep module 105 for entering a sleep state after reading the target data until the next reading or receiving a read instruction.
[0056] The specific limitations of a data transmission device based on DAPLink provided in this embodiment can be found in the above embodiment of a data transmission method based on DAPLink, which will not be repeated here. Each module in the above-mentioned data transmission device based on DAPLink can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0057] An embodiment of the present application provides a computer device, which may include a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the processor executes the steps of a data transmission method based on DAPLink as in any of the above embodiments.
[0058] The working process, working details and technical effects of the computer device provided in this embodiment can be found in the above embodiment of a data transmission method based on DAPLink, which will not be repeated here.
[0059] The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor, the steps of a data transmission method based on DAPLink as in any of the above embodiments are implemented. Wherein, the computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive and / or a memory stick (Memory Stick), etc., and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The working process, working details and technical effects of the computer-readable storage medium provided in this embodiment can be referred to the embodiment of a data transmission method based on DAPLink above, and will not be repeated here. A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program, when executed, may include the processes of the embodiments of the above-mentioned methods. Wherein, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SynchLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0060] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0061] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A data transmission method based on DAPLink, characterized in that: Applied in DAPLink, the DAPLink is connected to a host computer and a target chip respectively; the method comprises: Receiving the address instruction from the host computer, and storing the address information in the address instruction; Receive a start instruction from the host computer, cyclically read the target data corresponding to the address information in the target chip according to a preset period, and store a plurality of the target data cyclically read; Receiving a read instruction from the host computer, and sending each of the stored target data to the host computer; The preset period is smaller than the reading period at which the host computer sends the reading instruction.
2. The DAPLink-based data transmission method according to claim 1, characterized in that: Also includes: After sending each of the target data to the host computer, the stored each of the target data is deleted.
3. The DAPLink-based data transmission method according to claim 1, characterized in that: Also includes: After reading the target data, the system enters a dormant state until the next reading or receipt of the read instruction.
4. The DAPLink-based data transmission method according to claim 1, characterized in that: The preset period ranges from 10 microseconds to 10 milliseconds.
5. The DAPLink-based data transmission method according to claim 1, characterized in that: The operating main frequency when reading and sending each of the target data is 168 MHz.
6. A data transmission device based on DAPLink, characterized in that: Applied in DAPLink, the DAPLink is connected to the host computer and the target chip respectively; the device comprises: An address module, used for receiving an address instruction from the host computer and storing the address information in the address instruction; A reading module, used for receiving a start instruction from the host computer, cyclically reading target data corresponding to the address information in the target chip according to a preset period, and storing a plurality of target data cyclically read; A sending module, used for receiving a read instruction from the host computer, and sending each of the stored target data to the host computer; The preset period is smaller than the reading period at which the host computer sends the reading instruction.
7. The DAPLink-based data transmission device according to claim 6, characterized in that: It also includes a deletion module, which is used to delete the stored target data after sending the target data to the host computer.
8. The DAPLink-based data transmission device according to claim 6, characterized in that: It also includes a sleep module, which is used to enter a sleep state after reading the target data until the next reading or receiving the read instruction.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the DAPLink-based data transmission method as claimed in any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the DAPLink-based data transmission method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
On-chip logic analyzer and chip debugging method
CN112634801A
Information reading method and device, electronic equipment and storage medium
CN116048410A
Sampling configuration circuit, sampling circuit, chip, equipment and configuration method
CN116841217A
Single-chip microcomputer on-line debugging system suitable for multiple kernels
CN117172018A
Acceleration unit, storage control chip, solid state disk and data reading method
CN117270771A
Cited By
Reading control method, device, chip and system of communication interface
CN120067023A
