CN113127291A - Micro-controller - Google Patents

Micro-controller Download PDF

Info

Publication number
CN113127291A
CN113127291A CN202011560867.4A CN202011560867A CN113127291A CN 113127291 A CN113127291 A CN 113127291A CN 202011560867 A CN202011560867 A CN 202011560867A CN 113127291 A CN113127291 A CN 113127291A
Authority
CN
China
Prior art keywords
microcontroller
access
master
slave
master device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011560867.4A
Other languages
Chinese (zh)
Other versions
CN113127291B (en
Inventor
马纪哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nuvoton Technology Corp
Original Assignee
Nuvoton Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nuvoton Technology Corp filed Critical Nuvoton Technology Corp
Publication of CN113127291A publication Critical patent/CN113127291A/en
Application granted granted Critical
Publication of CN113127291B publication Critical patent/CN113127291B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A microcontroller includes a slave device, a master device and a bus. The slave device accesses a memory device according to an access instruction. The master device executes a program code for providing an access instruction. The bus is coupled between the slave device and the master device and used for transmitting the access command to the slave device. When a trigger event occurs, the main device monitors the access state of the storage device to generate a monitoring result to an external device. The microcontroller provided by the application can monitor the access state of the storage device per se.

Description

Micro-controller
Technical Field
The present invention relates to a microcontroller, and more particularly, to a microcontroller for monitoring the access status of a memory device.
Background
With the progress of technology, the types and functions of electronic devices are increasing. A microcontroller is generally provided in the electronic device. The microcontroller operates according to program code within itself. When the program code has an error (bug), the microcontroller will not work properly.
Disclosure of Invention
The invention provides a microcontroller, which comprises a slave device, a master device and a bus. The slave device accesses a memory device according to an access instruction. The master device executes a program code for providing an access instruction. The bus is coupled between the slave device and the master device and used for transmitting the access command to the slave device. When a trigger event occurs, the main device monitors the access state of the storage device to generate a monitoring result to an external device. The microcontroller provided by the application can monitor the access state of the storage device per se.
Drawings
FIG. 1 is a schematic diagram of an operating system of the present invention.
FIG. 2 is a schematic diagram of a microcontroller according to the present invention.
FIG. 3 is another schematic diagram of the microcontroller according to the present invention.
FIG. 4 is an internal schematic view of a memory module according to the present invention.
[ notation ] to show
100: an operating system;
110: an external device;
120: a connector;
130. 200 and 300: a microcontroller;
121. 122: a transmission interface;
210. 310, 320: a master device;
220. 230, 330, 340: a slave device;
240. 250, 350, 60: a bus bar;
CM1、CM2: an access instruction;
CM3: a control instruction;
221. 231, 232, 331, 341: a storage device;
260. 270: a memory;
370: a storage module;
PRC: program code;
SM、SMA、SMB: monitoring the result;
411 to 418: a repository;
addr _ A, addr _ B: an address parameter set;
DA _ A, DA _ B: a set of data parameters;
TMS _ A, TMS _ B: a time parameter set;
RorW _ A, RorW _ B: a parameter set is accessed.
Detailed Description
In order to make the objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below. The present description provides various examples to illustrate the technical features of various embodiments of the present invention. The arrangement of the elements in the embodiments is for illustration and not for limiting the invention. In addition, the reference numerals in the embodiments are partially repeated to simplify the description, and do not indicate the relationship between the different embodiments.
FIG. 1 is a schematic diagram of an operating system of the present invention. As shown, the operating system 100 includes an external device 110, a connector 120, and a microcontroller 130. The external device 110 communicates with the microcontroller 130 through the connector 120. In the present embodiment, the external device 110 analyzes the parameter set provided by the microcontroller 130 for the user to determine whether the flow of the program code in the microcontroller 130 is correct. The present invention does not limit the kind of the external device 110. In one possible embodiment, the external device 110 is a computer device. In this case, the external device 110 may install a monitoring application code. When the user starts the monitoring application code, the external device 110 presents an analysis screen for the user to refer to according to the parameter set provided by the microcontroller 130.
The connector 120 is coupled between the external device 110 and the microcontroller 130. In the present embodiment, the connector 120 has transmission interfaces 121 and 122. The transmission interface 121 is used for coupling with an external device 110. The transmission interface 122 is coupled to the microcontroller 130. The present invention does not limit the kind of the transmission interfaces 121 and 122. In one embodiment, the transmission interface 121 is a USB interface. In other embodiments, the class of transport interface 121 may be the same or different from the class of transport interface 122.
In one embodiment, the connector 120 is used as a key. The microcontroller 130 is accessible to the external device 110 through the connector 120. Similarly, the microcontroller 130 provides the relevant parameter set to the external device 110 through the connector 120. In other embodiments, the connector 120 may be integrated into the external device 110 or the microcontroller 130. In some embodiments, the connector 120 may be omitted. In this example, the external device 110 and the microcontroller 130 have encryption and decryption functions to improve security.
The microcontroller 130 communicates with the external device 110 via the connector 120. When a trigger event occurs, the micro-controller 130 monitors the access status of its internal memory device and provides a monitoring result to the external device 110. In one possible embodiment, the triggering event is a button (not shown) being pressed. The button may be located in the microcontroller 130. When the user presses the button, the microcontroller 130 performs a monitoring operation. In another possible embodiment, the triggering event is the external device 110 issuing a monitoring trigger. In this example, when the user starts a monitoring application code of the external device 110, the external device 110 issues the monitoring trigger to command the microcontroller 130 to perform a monitoring operation.
Since the user knows the access status of the storage device inside the microcontroller 130 according to the monitoring result of the microcontroller 130, the user can quickly find the abnormal part and perform debugging (debug) when the access status of the storage device inside the microcontroller 130 does not meet the preset value. Furthermore, since the micro-controller 130 only monitors the access status of the storage device, the data flow can be known only by the binary file (binary file), and the external device 110 can reconstruct the program code flow executed by the micro-controller 130 without having the source code (source code), thereby simplifying the debugging process.
FIG. 2 is a schematic diagram of a microcontroller according to the present invention. As shown, the microcontroller 200 includes a master device 210, slave devices 220, 230, and buses 240 and 250. The master device 210 executes a program code PRC for issuing an access command CM1And CM2. The present invention does not limit the architecture of the master device 210. Any device that can issue an access command can be used as the master device 210. In one embodiment, the master device 210 is a Central Processing Unit (CPU) or a Peripheral Memory Direct Access controller (PDMA con)troller)。
The slave device 220 according to the access command CM1 A memory device 221 is accessed. The present invention does not limit the number of storage devices. In other embodiments, slave device 220 has more storage devices. In addition, in the embodiment, the storage device 221 is integrated into the slave device 220, but the invention is not limited thereto. In other embodiments, storage 221 may be independent of slave 220. In one possible embodiment, the storage device 221 includes at least one register (register).
The slave 230 according to the access instruction CM2At least one of the memory devices 231 and 232 is accessed. In other embodiments, slave device 230 has more or fewer storage devices. In addition, in the embodiment, the storage devices 231 and 232 are integrated into the slave device 230, but the invention is not limited thereto. In other embodiments, at least one of storage devices 231 and 232 is independent of slave device 230. In one possible embodiment, both storage devices 231 and 232 include at least one register (register).
The present invention is not limited to the types of slave devices 220 and 230. The class of slave device 220 may be the same or different from the class of slave device 230. In one embodiment, the slave device 220 is an Inter-Integrated Circuit (I2C) Circuit, and the slave device 220 is a Universal Asynchronous Receiver/Transmitter (UART).
The bus 240 is coupled between the slave device 220 and the master device 210 for transmitting an access command CM1. The bus 250 is coupled between the slave 230 and the master 210 for transmitting the access command CM2. The present invention does not limit the types of the busbars 240 and 250. The types of buses 240 and 250 correspond to the transmission interfaces of slave devices 220 and 230, respectively. For example, assume that the slave device 220 is an I2C circuit and the slave device 220 is a UART. In this example, bus 240 is an I2C bus and bus 250 is a UART bus.
The number of slave devices of microcontroller 200 is not limited by the present invention. In other embodiments, microcontroller 200 may have more or fewer slaves. In this case, the number of buses also varies with the number of slave devices. For example, when microcontroller 200 has more slaves, microcontroller 200 may need to send commands to the slaves using more busses.
In other embodiments, microcontroller 200 also includes a memory 260. The memory 260 is used for storing program codes PRC. When the master device 210 executes the program code PRC, the master device 210 generates an access command CM1And CM2For accessing the memory devices 221, 231 and 232. When a first trigger event occurs, the master device 210 monitors the access status of the memory devices 221, 231 and 232 to generate a monitoring result SM. In one possible embodiment, the master device 210 directly outputs the monitoring result SMTo the external device 110. In another possible embodiment, microcontroller 200 further includes a memory 270. The memory 270 is used for storing the monitoring result SM. In this example, the master device 210 first monitors the result SMStored in the memory 270, and reads the monitoring result S of the memory 270 at a specific timeMAnd outputs a monitoring result SMTo the external device 110. The present invention is not limited to the kind of the memory 270. The memory 270 may be a volatile memory or a non-volatile memory. In one embodiment, memory 270 is a Static Random Access Memory (SRAM).
In other embodiments, the master device 210 stops monitoring the access status of the memory devices 221, 231 and 232 when a second trigger event occurs. In this case, the master device 210 may read the monitoring result S stored in the memory 270MAnd providing a monitoring result SMTo the external device 110. The external device 110 analyzes the monitoring result SMFor generating an analysis frame. In this example, the user determines whether the flow of the program code PRC is correct according to the analysis screen of the external device 110.
The present invention does not limit the types of the first and second trigger events. In one possible embodiment, the host device 210 determines whether a first button (not shown) and a second button (not shown) are pressed. When the first button is pressed, a first triggering event is indicated. Thus, the master device 210 performs a monitoring operation. When the second button is pressed, a second triggering event is indicated. Therefore, the master device 210 stops the monitoring operation.
In another embodiment, when the user turns on a monitoring application (not shown) of the external device 110 and clicks a monitoring option, the external device 110 sends a first trigger signal to the main device 210. The master device 210 starts monitoring the access status of the memory devices 221, 231 and 232 according to the first trigger signal. When the user clicks a stop option, the external device 110 sends a second trigger signal to the main device 210. The master device 210 stops monitoring the access status of the memory devices 221, 231 and 232 according to the second trigger signal. In this example, when the user clicks a transmission option, the external device 110 sends a third trigger signal to the main device 210. The master device 210 reports the monitoring result S according to the third trigger signalM. In other embodiments, the second trigger event is indicated to occur when the master device 210 executes program code and reaches a breakpoint. Therefore, the master device 210 stops monitoring.
FIG. 3 is another schematic diagram of the microcontroller according to the present invention. FIG. 3 is similar to FIG. 2 except that the access instruction CM of FIG. 31And CM2Are provided by different master devices, such as 310 and 320. In the present embodiment, the master device 310 transmits the access command CM via the bus 3501To the slave device 330. The slave 330 CM according to the access instruction1The storage device 331 is accessed. In addition, the master device 320 transmits the access command CM through the bus 3602To the slave device 340. The slave device 340 according to the access instruction CM2The storage device 341 is accessed.
In one embodiment, the master device 310 is a central processing unit and the master device 320 is a PDMA controller. When a first trigger event occurs, the master device 310 monitors the access operation of the slave device 330 to generate a monitoring result SMA. When a second trigger event occurs, the master device 310 stops monitoring the access operation of the slave device 330. When a third trigger event occurs, the master device 320 monitors the access operation of the slave device 340 to generate a monitoring resultSMB. When a fourth trigger event occurs, the master device 320 stops monitoring the access operation of the slave device 340.
In one embodiment, the master devices 310 and 320 may store the monitoring result S respectivelyMAAnd SMBIn the memory module 370. In other embodiments, at least one of the master devices 310 and 320 directly outputs the monitoring result (S)MAAnd/or SMB) To an external device. In this embodiment, the storage module 370 has at least one memory (not shown) for storing the program codes and the monitoring result SMAAnd SMB. Since the characteristics of the slave devices 330, 340 and the buses 350, 360 are similar to those of the slave devices 220, 230 and the buses 240, 250 in FIG. 2, the description thereof is omitted.
In some embodiments, the master device 310 executes a program code stored in the memory module 370 to generate a control command CM3. The master device 320 according to the control command CM3Generating an access instruction CM2For accessing the slave device 340. In other embodiments, the master device 320 directly executes the program code stored in the memory module 370 to generate the access command CM2. In one embodiment, the storage module 370 has a non-volatile memory for storing program codes. In this case, the storage module 370 further has a volatile memory for storing the monitoring result SMAAnd SMB. In other embodiments, the result S is monitoredMAAnd SMBIs stored in non-volatile memory.
Fig. 4 is an internal schematic diagram of the memory module 370 of the present invention. As shown, the memory module 370 includes banks 411-418, but is not intended to limit the present invention. In other embodiments, storage module 370 has more or fewer storage banks. In the present embodiment, the banks 411-414 are used to store the monitoring result SMAThe storage libraries 415-418 are used to store the monitoring result SMB
The storage bank 411 is used for storing the monitoring result SMAThe address parameter set addr _ a in. For example, when the master device 310 stores data for addresses 0x4007003x and 0x4007000c of the storage device 331On fetch, the master device 310 records addresses 0x4007003x and 0x4007000c in the bank 411.
The storage library 412 is used for storing the monitoring result SMAThe data parameter set DA _ a. In one embodiment, the data parameter set DA _ A represents the data values written by the master device 310 at addresses 0x4007003x and 0x4007000c or the data values obtained by the master device 310 at addresses 0x4007003x and 0x4007000 c.
The storage 413 is used for storing the monitoring result SMAAnd (3) time parameter set TMS _ A. For example, the master device 310 may access the memory device 331 during the fifth cycle and the sixth cycle of an operating frequency. In this example, the master 310 records a cycle5 and a cycle6 in the store 413.
The storage library 414 is used for storing the monitoring result SMAThe access parameter set RorW _ a. For example, the master device 310 may write two data into the storage devices 331 separately. Thus, the storage bank 414 records Write operations Write twice.
The storage libraries 415-418 record the monitoring results S respectivelyMBThe address parameter set addr _ B, the data parameter set DA _ B, the time parameter set TMS _ B and the access parameter set RorW _ B. Since the characteristics of the address parameter group addr _ B, the data parameter group DA _ B, the time parameter group TMS _ B, and the access parameter group RorW _ B are the same as the characteristics of the address parameter group addr _ a, the data parameter group DA _ a, the time parameter group TMS _ a, and the access parameter group RorW _ a, no further description is given. In other embodiments, the address parameter set addr _ B, the data parameter set DA _ B, the time parameter set TMS _ B and the access parameter set RorW _ B may be stored in the storage banks 411-414, respectively.
Since the master device only monitors the access status of the memory devices (e.g., registers), the result S is monitoredMAAnd SMBBut a purely binary format file. Analyzing the monitoring result S by an external device (e.g. a computer device)MAAnd SMBThe method is used for generating an easy-to-read format (such as a waveform) for a user to refer to, so that the user can quickly know whether the flow of the program code is correct or not.
Unless otherwise defined, all terms (including technical and scientific terms) used herein are to be interpreted as commonly understood by one of ordinary skill in the art to which this invention belongs. Moreover, unless expressly stated otherwise, the definition of a term in a general dictionary shall be construed as being consistent with its meaning in the context of the relevant art and shall not be construed as an idealized or overly formal definition.
Although the present invention has been described with reference to the preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention. For example, the systems, devices, or methods described in the embodiments of the present invention may be implemented in hardware, software, or a combination of hardware and software. Therefore, the protection scope of the present invention is subject to the claims.

Claims (10)

1. A microcontroller, comprising:
a first slave device accessing a first storage device according to a first access instruction;
a master device executing a program code for providing the first access instruction; and
a first bus coupled between the first slave device and the master device for transmitting the first access command to the first slave device;
when a first trigger event occurs, the main device monitors the access state of the first storage device to generate a monitoring result to an external device.
2. The microcontroller of claim 1, further comprising:
a second slave device accessing a second storage device according to a second access instruction; and
and a second bus coupled between the second slave device and the master device for transmitting the second access command to the second slave device, wherein the master device executes the program code to provide the second access command.
3. The microcontroller of claim 2 wherein the first slave device is a universal asynchronous receiver/transmitter and the second bus is an inter-integrated circuit bus.
4. The microcontroller of claim 1 wherein the master device is a cpu or a dma.
5. The microcontroller of claim 1, further comprising:
and the memory is used for storing the monitoring result.
6. The microcontroller of claim 1 wherein the master device outputs the monitoring result directly to the external device.
7. The microcontroller of claim 1, further comprising:
a button, when pressed, indicating the occurrence of the first triggering event.
8. The microcontroller of claim 1 wherein the master device stops monitoring the access status of the first memory device when a second triggering event occurs.
9. The microcontroller of claim 8 wherein the program code has a breakpoint that indicates the occurrence of the second trigger event when the master executes to the breakpoint.
10. The microcontroller according to claim 8, wherein the first and second trigger events are caused by the external device.
CN202011560867.4A 2019-12-31 2020-12-25 Micro controller Active CN113127291B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
TW108148541A TWI709907B (en) 2019-12-31 2019-12-31 Micro-controller
TW108148541 2019-12-31

Publications (2)

Publication Number Publication Date
CN113127291A true CN113127291A (en) 2021-07-16
CN113127291B CN113127291B (en) 2024-04-05

Family

ID=74202347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011560867.4A Active CN113127291B (en) 2019-12-31 2020-12-25 Micro controller

Country Status (2)

Country Link
CN (1) CN113127291B (en)
TW (1) TWI709907B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI761917B (en) * 2020-08-19 2022-04-21 鴻海精密工業股份有限公司 Program debugging method, device and storage media
TWI818659B (en) * 2022-08-04 2023-10-11 新唐科技股份有限公司 Micro-controller, operating system and control method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5772491A (en) * 1980-10-23 1982-05-06 Meisei Electric Co Ltd Control system for terminal equipment
JPS6295647A (en) * 1985-10-22 1987-05-02 Nec Corp Microprogram controller with run monitoring device
US5819108A (en) * 1996-10-17 1998-10-06 Acer Peripherals, Inc. Programming of software into programmable memory within a peripheral device
KR20050095981A (en) * 2004-03-29 2005-10-05 매그나칩 반도체 유한회사 Microcontroller having an internal process mornitoring function and method thereof
CN105740718A (en) * 2014-11-26 2016-07-06 纬创资通股份有限公司 Electronic system, electronic device and access authentication method of electronic device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9703524B2 (en) * 2015-11-25 2017-07-11 Doppler Labs, Inc. Privacy protection in collective feedforward
WO2019220221A1 (en) * 2018-05-14 2019-11-21 Terrence Keith Ashwin An emergency controller unit having a wifi authentication sensor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5772491A (en) * 1980-10-23 1982-05-06 Meisei Electric Co Ltd Control system for terminal equipment
JPS6295647A (en) * 1985-10-22 1987-05-02 Nec Corp Microprogram controller with run monitoring device
US5819108A (en) * 1996-10-17 1998-10-06 Acer Peripherals, Inc. Programming of software into programmable memory within a peripheral device
KR20050095981A (en) * 2004-03-29 2005-10-05 매그나칩 반도체 유한회사 Microcontroller having an internal process mornitoring function and method thereof
CN105740718A (en) * 2014-11-26 2016-07-06 纬创资通股份有限公司 Electronic system, electronic device and access authentication method of electronic device

Also Published As

Publication number Publication date
TW202127234A (en) 2021-07-16
CN113127291B (en) 2024-04-05
TWI709907B (en) 2020-11-11

Similar Documents

Publication Publication Date Title
US5630102A (en) In-circuit-emulation event management system
US5594890A (en) Emulation system for emulating CPU core, CPU core with provision for emulation and ASIC having the CPU core
US6877114B2 (en) On-chip instrumentation
CN113127291B (en) Micro controller
US20080222612A1 (en) Embedded systems debugging
US20020144235A1 (en) Debugging embedded systems
CN103003799A (en) Methods and system for verifying memory device integrity
CN104714459A (en) Programmable controller
CN103026342A (en) Methods and system for verifying memory device integrity
US5307482A (en) Computer, non-maskable interrupt trace routine override
US20090006934A1 (en) Triggering diagnostic operations within a data processing apparatus
US20030037257A1 (en) Debugging device
JP2021515308A (en) Devices and methods for accessing metadata when debugging devices
US10534682B2 (en) Method and diagnostic apparatus for performing diagnostic operations upon a target apparatus using transferred state and emulated operation of a transaction master
US10922023B2 (en) Method for accessing code SRAM and electronic device
JP2003263339A (en) Debug function-incorporated microcomputer
JP2003022222A (en) Information processor and its maintenance method
JPH10326203A (en) Debugging devices capable of taking over operation from each other between hardware environments while running programs therein
JP2006323726A (en) Monitor program and real-time trace system
US20060117225A1 (en) Electronic device with debugging function and method thereof
JP2005353020A (en) Simulation system for computer program
CN111949431B (en) Fatal error providing method and fatal error identification method for system-on-chip product
CN112052132B (en) Method, device, equipment and medium for debugging plug-in chip through SDIO interface
JPH0581087A (en) Processor monitoring system
KR101416836B1 (en) System for monitoring flight control system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant