5.20 DBG Guide
This chapter describes the file composition and the 3 public functions of the DBG driver in the N32G033 standard peripheral library. Read the debug interfaces, the breakpoint features and the state of each peripheral while debugging together with the “Debug support (DBG)” chapter of the user manual; for known silicon issues, refer to the errata sheet.
5.20.1 Related files
| Relative path | Purpose |
|---|---|
firmware/n32g033_std_periph_driver/inc/n32g033_dbg.h |
Declares the 3 public functions that read the unique customer ID, the unique device ID and the DBG_ID number, and gives the read-length macros |
firmware/n32g033_std_periph_driver/src/n32g033_dbg.c |
Implements the 3 functions above: read the unique customer ID, the unique device ID and the DBG_ID number byte by byte from the corresponding base addresses |
firmware/CMSIS/device/n32g033.h |
Defines the base addresses and read lengths of the unique customer ID, the unique device ID and the DBG_ID number |
5.20.2 API reference
The 3 public functions below are grouped into 1 group in the declaration order of n32g033_dbg.h; each entry gives a function summary and the source comment verbatim above that function in n32g033_dbg.c.
Unique identifier read
GetUCID, GetUID, GetDBGMCU_ID
void GetUCID(uint8_t *UCIDbuf)get unique customer id.
name UCID_Get.
fun get unique customer id.
param UCIDbuf
return none
Use note: This function is declared at line 65 of n32g033_dbg.h; the name in the source comment reads UCID_Get., which differs from the function name GetUCID; the comment is copied verbatim.
void GetUID(uint8_t *UIDbuf)get unique device id.
name UID_Get.
fun get unique device id.
param UIDbuf
return none
Use note: This function is declared at line 66 of n32g033_dbg.h; the name in the source comment reads UID_Get., which differs from the function name GetUID; the comment is copied verbatim.
void GetDBGMCU_ID(uint8_t *DBGMCU_IDbuf)get the DGC_ID number.
name GetDBGMCU_ID.
fun get the DGC_ID number.
param none
return revision number
5.20.3 Demo descriptions
This SDK provides no standalone example project for DBG.
5.20.4 Notes and troubleshooting
| Scenario | Check & action | Source |
|---|---|---|
| SWD interface pins | The Debug support (DBG) chapter of the N32G033 user manual states that the two pins of the SWD serial debug interface are SWDIO (PA13) and SWCLK (PA14); the debugger invokes the debug features through these pins. |
User manual |
| Debugger connection prerequisite | The Debug support (DBG) chapter of the N32G033 user manual states that the core hardware debug module is usable when a debugger is connected (unless disabled); without a debugger no debug access is performed. |
User manual |
| Peripheral stop while debugging | The “Peripheral debug support” part of the Power control (PWR) chapter of the N32G033 user manual states that some peripherals can be stopped while debugging (TIM1/3/4/6, I2C1/2, IWDG); this is controlled by the DBG_CTRL register bit fields. |
User manual |
| Identifier read length | The Debug support (DBG) chapter of the N32G033 user manual and the SDK headers state that the read lengths of the unique customer ID, the unique device ID and the DBG_ID number differ; the buffer passed in must hold the matching length to avoid an out-of-bounds write. |
User manual |
Errata sheet V1.0.0 (2025.9.25) covers revision A silicon and lists no DBG entries.