A multi-core synchronization debugging tool
By designing a multi-core synchronous debugging tool and utilizing a USB-HUB expansion module and microcontroller conversion protocol, it is possible to debug multi-core MCUs using only a USB data cable. This solves the problems of high development cost and inconvenient debugging in existing technologies, and achieves high efficiency and accuracy in multi-core synchronous debugging.
Patent Information
- Application Number
- CN202310488882.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-11-30
- Filing Date
- 2023-04-27
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2043-04-27
AI Technical Summary
Existing technologies require two sets of debugging tools to debug multi-core MCUs simultaneously, and additionally require USB serial port tools and data cables, resulting in high development costs and inconvenience in use. Furthermore, ordinary debugging tools cannot stop and run multiple cores at the same time, affecting task execution.
Design a multi-core synchronous debugging tool, which includes a linear regulated power supply module, a USB expansion module, a first microcontroller, a second microcontroller, and a USB to serial port module. It connects to a computer via a USB data cable and is expanded to four channels using a USB-HUB to achieve multi-core synchronous debugging. Only one USB data cable is needed, and it integrates two virtual serial ports and one physical serial port.
It enables multi-core synchronous debugging, reduces development costs, improves ease of use, ensures the timeliness and accuracy of debugging information, and can stop or start multiple kernels at the same time to restore the normal operating environment of the system to the greatest extent.
Smart Images

Figure CN116501561B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a chip debugging tool, and more particularly to a multi-core synchronous debugging tool. Background Technology
[0002] In general-purpose MCUs in the consumer electronics field, some MCUs adopt dual-core or even multi-core chip architectures. When system application engineers use this chip development solution, they may need to debug multiple cores of the MCU at the same time, control multiple cores to run and stop at the same time, and then find and fix bugs.
[0003] Taking a multi-core general-purpose MCU as an example, this MCU contains two ARM-CM33 cores, which share a single debugging platform (TAP). It also includes an ARM-CM0 core, which uses a separate TAP for debugging. During the MCU's startup phase, the built-in bootloader initializes the MCU's USB and UART interfaces, receiving and executing external commands through these interfaces, such as erasing the MCU's internal Flash, programming the Flash-info area, and reading / writing registers. If we need to use this MCU for application development to implement a system application with USB-to-UART functionality (the computer connects to the MCU via USB, sends data from the computer, and the MCU receives the data via USB and forwards it via UART), then the system architecture might be: the first CM33 core runs the operating system and is responsible for task scheduling; the second CM33 core handles the USB-to-UART function; and the third CM0 core is responsible for auxiliary control. To develop this solution, the required debugging tools are: an ARM core debugging tool connected to two CM33 cores via a TAP; another ARM core debugging tool connected to the CM0 core via another TAP; a USB serial port tool connected to the computer and the MCU-Uart for communication; and a USB data cable connected to the computer and the MCU-USB for communication.
[0004] Developing the above solution using existing technology requires two sets of debugging tools to perform multi-core debugging simultaneously, and also requires additional USB serial port tools and USB data cables for assistance, which takes up a lot of computer USB ports, resulting in high development costs and great inconvenience in use.
[0005] Furthermore, in certain special cases, such as when two cores on a chip or two independent MCUs are performing closely coupled tasks, stopping either core will affect the execution of the other core. Moreover, ordinary debugging tools cannot simultaneously stop and run two cores. Summary of the Invention
[0006] Purpose of the invention: The technical problem to be solved by the present invention is to provide a multi-core synchronous debugging tool to address the shortcomings of the existing technology.
[0007] To address the aforementioned technical problems, this invention discloses a multi-core synchronous debugging tool, comprising: a linear regulated power supply module, a USB expansion module, a first microcontroller, a second microcontroller, and a USB-to-serial port module;
[0008] Among them, the linear voltage regulator module, namely LDO, includes a linear voltage regulator chip that converts the 5V DC voltage input from the USB into a 3.3V DC voltage.
[0009] A USB expansion module, also known as a USB-HUB, includes a USB expansion chip that expands one USB data path into four USB data paths.
[0010] The first microcontroller, MCU1, converts the USB protocol to the SWD protocol and creates a virtual serial port.
[0011] The second microcontroller, MCU2, converts the USB protocol to the SWD protocol and creates a virtual second serial port.
[0012] A USB-to-serial module, also known as a USB-UART, includes a USB-to-serial chip that converts USB to serial port.
[0013] The debugging computer is connected to the multi-core synchronous debugging tool via a USB data cable; the linear regulated power supply module converts the 5V DC voltage input from the USB data cable to 3.3V DC voltage, powering the first microcontroller, the second microcontroller, and the USB-to-serial module; simultaneously, the USB expansion module starts working, expanding the input USB data path into 4 outputs, which are respectively connected to the first microcontroller, the second microcontroller, and the USB-to-serial module; the first microcontroller and the second microcontroller are connected to the two microcontrollers in the chip under debugging via data cables; the USB-to-serial module is connected to the two microcontrollers in the chip under debugging via data cables.
[0014] The method for debugging the target MCU (microcontroller) in the chip to be debugged using the multi-core synchronous debugging tool includes the following steps:
[0015] Step 1: Connect the tool to the debugging computer using a USB data cable;
[0016] Step 2: Connect the two microcontrollers in the chip to be debugged using a data cable;
[0017] Step 3: Issue a command to put both microcontrollers into debug mode and run at full speed;
[0018] Step 4: Simultaneously stop both microcontrollers;
[0019] Step 5: Collect debugging information on the computer;
[0020] Step 6: Simultaneously start the two microcontrollers;
[0021] Step 7: Repeat steps 4-6 until debugging is complete.
[0022] Beneficial effects:
[0023] It can debug multiple kernels simultaneously, integrating two virtual serial ports, one physical serial port, and a USB data channel, making it flexible and convenient to use. It features multi-core synchronous run or stop functionality, ensuring that tasks executed collaboratively by two kernels are not interrupted. This maximizes the restoration of the system's normal operating environment, guaranteeing the timeliness and accuracy of debug information, and thus enabling rapid problem resolution.
[0024] In terms of circuit design, the use of a USB-HUB chip allows the tool to perform various functions by connecting to a computer via a single USB data cable, making it very convenient to use. In addition, a dedicated synchronization circuit is designed for the synchronous operation and shutdown of the two cores, thereby enabling dual-core synchronous debugging. Attached Figure Description
[0025] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, and the advantages of the present invention in the above and / or other aspects will become clearer.
[0026] Figure 1 This is a schematic diagram of the overall scheme of the present invention.
[0027] Figure 2 (a) is a schematic diagram of the overall structure of the present invention.
[0028] Figure 2 (b) is a schematic diagram of the first microcontroller module.
[0029] Figure 2 (c) is a schematic diagram of a USB expansion module.
[0030] Figure 2 (d) shows the intent of the USB to serial port module.
[0031] Figure 2 (e) is a schematic diagram of a linear regulated power supply module.
[0032] Figure 3 This is a schematic diagram of the process of the present invention.
[0033] Figure 4 This is a schematic diagram of CMSIS-DAP. Detailed Implementation
[0034] like Figure 1 As shown, a multi-core synchronous debugging tool includes: a linear regulated power supply module, a USB expansion module, a first microcontroller, a second microcontroller, and a USB to serial port module;
[0035] Among them, the linear voltage regulator module, namely LDO, includes a linear voltage regulator chip that converts the 5V DC voltage input from the USB into a 3.3V DC voltage.
[0036] A USB expansion module, also known as a USB-HUB, includes a USB expansion chip that expands one USB data path into four USB data paths.
[0037] The first microcontroller, MCU1, converts the USB protocol to the SWD protocol and creates a virtual serial port.
[0038] The second microcontroller, MCU2, converts the USB protocol to the SWD protocol and creates a virtual second serial port.
[0039] A USB-to-serial module, also known as a USB-UART, includes a USB-to-serial chip that converts USB to serial port.
[0040] The debugging computer is connected to the multi-core synchronous debugging tool via a USB data cable; the linear regulated power supply module converts the 5V DC voltage input from the USB data cable to 3.3V DC voltage, powering the first microcontroller, the second microcontroller, and the USB-to-serial module; simultaneously, the USB expansion module starts working, expanding the input USB data path into 4 outputs, which are respectively connected to the first microcontroller, the second microcontroller, and the USB-to-serial module; the first microcontroller and the second microcontroller are connected to the two microcontrollers in the chip under debugging via data cables; the USB-to-serial module is connected to the two microcontrollers in the chip under debugging via data cables.
[0041] like Figure 2 As shown in (e), the linear regulated power supply module includes: a linear regulated power supply chip U5, a first capacitor C40, a second capacitor C41, a third capacitor C42, and a fourth capacitor C43.
[0042] In this configuration, pin 1 of the linear voltage regulator chip is connected to one end of the first capacitor C40, the second capacitor C41, the third capacitor C42, and the fourth capacitor C43. The other ends of the first capacitor C40 and the second capacitor C41 are connected to pin 3 of the linear voltage regulator chip, and the other ends of the third capacitor C42 and the fourth capacitor C43 are connected to pin 2 of the linear voltage regulator chip.
[0043] like Figure 2As shown in (c), the USB expansion module includes: a USB-HUB chip U1, a first resistor R31, a second resistor R32, a third resistor R33, a fourth resistor R34, a fifth resistor R35, a sixth resistor R36 and a seventh resistor R37, a fifth capacitor C31, a sixth capacitor C32, a seventh capacitor C33 and an eighth capacitor C34, a first inductor LB4, a first light-emitting diode USB_LED, and a first passive crystal oscillator X3;
[0044] Specifically, pin 1 of the USB-HUB chip is connected to one end of the first inductor LB4, and the other end of the first inductor LB4 is connected to pin 24 of the USB-HUB chip; pin 2 of the USB-HUB chip is connected to pin 2 of the USB-Uart chip in the USB-to-serial module; pin 3 of the USB-HUB chip is connected to pin 1 of the USB-Uart chip in the USB-to-serial module; pin 4 of the USB-HUB chip is connected to one end of the first resistor R31, and the other end of the first resistor R31 is connected to pin 15 of the USB-HUB chip; pin 5 of the USB-HUB chip is connected to one end of the first inductor LB4, and the other end of the first inductor LB4 is connected to pin 24 of the USB-HUB chip; pin 5 of the USB-HUB chip is connected to one end of the first inductor LB4, and the other end of the first inductor LB4 is connected to pin 24 of the USB-HUB chip; pin 2 of the USB-HUB chip is connected to pin 2 of the USB-Uart chip in the USB-to-serial module; pin 3 of the USB-HUB chip is connected to pin 1 of the USB-Uart chip in the USB-serial module; pin 4 of the USB-HUB chip is connected to one end of the first resistor R31, and the other end of the first resistor R31 is connected to pin 15 of the USB-HUB chip; pin 5 of the USB-HUB chip is connected to one end of the first inductor LB4, and the other end of the first inductor LB4 is connected to pin 24 ...2 of the USB-HUB chip is connected to pin 2 The other end of pin 4 is connected to pin 24 of the USB-HUB chip; pin 6 of the USB-HUB chip is connected to pin 3 of the first passive crystal oscillator X3 and one end of the fifth capacitor C31, the other end of the fifth capacitor C31 is connected to pin 15 of the USB-HUB chip; pin 7 of the USB-HUB chip is connected to pin 1 of the first passive crystal oscillator X3 and one end of the sixth capacitor C32, the other end of the sixth capacitor C32 is connected to pin 15 of the USB-HUB chip; pin 8 of the USB-HUB chip is connected to the USB_DM pin of the chip to be debugged; pin 9 of the USB-HUB chip is connected to the USB_DP pin of the chip to be debugged; USB-HU Pin 10 of chip B is connected to one end of the first inductor LB4, and the other end of the first inductor LB4 is connected to pin 24 of the USB-HUB chip; pin 11 of the USB-HUB chip is connected to pin 35 of the second microcontroller chip M0 in the second microcontroller module; pin 12 of the USB-HUB chip is connected to pin 36 of the second microcontroller chip M0 in the second microcontroller module; pin 13 of the USB-HUB chip is connected to one end of the seventh capacitor C33, and the other end of the seventh capacitor C33 is connected to pin 15 of the USB-HUB chip; pin 13 of the USB-HUB chip is connected to one end of the second resistor R32, and the second resistor R32... The other end is connected to pin 15 of the USB-HUB chip; pin 13 of the USB-HUB chip is connected to one end of the third resistor R33, and the other end of the third resistor R33 is connected to pin 23 of the USB-HUB chip; pin 15 of the USB-HUB chip is connected to one end of the eighth capacitor C34, and the other end of the eighth capacitor C34 is connected to pin 16 of the USB-HUB chip; pin 16 of the USB-HUB chip is connected to pins 17 and 24 of the USB-HUB chip; pin 18 of the USB-HUB chip is connected to one end of the sixth resistor R36, and the other end of the sixth resistor R36 is connected to pin 24 of the USB-HUB chip.Pin 18 of the USB-HUB chip is connected to the negative terminal of the first LED (USB_LED). The positive terminal of the first LED (USB_LED) is connected to one end of the seventh resistor R37, and the other end of the seventh resistor R37 is connected to pin 24 of the USB-HUB chip. Pin 21 of the USB-HUB chip is connected to one end of the fifth resistor (R35), and the other end of the fifth resistor R35 is connected to pin 15 of the USB-HUB chip. Pin 21 of the USB-HUB chip is connected to one end of the fourth resistor R34, and the other end of the fourth resistor R34 is connected to pin 23 of the USB-HUB chip. Pin 25 of the USB-HUB chip is connected to the DM data line of the USB port of the debugging computer. Pin 26 of the USB-HUB chip is connected to the DP data line of the USB port of the debugging computer. Pin 27 of the USB-HUB chip is connected to pin 35 of the first microcontroller chip M33 in the first microcontroller module. Pin 28 of the USB-HUB chip is connected to pin 36 of the first microcontroller chip M33 in the first microcontroller module.
[0045] like Figure 2 As shown in (d), the USB to serial port module includes: USB-Uart chip U2, eighth resistor R45 and ninth resistor R46, twelfth capacitor C37 and thirteenth capacitor C38, second light-emitting diode TX_LED and third light-emitting diode RX_LED;
[0046] Specifically, pin 1 of the USB-Uart chip is connected to pin 3 of the USB-HUB chip in the USB expansion module; pin 2 of the USB-Uart chip is also connected to pin 2 of the USB-HUB chip in the USB expansion module; pin 3 of the USB-Uart chip is connected to one end of the twelfth capacitor C37, and the other end of the twelfth capacitor C37 is connected to pin 10 of the USB-Uart chip; pin 7 of the USB-Uart chip is connected to one end of the thirteenth capacitor C38, and the other end of the thirteenth capacitor C38 is connected to pin 3 of the USB-Uart chip; pin 8 of the USB-Uart chip is connected to the second light-emitting diode. The negative terminal of the second LED (TX_LED) is connected to the first terminal. The positive terminal of the second LED (TX_LED) is connected to one end of the eighth resistor R45, and the other end of the eighth resistor R45 is connected to pin 10 of the USB-Uart chip. Pin 9 of the USB-Uart chip is connected to the negative terminal of the third LED (RX_LED). The positive terminal of the third LED (RX_LED) is connected to one end of the ninth resistor R46, and the other end of the ninth resistor R46 is connected to pin 10 of the USB-Uart chip. Pin 10 of the USB-Uart chip is connected to one end of the twelfth capacitor C37, and the other end of the twelfth capacitor C37 is connected to pin 3 of the USB-Uart chip.
[0047] like Figure 2 As shown in (b), the first microcontroller module includes: a first microcontroller chip M33, tenth resistor R1, eleventh resistor R2, twelfth resistor R3, thirteenth resistor R9, fourteenth resistor R10 and fifteenth resistor R7, fourteenth capacitor C1, fifteenth capacitor C2, sixteenth capacitor C3, seventeenth capacitor C4, eighteenth capacitor C5, nineteenth capacitor C6, twentieth capacitor C7, twenty-first capacitor C8 and twenty-second capacitor C9, a fourth light-emitting diode DAP33_LED, and a second passive crystal oscillator X1;
[0048] Specifically, pin 1 of the first microcontroller chip M33 is connected to one end of the fourteenth capacitor C1 and the fifteenth capacitor C2, and the other end of the fourteenth capacitor C1 and the fifteenth capacitor C2 is connected to pin 0 of the first microcontroller chip M33; pin 2 of the first microcontroller chip M33 is connected to one end of the tenth resistor R1, and the other end of the tenth resistor R1 is connected to the SWD_CLK pin of the chip under test; pin 3 of the first microcontroller chip M33 is connected to one end of the eleventh resistor R2, and the other end of the eleventh resistor R2 is connected to the SWD_DIO pin of the chip under test; pin 4 of the first microcontroller chip M33 is connected to one end of the twelfth resistor R3, and the other end of the twelfth resistor R3 is connected to the SWD_DIO pin of the chip under test. The DIO pins are connected as follows: Pin 6 of the first microcontroller chip M33 is connected to pin 3 of the second passive crystal oscillator X1 and one end of the sixteenth capacitor C3; the other end of the sixteenth capacitor C3 is connected to pin 0 of the first microcontroller chip M33; Pin 7 of the first microcontroller chip M33 is connected to pin 1 of the second passive crystal oscillator X1 and one end of the seventeenth capacitor C4; the other end of the seventeenth capacitor C4 is connected to pin 0 of the first microcontroller chip M33; Pin 8 of the first microcontroller chip M33 is connected to one end of the eighteenth capacitor C5; the other end of the eighteenth capacitor C5 is connected to pin 0 of the first microcontroller chip M33; Pin 9 of the first microcontroller chip M33 is connected to the nineteenth capacitor C6 and the twentieth capacitor C7. One end of the capacitor is connected, and the other end of the nineteenth capacitor C6 and the twentieth capacitor C7 is connected to pin 0 of the first microcontroller chip M33; pin 12 of the first microcontroller chip M33 is connected to the TXD data line of the first virtual serial port; pin 13 of the first microcontroller chip M33 is connected to the RXD data line of the first virtual serial port; pin 16 of the first microcontroller chip M33 is connected to pin 16 of the second microcontroller chip M0 in the second microcontroller module; pin 17 of the first microcontroller chip M33 is connected to pin 17 of the second microcontroller chip M0 in the second microcontroller module; pin 20 of the first microcontroller chip M33 is connected to one end of the fifteenth resistor R7, and the other end of the fifteenth resistor R7 is connected to... Connect pin 0 of the first microcontroller chip M33; connect pin 23 of the first microcontroller chip M33 to one end of the twenty-first capacitor C8 and the twenty-second capacitor C9, and connect the other end of the twenty-first capacitor C8 and the twenty-second capacitor C9 to pin 0 of the first microcontroller chip M33; connect pin 35 of the first microcontroller chip M33 to pin 27 of the USB-HUB chip in the USB expansion module; connect pin 36 of the first microcontroller chip M33 to pin 28 of the USB-HUB chip in the USB expansion module; connect pin 45 of the first microcontroller chip M33 to one end of the thirteenth resistor R9, and connect the other end of the thirteenth resistor R9 to pin 0 of the first microcontroller chip M33;Pin 48 of the first microcontroller chip M33 is connected to one end of the fourteenth resistor R10. The other end of the fourteenth resistor R10 is connected to the positive terminal of the fourth LED DAP33_LED. The negative terminal of the fourth LED DAP33_LED is connected to pin 0 of the first microcontroller chip M33.
[0049] The second microcontroller module includes: a second microcontroller chip M0, a seventeenth resistor R11, an eighteenth resistor R12, a nineteenth resistor R13, a twentieth resistor R19, a twenty-first resistor R20, a twenty-second resistor R17, a twenty-third capacitor C11, a twenty-fourth capacitor C12, a twenty-fifth capacitor C13, a twenty-sixth capacitor C14, a twenty-seventh capacitor C15, a twenty-eighth capacitor C16, a twenty-ninth capacitor C17, a thirtieth capacitor C18, and a thirty-first capacitor C19, a fifth light-emitting diode DAPMO_LED, and a third passive crystal oscillator X2;
[0050] Specifically, pin 1 of the second microcontroller chip M0 is connected to one end of the twenty-third capacitor C11 and the twenty-fourth capacitor C12, and the other end of the twenty-third capacitor C11 and the twenty-fourth capacitor C12 is connected to pin 0 of the second microcontroller chip M0; pin 2 of the second microcontroller chip M0 is connected to one end of the seventeenth resistor R11, and the other end of the seventeenth resistor R11 is connected to the SWD_CLK pin of the chip under test; pin 3 of the second microcontroller chip M0 is connected to one end of the eighteenth resistor R12, and the other end of the eighteenth resistor R12 is connected to the SWD_DIO pin of the chip under test; pin 4 of the second microcontroller chip M0 is connected to one end of the nineteenth resistor R13, and the tenth... The other end of resistor R13 is connected to the SWD_DIO pin of the chip to be debugged; pin 6 of the second microcontroller chip M0 is connected to pin 3 of the third passive crystal oscillator X2 and one end of capacitor C13 (the 25th capacitor), with the other end of capacitor C13 connected to pin 0 of the second microcontroller chip M0; pin 7 of the second microcontroller chip M0 is connected to pin 1 of the third passive crystal oscillator X2 and one end of capacitor C14 (the 26th capacitor), with the other end of capacitor C14 connected to pin 0 of the second microcontroller chip M0; pin 8 of the second microcontroller chip M0 is connected to one end of capacitor C15 (the 27th capacitor), with the other end of capacitor C15 connected to pin 0 of the second microcontroller chip M0. Pin 10; Pin 9 of the second microcontroller chip M0 is connected to one end of capacitors C16 (28th) and C17 (29th), and the other end of capacitors C16 and C17 is connected to pin 0 of the second microcontroller chip M0; Pin 12 of the second microcontroller chip M0 is connected to the TXD data line of the second virtual serial port; Pin 13 of the second microcontroller chip M0 is connected to the RXD data line of the second virtual serial port; Pin 16 of the second microcontroller chip M0 is connected to pin 16 of the first microcontroller chip M33 in the first microcontroller module; Pin 17 of the second microcontroller chip M0 is connected to pin 17 of the first microcontroller chip M33 in the first microcontroller module. Pin 1 is connected to pin 20 of the second microcontroller chip M0; pin 20 of the second microcontroller chip M0 is connected to one end of the twenty-second resistor R17, and the other end of the twenty-second resistor R17 is connected to pin 0 of the second microcontroller chip M0; pin 23 of the second microcontroller chip M0 is connected to one end of the thirtieth capacitor C18 and the thirty-first capacitor C19, and the other end of the thirtieth capacitor C18 and the thirty-first capacitor C19 is connected to pin 0 of the second microcontroller chip M0; pin 35 of the second microcontroller chip M0 is connected to pin 11 of the USB-HUB chip in the USB expansion module; pin 36 of the second microcontroller chip M0 is connected to pin 12 of the USB-HUB chip in the USB expansion module.Pin 45 of the second microcontroller chip M0 is connected to one end of the twentieth resistor R19, and the other end of the twentieth resistor R19 is connected to pin 0 of the second microcontroller chip M0; pin 48 of the second microcontroller chip M0 is connected to one end of the twenty-first resistor R20, and the other end of the twenty-first resistor R20 is connected to the positive terminal of the fifth LED DAPM0_LED, and the negative terminal of the fifth LED DAPM0_LED is connected to pin 0 of the second microcontroller chip M0.
[0051] like Figure 3 As shown, the method for debugging the microcontroller in the target MCU (microcontroller unit) chip to be debugged using the tool includes the following steps:
[0052] Step 1: Connect the tool to the debugging computer using a USB data cable;
[0053] Step 2: Connect the two microcontrollers in the chip to be debugged using a data cable;
[0054] Step 3: Issue a command to put both microcontrollers into debug mode and run at full speed;
[0055] Step 4: Simultaneously stop both microcontrollers;
[0056] Step 5: Collect debugging information on the computer;
[0057] Step 6: Simultaneously start the two microcontrollers;
[0058] Step 7: Repeat steps 4-6 until debugging is complete.
[0059] The specific steps for synchronously stopping the two microcontrollers in step 4 include:
[0060] Step 4-1: Configure a program breakpoint for the first microcontroller being debugged or manually send a command to stop running.
[0061] Step 4-2: When the first microcontroller enters the program breakpoint or a command to stop running is manually sent, send a stop running command;
[0062] Step 4-3: The CMSIS_DAP thread running in MCU1 detects the stop command and controls GPIO1 to output a low level. GPIO1 is an I / O output port of MCU1, which is connected to an I / O input port of MCU2. When MCU1 controls this I / O port to output a low level, since it is also connected to the I / O port of MCU2, MCU2 can know that MCU1 controls GPIO1 to output a low level, which plays a simple communication role.
[0063] Step 4-4: The CMSIS_DAP thread running in MCU1 sends a stop command to the first microcontroller being debugged through the DAP standard protocol. The first microcontroller being debugged stops running after receiving the stop command.
[0064] In steps 4-5, the GPIO1 input interrupt thread running in MCU2 detects that the input level of GPIO1 is low, and then controls GPIO2 to output a low level; GPIO2 is an I / O output port of MCU2, which is connected to an I / O input port of MCU1.
[0065] Steps 4-6: Send a stop command to the second microcontroller being debugged via the DAP standard protocol. The second microcontroller being debugged will also stop running after receiving the stop command.
[0066] The specific steps for synchronously starting the two microcontrollers in step 6 include:
[0067] Step 6-1: Send a start command to the first microcontroller being debugged;
[0068] Step 6-2: The CMSIS_DAP thread running in MCU1 detects that the command sent by the host computer is a start command, and then controls GPIO1 to output a high level.
[0069] Step 6-3: The CMSIS_DAP thread running in MCU1 sends a start command to the first microcontroller being debugged through the DAP standard protocol. The first microcontroller being debugged starts running after receiving the start command.
[0070] Step 6-4: The GPIO1 input interrupt thread running in MCU2 detects that the input level of GPIO1 is high, and then controls GPIO2 to output a high level.
[0071] Step 6-5: Send a start command to the second microcontroller being debugged via the DAP standard protocol. The second microcontroller being debugged will also start running after receiving the start command.
[0072] In the methods of steps 4 and 6:
[0073] MCU1 and MCU2 use the CMSIS_DAP thread to detect stop or start commands and control the two microcontrollers being debugged. The CMSIS_DAP thread is primarily responsible for communicating with the host computer on the PC. When the device is connected to the computer, the CMSIS_DAP thread begins operation, establishing a communication connection with the host computer via a USB interface. When the host computer sends various commands required for debugging, the CMSIS_DAP thread first receives these commands via USB and then forwards them to the MCU being debugged according to the standard JTAG / SWD protocol. When the MCU receives the command and responds, the CMSIS_DAP thread can also send the feedback information to the host computer via USB.
[0074] Example:
[0075] A solution for a multi-core synchronous debugging tool includes:
[0076] 1. LDO: Linear Regulated Power Supply Chip, its function is to convert the 5V DC voltage input from USB to 3.3V DC voltage.
[0077] 2. USB-HUB: A USB expansion chip that converts one USB data path into four USB data paths.
[0078] 3. MCU1: Microcontroller 1, whose function is to convert the USB protocol to the SWD protocol and to create a virtual serial port.
[0079] 4. MCU2: Same as MCU1.
[0080] 5. USB-UART: USB to serial chip, its function is to convert USB to serial port.
[0081] like Figure 2 As shown in (a), the hardware schematic is as follows:
[0082] Working principle overview:
[0083] When the debugging tool is connected to the computer and the target MCU using a USB data cable, the LDO converts the 5V DC voltage input from the USB to 3.3V DC voltage to supply the three modules: MCU1, MCU2, and USB-UART. Simultaneously, the USB-HUB also starts working, converting one USB port into four USB ports. After MCU1 starts up, it establishes a communication link with the computer through the first USB port converted by the USB-HUB. At this point, the computer can see a CMSIS-DAP device and a virtual serial port device successfully connected. When the user sends debugging commands through the debugging software, MCU1 receives the commands and establishes a communication link with the SWD interface of the MCU under test through the CLK and DIO data lines, thus enabling debugging. In addition, MCU1 also receives serial port data sent by the user through the USB link and sends the data to the MCU in real time through the TXD and RXD data lines. MCU2 has the same function as MCU1, and because it uses the second USB port converted by the USB-HUB, it is independent of MCU1 and does not interfere with it, thus supporting multi-core, multi-threaded debugging simultaneously. When the USB-UART starts working, it establishes a communication link with the computer through the third USB port converted by the USB-HUB. It receives serial data sent by the user through this USB link and transmits the data to the MCU in real time via the TXD and RXD data lines. The difference between this physical serial port and the virtual serial port created by MCU1 / MCU2 is that it cannot be closed. The target MCU can establish a communication link with the computer through the fourth USB port converted by the USB-HUB.
[0084] like Figure 3 The software flowchart is shown below:
[0085] Overview of synchronization principles:
[0086] When MCU1 receives a stop command from the debugging host computer via USB, it sends a command to the kernel being debugged by MCU1 via the CMSIS-DAP protocol to enter the HALT state. At the same time, it controls GPIO1 to output a low level. Since GPIO1 is connected to the MCU2's I / O, MCU2 can immediately detect the low level output of GPIO1 and enter the interrupt routine. The interrupt routine sends a command to the kernel being debugged by MCU2 via the CMSIS-DAP protocol to also enter the HALT state and stop running. When MCU1 receives a start command from the debugging host computer via USB, it sends a command to the kernel being debugged by MCU1 via the CMSIS-DAP protocol to exit the HALT state. At the same time, it controls GPIO1 to output a high level. Since GPIO1 is connected to the MCU2's I / O, MCU2 can immediately detect the high level output of GPIO1 and enter the interrupt routine. The interrupt routine sends a command to the kernel being debugged by MCU2 via the CMSIS-DAP protocol to also exit the HALT state and start running the kernel.
[0087] Conversely, when MCU2 receives a stop or run command from the debugging host computer via USB, it will also output the corresponding high and low level states through GPIO2 to notify MCU1 to synchronously send the kernel's stop and run commands.
[0088] This achieves the function that if one kernel runs or stops, the other kernel will also run or stop synchronously.
[0089] How LDO converts DC voltage: Refer to the AMS1117 chip datasheet.
[0090] To see how a USB hub can convert one USB port to four USB ports, please refer to the GL850G chip datasheet.
[0091] How to convert USB to UART: Refer to the CH340x chip datasheet.
[0092] How to implement Debug core and Virtual UART in MCU1 / MCU2: Please refer to the CMSIS-DAP official website documentation: https: / / arm-software.github.io / CMSIS_5 / DAP / html / index.html.
[0093] like Figure 4 As shown, CMSIS-DAP:
[0094] CMSIS-DAP is the protocol specification and firmware implementation that supports access to the CoreSight Debug Access Port (DAP). Various Arm Cortex processors offer CoreSight debugging and tracing. CMSIS-DAP supports target devices containing one or more Cortex processors. Devices provide a Debug Access Port (DAP), typically with a 5-pin JTAG or a 2-pin Serial Wired Debug (SWD) interface connected to a debug unit. CMSIS-DAP is the interface firmware for connecting the debug port to a USB debug unit. A debugger running on the host connects to the device running application software via USB and the debug unit.
[0095] characteristic:
[0096] • Provides a standardized interface for debuggers. Offers interfaces with many standard debuggers.
[0097] • Access the CoreSight registers for all Cortex processor architectures (Cortex-A / R / M).
[0098] • Connect via 5-pin JTAG or 2-pin serial cable debugging (SWD).
[0099] • Supports multi-core debugging.
[0100] • Supports serial line output (SWO) for Cortex-M devices.
[0101] • Easy to deploy to debug units based on Cortex-M microcontrollers.
[0102] • The debugging unit can be integrated onto the evaluation board.
[0103] Using USB bulk transfers can avoid installing drivers on the host PC.
[0104] • Supports the execution of JTAG or SWD commands with strict time requirements.
[0105] • Supports test domain timers for time measurement using debug units.
[0106] • Supports UART communication port, which can be routed to USB COM port (optional) or local CMSIS-DAP commands (new in CMSIS-DAP version 2.1.0).
[0107] In its specific implementation, this application provides a computer storage medium and a corresponding data processing unit. The computer storage medium is capable of storing a computer program, which, when executed by the data processing unit, can run the invention content of a multi-core synchronous debugging tool provided by this invention, as well as some or all of the steps in various embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0108] Those skilled in the art will clearly understand that the technical solutions in the embodiments of the present invention can be implemented using computer programs and their corresponding general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of computer programs, i.e., software products. These computer program software products can be stored in a storage medium and include several instructions to cause a device containing a data processing unit (which may be a personal computer, server, microcontroller, MUU, or network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present invention.
[0109] This invention provides a concept and method for a multi-core synchronous debugging tool. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment of the invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.
Claims
1. A multi-core synchronization debugging tool, characterized by, The application relates to a multi-core synchronous debugging tool. The multi-core synchronous debugging tool comprises a linear voltage stabilizing power module, a USB extension module, a first microcontroller, a second microcontroller and a USB-to-serial module. The linear voltage stabilizing power module, namely LDO, comprises a linear voltage stabilizing power chip which converts 5V DC voltage input by the USB into 3.3V DC voltage. The USB extension module, namely USB-HUB, comprises a USB extension chip which expands one USB data channel into four USB data channels. The first microcontroller, namely MCU1, converts the USB protocol into the SWD protocol and virtually outputs a first virtual serial port. The second microcontroller, namely MCU2, converts the USB protocol into the SWD protocol and virtually outputs a second virtual serial port. The USB-to-serial module, namely USB-Uart, comprises a USB-to-serial chip which converts the USB into a serial port. The debugging computer is connected with the multi-core synchronous debugging tool through a USB data line; the linear voltage stabilizing power module converts 5V DC voltage input by the USB data line into 3.3V DC voltage to supply power to the first microcontroller, the second microcontroller and the USB-to-serial module; meanwhile, the USB extension module starts to work to expand the input USB data channel into four output channels which are connected with the first microcontroller, the second microcontroller and the USB-to-serial module respectively; the first microcontroller and the second microcontroller are connected with two microcontrollers in the chip to be debugged through data lines respectively; the USB-to-serial module is connected with the two microcontrollers in the chip to be debugged through a data line.
2. The multi-core synchronization debugging tool according to claim 1, wherein, The linear voltage stabilizing power module comprises a linear voltage stabilizing power chip, a first capacitor (C40), a second capacitor (C41), a third capacitor (C42) and a fourth capacitor (C43). The No.1 pin of the linear voltage stabilizing power chip is connected with one end of the first capacitor (C40), the second capacitor (C41), the third capacitor (C42) and the fourth capacitor (C43); the other end of the first capacitor (C40) and the second capacitor (C41) is connected with the No.3 pin of the linear voltage stabilizing power chip; the other end of the third capacitor (C42) and the fourth capacitor (C43) is connected with the No.2 pin of the linear voltage stabilizing power chip.
3. The multi-core synchronization debugging tool of claim 2, wherein, The USB extension module comprises a USB-HUB chip, a first resistor (R31), a second resistor (R32), a third resistor (R33), a fourth resistor (R34), a fifth resistor (R35), a sixth resistor (R36), a seventh resistor (R37), a fifth capacitor (C31), a sixth capacitor (C32), a seventh capacitor (C33), an eighth capacitor (C34), a first inductor (LB4), a first light emitting diode (USB_LED) and a first passive crystal oscillator (X3). The 1st pin of the USB-HUB chip is connected with one end of the first inductor (LB4), and the other end of the first inductor (LB4) is connected with the 24th pin of the USB-HUB chip; the 2nd pin of the USB-HUB chip is connected with the 2nd pin of the USB-Uart chip in the USB-to-serial module; the 3rd pin of the USB-HUB chip is connected with the 1st pin of the USB-Uart chip in the USB-to-serial module; the 4th pin of the USB-HUB chip is connected with one end of the first resistor (R31), and the other end of the first resistor (R31) is connected with the 15th pin of the USB-HUB chip; the 5th pin of the USB-HUB chip is connected with one end of the first inductor (LB4), and the other end of the first inductor (LB4) is connected with the 24th pin of the USB-HUB chip; the 6th pin of the USB-HUB chip is connected with the 3rd pin of the first passive crystal oscillator (X3) and one end of the fifth capacitor (C31), and the other end of the fifth capacitor (C31) is connected with the 15th pin of the USB-HUB chip; the 7th pin of the USB-HUB chip is connected with the 1st pin of the first passive crystal oscillator (X3) and one end of the sixth capacitor (C32), and the other end of the sixth capacitor (C32) is connected with the 15th pin of the USB-HUB chip; the 8th pin of the USB-HUB chip is connected with the USB_DM pin of the chip to be debugged; the 9th pin of the USB-HUB chip is connected with the USB_DP pin of the chip to be debugged; the 10th pin of the USB-HUB chip is connected with one end of the first inductor (LB4), and the other end of the first inductor (LB4) is connected with the 24th pin of the USB-HUB chip; the 11th pin of the USB-HUB chip is connected with the 35th pin of the second microcontroller chip (M0) in the second microcontroller module; the 12th pin of the USB-HUB chip is connected with the 36th pin of the second microcontroller chip (M0) in the second microcontroller module; the 13th pin of the USB-HUB chip is connected with one end of the seventh capacitor (C33), and the other end of the seventh capacitor (C33) is connected with the 15th pin of the USB-HUB chip; the 13th pin of the USB-HUB chip is connected with one end of the second resistor (R32), and the other end of the second resistor (R32) is connected with the 15th pin of the USB-HUB chip; the 13th pin of the USB-HUB chip is connected with one end of the third resistor (R33), and the other end of the third resistor (R33) is connected with the 23rd pin of the USB-HUB chip; the 15th pin of the USB-HUB chip is connected with one end of the eighth capacitor (C34), and the other end of the eighth capacitor (C34) is connected with the 16th pin of the USB-HUB chip; the 16th pin of the USB-HUB chip is connected with the 17th pin and the 24th pin of the USB-HUB chip; the 18th pin of the USB-HUB chip is connected with one end of the sixth resistor (R36), and the other end of the sixth resistor (R36) is connected with the 24th pin of the USB-HUB chip;The 18th pin of the USB-HUB chip is connected with the negative electrode of the first light emitting diode (USB_LED), the positive electrode of the first light emitting diode (USB_LED) is connected with one end of the seventh resistor (R37), the other end of the seventh resistor (R37) is connected with the 24th pin of the USB-HUB chip; the 21st pin of the USB-HUB chip is connected with one end of the fifth resistor (R35), the other end of the fifth resistor (R35) is connected with the 15th pin of the USB-HUB chip; the 21st pin of the USB-HUB chip is connected with one end of the fourth resistor (R34), the other end of the fourth resistor (R34) is connected with the 23rd pin of the USB-HUB chip; the 25th pin of the USB-HUB chip is connected with the DM data line of the USB port of the debugging computer; the 26th pin of the USB-HUB chip is connected with the DP data line of the USB port of the debugging computer; the 27th pin of the USB-HUB chip is connected with the 35th pin of the first microcontroller chip (M33) in the first microcontroller module; the 28th pin of the USB-HUB chip is connected with the 36th pin of the first microcontroller chip (M33) in the first microcontroller module.
4. The multi-core synchronization debugging tool of claim 3, wherein, The USB-to-serial module comprises a USB-Uart chip, an eighth resistor (R45) and a ninth resistor (R46), a twelfth capacitor (C37) and a thirteenth capacitor (C38), a second light emitting diode (TX_LED) and a third light emitting diode (RX_LED). The 1st pin of the USB-Uart chip is connected with the 3rd pin of the USB-HUB chip in the USB expansion module; the 2nd pin of the USB-Uart chip is connected with the 2nd pin of the USB-HUB chip in the USB expansion module; the 3rd pin of the USB-Uart chip is connected with one end of the twelfth capacitor (C37), and the other end of the twelfth capacitor (C37) is connected with the 10th pin of the USB-Uart chip; the 7th pin of the USB-Uart chip is connected with one end of the thirteenth capacitor (C38), and the other end of the thirteenth capacitor (C38) is connected with the 3rd pin of the USB-Uart chip; the 8th pin of the USB-Uart chip is connected with the negative electrode of the second light-emitting diode (TX_LED), the positive electrode of the second light-emitting diode (TX_LED) is connected with one end of the eighth resistor (R45), and the other end of the eighth resistor (R45) is connected with the 10th pin of the USB-Uart chip; the 9th pin of the USB-Uart chip is connected with the negative electrode of the third light-emitting diode (RX_LED), the positive electrode of the third light-emitting diode (RX_LED) is connected with one end of the ninth resistor (R46), and the other end of the ninth resistor (R46) is connected with the 10th pin of the USB-Uart chip; the 10th pin of the USB-Uart chip is connected with one end of the twelfth capacitor (C37), and the other end of the twelfth capacitor (C37) is connected with the 3rd pin of the USB-Uart chip.
5. The multi-core synchronization debugging tool of claim 4, wherein, The first microcontroller module comprises a first microcontroller chip (M33), a tenth resistor (R1), an eleventh resistor (R2), a twelfth resistor (R3), a thirteenth resistor (R9), a fourteenth resistor (R10), a fifteenth resistor (R7), a fourteenth capacitor (C1), a fifteenth capacitor (C2), a sixteenth capacitor (C3), a seventeenth capacitor (C4), an eighteenth capacitor (C5), a nineteenth capacitor (C6), a twentieth capacitor (C7), a twenty-first capacitor (C8), a twenty-second capacitor (C9), a fourth light-emitting diode (DAP33_LED), and a second passive crystal oscillator (X1). The first microcontroller chip (M33) is connected with the 1st pin of the fourteenth capacitor (C1) and the 1st pin of the fifteenth capacitor (C2), the other end of the fourteenth capacitor (C1) and the other end of the fifteenth capacitor (C2) are connected with the 0th pin of the first microcontroller chip (M33); the 2nd pin of the first microcontroller chip (M33) is connected with the 1st end of the tenth resistor (R1), the other end of the tenth resistor (R1) is connected with the SWD_CLK pin of the chip to be debugged; the 3rd pin of the first microcontroller chip (M33) is connected with the 1st end of the eleventh resistor (R2), the other end of the eleventh resistor (R2) is connected with the SWD_DIO pin of the chip to be debugged; the 4th pin of the first microcontroller chip (M33) is connected with the 1st end of the twelfth resistor (R3), the other end of the twelfth resistor (R3) is connected with the SWD_DIO pin of the chip to be debugged; the 6th pin of the first microcontroller chip (M33) is connected with the 3rd pin of the second passive crystal oscillator (X1) and the 1st end of the sixteenth capacitor (C3), the other end of the sixteenth capacitor (C3) is connected with the 0th pin of the first microcontroller chip (M33); the 7th pin of the first microcontroller chip (M33) is connected with the 1st pin of the second passive crystal oscillator (X1) and the 1st end of the seventeenth capacitor (C4), the other end of the seventeenth capacitor (C4) is connected with the 0th pin of the first microcontroller chip (M33); the 8th pin of the first microcontroller chip (M33) is connected with the 1st end of the eighteenth capacitor (C5), the other end of the eighteenth capacitor (C5) is connected with the 0th pin of the first microcontroller chip (M33); the 9th pin of the first microcontroller chip (M33) is connected with the 1st end of the nineteenth capacitor (C6) and the 1st end of the twentieth capacitor (C7), the other end of the nineteenth capacitor (C6) and the other end of the twentieth capacitor (C7) are connected with the 0th pin of the first microcontroller chip (M33); the 12th pin of the first microcontroller chip (M33) is connected with the TXD data line of the first virtual serial port; the 13th pin of the first microcontroller chip (M33) is connected with the RXD data line of the first virtual serial port; the 16th pin of the first microcontroller chip (M33) is connected with the 16th pin of the second microcontroller chip (M0) in the second microcontroller module; the 17th pin of the first microcontroller chip (M33) is connected with the 17th pin of the second microcontroller chip (M0) in the second microcontroller module; the 20th pin of the first microcontroller chip (M33) is connected with the 1st end of the fifteenth resistor (R7), the other end of the fifteenth resistor (R7) is connected with the 0th pin of the first microcontroller chip (M33); the 23rd pin of the first microcontroller chip (M33) is connected with the 1st end of the twenty-first capacitor (C8) and the 1st end of the twenty-second capacitor (C9), the other end of the twenty-first capacitor (C8) and the other end of the twenty-second capacitor (C9) are connected with the 0th pin of the first microcontroller chip (M33); the 35th pin of the first microcontroller chip (M33) is connected with the 27th pin of the USB-HUB chip in the USB expansion module.The pin No. 36 of the first microcontroller chip (M33) is connected with the pin No. 28 of the USB-HUB chip in the USB expansion module; one end of the thirteenth resistor (R9) is connected with the pin No. 45 of the first microcontroller chip (M33), and the other end of the thirteenth resistor (R9) is connected with the pin No. 0 of the first microcontroller chip (M33); one end of the fourteenth resistor (R10) is connected with the pin No. 48 of the first microcontroller chip (M33), the other end of the fourteenth resistor (R10) is connected with the positive electrode of the fourth light-emitting diode (DAP33_LED), and the negative electrode of the fourth light-emitting diode (DAP33_LED) is connected with the pin No. 0 of the first microcontroller chip (M33).
6. The multi-core synchronization debugging tool of claim 5, wherein, The second microcontroller module comprises a second microcontroller chip (M0), a seventeenth resistor (R11), an eighteenth resistor (R12), a nineteenth resistor (R13), a twentieth resistor (R19), a twenty-first resistor (R20), a twenty-second resistor (R17), a twenty-third capacitor (C11), a twenty-fourth capacitor (C12), a twenty-fifth capacitor (C13), a twenty-sixth capacitor (C14), a twenty-seventh capacitor (C15), a twenty-eighth capacitor (C16), a twenty-ninth capacitor (C17), a thirtieth capacitor (C18), a thirty-first capacitor (C19), a fifth light-emitting diode (DAPM0_LED), and a third passive crystal oscillator (X2). The 1st pin of the second microcontroller chip (M0) is connected with one end of the 23rd capacitor (C11) and the 24th capacitor (C12), and the other end of the 23rd capacitor (C11) and the 24th capacitor (C12) is connected with the 0th pin of the second microcontroller chip (M0); the 2nd pin of the second microcontroller chip (M0) is connected with one end of the 17th resistor (R11), and the other end of the 17th resistor (R11) is connected with the SWD_CLK pin of the chip to be debugged; the 3rd pin of the second microcontroller chip (M0) is connected with one end of the 18th resistor (R12), and the other end of the 18th resistor (R12) is connected with the SWD_DIO pin of the chip to be debugged; the 4th pin of the second microcontroller chip (M0) is connected with one end of the 19th resistor (R13), and the other end of the 19th resistor (R13) is connected with the SWD_DIO pin of the chip to be debugged; the 6th pin of the second microcontroller chip (M0) is connected with the 3rd pin of the third passive crystal oscillator (X2) and one end of the 25th capacitor (C13), and the other end of the 25th capacitor (C13) is connected with the 0th pin of the second microcontroller chip (M0); the 7th pin of the second microcontroller chip (M0) is connected with the 1st pin of the third passive crystal oscillator (X2) and one end of the 26th capacitor (C14), and the other end of the 26th capacitor (C14) is connected with the 0th pin of the second microcontroller chip (M0); the 8th pin of the second microcontroller chip (M0) is connected with one end of the 27th capacitor (C15), and the other end of the 27th capacitor (C15) is connected with the 0th pin of the second microcontroller chip (M0); the 9th pin of the second microcontroller chip (M0) is connected with one end of the 28th capacitor (C16) and the 29th capacitor (C17), and the other end of the 28th capacitor (C16) and the 29th capacitor (C17) is connected with the 0th pin of the second microcontroller chip (M0); the 12th pin of the second microcontroller chip (M0) is connected with the TXD data line of the second virtual serial port; the 13th pin of the second microcontroller chip (M0) is connected with the RXD data line of the second virtual serial port; the 16th pin of the second microcontroller chip (M0) is connected with the 16th pin of the first microcontroller chip (M33) in the first microcontroller module; the 17th pin of the second microcontroller chip (M0) is connected with the 17th pin of the first microcontroller chip (M33) in the first microcontroller module; the 20th pin of the second microcontroller chip (M0) is connected with one end of the 22nd resistor (R17), and the other end of the 22nd resistor (R17) is connected with the 0th pin of the second microcontroller chip (M0); the 23rd pin of the second microcontroller chip (M0) is connected with one end of the 30th capacitor (C18) and the 31st capacitor (C19), and the other end of the 30th capacitor (C18) and the 31st capacitor (C19) is connected with the 0th pin of the second microcontroller chip (M0).The pin No. 35 of the second microcontroller chip (M0) is connected with the pin No. 11 of the USB-HUB chip in the USB expansion module; the pin No. 36 of the second microcontroller chip (M0) is connected with the pin No. 12 of the USB-HUB chip in the USB expansion module; the pin No. 45 of the second microcontroller chip (M0) is connected with one end of the twentieth resistor (R19), and the other end of the twentieth resistor (R19) is connected with the pin No. 0 of the second microcontroller chip (M0); the pin No. 48 of the second microcontroller chip (M0) is connected with one end of the twenty-first resistor (R20), the other end of the twenty-first resistor (R20) is connected with the positive electrode of the fifth light-emitting diode (DAPM0_LED), and the negative electrode of the fifth light-emitting diode (DAPM0_LED) is connected with the pin No. 0 of the second microcontroller chip (M0).
7. The multi-core synchronization debugging tool according to claim 6, wherein, The tool is used for debugging a microcontroller in a target MCU, i.e., a chip to be debugged, and the method comprises the following steps: Step 1, connecting the tool to a debugging computer by using a USB data line. Step 2, use data line to connect two microcontrollers in the chip to be debugged; Step 3, send command to make two microcontrollers enter debug mode and run at full speed; Step 4, stop two microcontrollers synchronously; Step 5, debug computer collects debug information; Step 6, start two microcontrollers synchronously; Step 7, repeat steps 4-6 until debugging is completed.
8. The multi-core synchronization debugging tool according to claim 7, wherein, The specific steps of synchronously stopping two microcontrollers in step 4 include: Step 4-1, configure program breakpoint of the first microcontroller to be debugged or manually send stop running command; Step 4-2, after the first microcontroller enters program breakpoint or manually sends stop running command, send stop running command; Step 4-3, MCU1 monitors stop running command, then controls one IO output port GPIO1 in MCU1 to output low level; Step 4-4, MCU1 sends stop running command to the first microcontroller to be debugged through DAP standard protocol, and the first microcontroller to be debugged stops running after receiving the stop running command; Step 4-5, MCU2 finds that the input level of GPIO1 is low level, then controls one IO output port GPIO2 in MCU2 to output low level; Step 4-6, send stop running command to the second microcontroller to be debugged through DAP standard protocol, and the second microcontroller to be debugged also stops running after receiving the stop running command.
9. The multi-core synchronization debugging tool of claim 8, wherein, The specific steps of synchronously starting two microcontrollers in step 6 include: Step 6-1, send start command to the first microcontroller to be debugged; Step 6-2, MCU1 monitors start running command sent by the host computer, then controls GPIO1 to output high level; Step 6-3, MCU1 sends start running command to the first microcontroller to be debugged through DAP standard protocol, and the first microcontroller to be debugged starts running after receiving the start running command; Step 6-4, MCU2 finds that the input level of GPIO1 is high level, then controls GPIO2 to output high level; Step 6-5, send start running command to the second microcontroller to be debugged through DAP standard protocol, and the second microcontroller to be debugged also starts running after receiving the start running command.
10. The multi-core synchronization debugging tool of claim 9, wherein, In the method of steps 4 and 6: MCU1 and MCU2 detect stop or start running command through CMSIS_DAP thread, and realize control of the two microcontrollers to be debugged.
Citation Information
Patent Citations
Asynchronous multi-core programmable automation controller (PAC)
CN102929194A
Chip-embedded USB to JTAG debugging device and debugging method
CN103226506A