常见问答
- M051 系列(95)
- M0518 系列(97)
- M0519 系列(43)
- M0564 系列(1)
- Mini51 系列(90)
- Nano100 / 102 系列(101)
- Nano103 Base 系列(10)
- Nano110 / 112 LCD 系列(100)
- Nano120 USB 系列(111)
- Nano130 USB+LCD 系列(110)
- NUC029 系列(94)
- NUC100 / 200 系列(102)
- NUC120 / 122 / 123 / 220 USB 系列(116)
- NUC121/125 系列(1)
- NUC126 USB 系列(2)
- NUC130 / 230 CAN 系列(103)
- NUC131/NUC1311 CAN 系列(98)
- NUC140 / 240 USB+CAN 系列(114)
- M451 Base 系列(118)
- M451M 系列(117)
- M452 USB 系列(130)
- M4521 USB 系列(1)
- M453 CAN 系列(128)
- M463 CAN FD/USB HS 系列(1)
- M467 Ethernet/Crypto 系列(1)
- M471 系列(1)
- M479 Motor Control Series(1)
- M481 Base 系列(4)
- M482 USB FS OTG 系列(4)
- M483 CAN 系列(4)
- M484 USB HS OTG 系列(4)
- M485 Crypto 系列(4)
- M487 Ethernet 系列(4)
- M4TK 触摸 IC 系列(25)
- NUC442 / 472 系列(130)
- NUC472 Series(1)
- NUC505 系列(138)
よくあるご質問
How to check and modify the register status by PinView and lua script? 日付:2019-10-02
The PinView can access MCU memory with lua file without using KEIL μVision or IAR EWARM. Also, the PinView supports the following operations by lua script:
(1) Access register to verify hardware circuit
(2) Dump SRAM data
(3) Support lua script to quickly implement test program
Lua web site: https://www.lua.org/
Scenario:
(1) User is debugging a customer project but cannot access the source project.
(2) User only has KEIL μVision now but customer uses IAR EWARM to develop projects.
1. Create a lua file. (Lua Example 1)
2. Open the PinView
3. Run the lua file script


4. The PinView log window shows the changes

Lua Example 1: my1.lua – Access GPIOA register to toggle I/O
-- Config
local write_data = 0
local RegAdd = 0x50004008 -- GPIOA_DOUT
-- Print setting
local ext = require("ext")
local print = ext.redirect_print
print(string.format('Hello Nuvoton'));
-- Read register
local read_data = ice:ReadMem32(RegAdd)
print(string.format("ReadMem: addr 0x%08X, data 0x%08X", RegAdd, read_data))
-- Write register
write_data = 0xFFFF-read_data; -- Invert GPIOA data
ice:WriteMem32(RegAdd, write_data)
print(string.format("WriteMem addr 0x%08X, data 0x%08X", RegAdd, write_data))

Lua Example 2: my.lua – Dump SRAM data
-- Config
local RegAdd = 0x20000000 -- SRAM address
local total_size = 256 -- Data length
-- Print setting
local ext = require("ext")
local print = ext.redirect_print
print(string.format('Hello Nuvoton'));
-- Dump SRAM data
local i = 0
while i < total_size do
local read_data = ice:ReadMem32(RegAdd+i)
print(string.format("ReadMem: addr 0x%08X, data 0x%08X", RegAdd+i, read_data))
i = i + 4
end

| 製品: | マイクロコントローラ ,8ビット 8051 MCU ,Arm Cortex-M0 MCU ,Arm Cortex-M23マイクロコントローラ ,Arm Cortex-M4 MCU |
|---|---|
| アプリケーション: | |
| 機能: | Software and Tools,Nu Tools,PinView |
粤公网安备 44030502010001号