GigaDevice GD32VW5 Option Bytes Programming
Jump to navigation
Jump to search
GigaDevice GD32VW5 option bytes programming and SPC locking/unlocking features are implemented in the PCode_DevPro_GigaDevice_GD32VW5.pex script file.
Important notes
- Performing SPC level 1 unlocking starts regression sequence. Flash memory is completely erased in this case.
- After option bytes write operation, the target device must be power-cycled.
- GigaDevice GD32VW5 supports only JTAG target interface
Usage
DevPro -operation [operation_name] -if SWD -speed 4000 [parameter_name=value] -ScriptFile PCode_DevPro_GigaDevice_GD32VW5.pex
Operation | Parameters | Values | Description |
---|---|---|---|
ReadOptionBytes | OptionName | FMC_OBR | Read Option byte register. |
FMC_OBUSER | Read Option byte user register. | ||
FMC_OBWRP0 | Read Option byte write protection area register 0. | ||
FMC_OBWRP1 | Read Option byte write protection area register 1. | ||
WriteOptionBytes | OptionName | FMC_OBR | Write Option byte register. |
FMC_OBUSER | Write Option byte user register. | ||
FMC_OBWRP0 | Write Option byte write protection area register 0. | ||
FMC_OBWRP1 | Write Option byte write protection area register 1. | ||
Value | 0xXXXXXXXX | 32-bit value to be written to the register specified in "OptionName" parameter. |
Detailed description
ReadOptionBytes
- Reads and prints out description of the selected option-byte register.
WriteOptionBytes
- Writes selected option-byte register. Using hex value is recommended.
Note:
Writing FMC_OBR register is used to lock device. The SPC[7:0] bits represent device locking level:
Value 0xAA - Device not locked
Other value except 0xAA - Level 1 protection
Writing FMC_OBR register is used to lock device. The SPC[7:0] bits represent device locking level:
Value 0xAA - Device not locked
Other value except 0xAA - Level 1 protection
Examples
Reading option bytes register:
DevPro -operation ReadOptionBytes -if JTAG -speed 4000 -SetConfigVal "OptionName=FMC_OBR" -ScriptFile "PCode_DevPro_GigaDevice_GD32VW5.pex" SEGGER Device Provisioner V7.96l Compiled Jun 12 2024 18:55:19 'q' to quit '?' for help Command line: -operation ReadOptionBytes -if JTAG -speed 4000 -SetConfigVal OptionName=FMC_OBR -ScriptFile PCode_DevPro_GigaDevice_GD32VW5.pex Opened script file: 'PCode_DevPro_GigaDevice_GD32VW5.pex' J-Link log: TotalIRLen = 10, IRPrint = 0x0021 J-Link log: JTAG chain detection found 2 devices: J-Link log: #0 Id: 0x10307A6D, IRLen: 05, NucleiSys N307 (RISC-V TAP) J-Link log: #1 Id: 0x790007A3, IRLen: 05, GD32 Boundary Scan J-Link log: ----------------------------------------------------------------------------------------------- J-Link log: FMC_OBR value: 0x00000EAA J-Link log: ----------------------------------------------------------------------------------------------- J-Link log: Security Protection code SPC[7:0]: 0x000000AA J-Link log: |-> No security protection J-Link log: ----------------------------------------------------------------------------------------------- J-Link log: IWDG option: 0x00000001 J-Link log: |-> IWDG is software watchdog J-Link log: ----------------------------------------------------------------------------------------------- J-Link log: Vcore domain Standby entry reset option: 0x00000001 J-Link log: |-> No reset generated when entering Standby mode on Vcore domain J-Link log: ----------------------------------------------------------------------------------------------- J-Link log: Vcore domain Stop entry reset option: 0x00000001 J-Link log: |-> No reset generated when entering Stop mode on Vcore domain J-Link log: ----------------------------------------------------------------------------------------------- J-Link log: SRAM1 reset enable: 0x00000000 J-Link log: |-> No effect
Writing option bytes register (setting SPC level 1 protection):
DevPro -operation WriteOptionBytes -if JTAG -speed 4000 -SetConfigVal "OptionName=FMC_OBR" -SetConfigVal "Value=0x00000EBB"-ScriptFile "PCode_DevPro_GigaDevice_GD32VW5.pex" SEGGER Device Provisioner V7.96l Compiled Jun 12 2024 18:55:19 'q' to quit '?' for help Command line: -operation WriteOptionBytes -if JTAG -speed 4000 -SetConfigVal OptionName=FMC_OBR -SetConfigVal Value=0x00000EBB -ScriptFile PCode_DevPro_GigaDevice_GD32VW5.pex Opened script file: 'PCode_DevPro_GigaDevice_GD32VW5.pex' J-Link log: TotalIRLen = 10, IRPrint = 0x0021 J-Link log: JTAG chain detection found 2 devices: J-Link log: #0 Id: 0x10307A6D, IRLen: 05, NucleiSys N307 (RISC-V TAP) J-Link log: #1 Id: 0x790007A3, IRLen: 05, GD32 Boundary Scan J-Link log: Option bytes programmed successfully