Boundary Scan is a method of testing interconnections on circuit boards or internal sub-blocks of circuits. You can also debug and observe the pin status of the integrated circuit, measure the voltage or analyze the sub-modules inside the integrated circuit, and test based on the JTAG interface.
NXP officials have provided two good application notes: AN13507 (LPC) and AN12919 (RT). Based on the reference application note test method, this article provides the boundary scan test results for NXP MIMXRT1050-EVK revA1. It can use Lauterbach to connect the chip and perform boundary scan to control the external pins. A script file is also provided. It can realize one-click connection to boundary scan and achieve level control of external pins.
Lauterbach:LA3050
MIMXRT1050-EVK rev A1 hardware modification point are as follows:
(1)Modify fuse bit 0X460[19], which is DAP_SJC_SWD_SEL, from 0-SWD to 1-JTAG.
To modify Fuse, you can enter serial download mode and use MCUbootUtility to connect and modify it.
Fig 1
(2)DNP R38 ,R323,R309,R152,R303
(3) JTAG_MODE connect to 3.3V= on board TP11 connect to J24_8
(4)R35 connect 100K resistor
(5)ONOFF pin pull up external 100K resistor to 3.3V,board modification point is SW2 pin3 or pin4 connect 100K resistor and pull up to J24_8.
(6) disconnect J32,J33 which will disconnect the on board debugger, because this test need to use the external Lauterbach.
(7) Use the external Lauterbach connect to JTAG interface J21, the connection picture is:
Fig 2
2.2 Software operation
Download Lauderbach's supporting software and install it. After installation, open the TRACE32 ICD Arm USB. If the Lauderbach device is connected, the interface will open successfully.
Fig 3
At this time, you can enter the relevant commands in the yellow box in the picture above.
Here you need to prepare the .bsdl file of the chip, which is usually placed on the chip introduction page of nxp.com. For example, the link to the bsdl file of RT1050 is
https://www.nxp.com/downloads/en/bsdl/RT1050.bsdl
You can copy the RT1050.bsdl file to the Lauderbach installation path: C:\T32
Next, enter the following command in the window to open the boundary scan window
SYStem.Mode Down
BSDL.RESet
BSDL.ParkState Select-DR-Scan
BSDL.state
Here, it will open the window:
Fig 4
Click FILE item, input the downloaded RT1050.bsdl , then in the window input the commander:
BSDL.SOFTRESET
Fig 5
Click check->BYPASSall,IDCODEall,SAMPLEall, make sure the 3 methods can be passed.
It is found here that the following problems are encountered when clicking IDCODEall:
Fig 6
It prompts that the IDCODE read is 188c301d, but the expected IDCODE is 088c301d. So what is the correct IDCODE? You can view RT1050RM:
Fig 7
It can be seen that the currently read 188c301d is in line with RM and is correct. Therefore, the version of bsdl downloaded from the official website needs to be modified. Open the RT1050.bsdl file:
Fig 8
Modify line 408 version from 0000 to 0001,Fig 8 is the modified result. Save, run the above commands again, we can see the current BYPASSall,IDCODEall,SAMPLEall connection result is:
Fig 9
Fig 10
Fig 11
To test the output control situation you need to do:
BSDLSET 1.: instructions->EXTEXT, DR mode->Set Write, Filter data-> uncheck intern
BSDL.state->Run: check SetAndRun, TwoStepDR, Click RUN button.
BSDLSET 1. Window, you can control the pin output status, eg, control GPIO_AD_B1_06 which is J22_2, control the output level: 1 high, 0 low.
Fig 12
As can be seen from Section 2.2, single-step operation requires manual typing of commands. In actual testing, the efficiency is very low, so scripting language can be used to directly implement automated command control.
Below, we take RT1050 as an example to control the level of the onboard GPIO_AD_B1_06 and J22_2 pins, and use a multimeter to test the high and low levels. In this way, when the TRACE32 software is opened, you only need to open the script directly, enter the debug mode, run it to the end with one click, and view the board Just turn on the light and control the status.
Script language, suffix .cmm, step: File->New Script, enter the following script command:
;system setup
SYStem.Mode Down
SYStem.CPU CortexM7
SYSTEM.CONFIG.DEBUGPORTTYPE JTAG
SYStem.JtagClock 1MHz
;BSDL Settings
BSDL.RESet
BSDL.ParkState Select-DR-Scan
BSDL.state
;configure boundary scan chain
BSDL.FILE RT1050.bsdl
;Check boundary scan chain
BSDL.SOFTRESET
BSDL.BYPASSall
BSDL.IDCODEall
BSDL.SAMPLEall ;Perform Sample test
BSDL.RUN
BSDL.SetAndRun ON
BSDL.TwoStepDR ON
BSDL.SET 1.
BSDL.SET 1. IR EXTEST
BSDL.RUN
BSDL.SET 1. PORT GPIO_AD_B1_06 0
BSDL.SET 1. PORT GPIO_AD_B1_06 1
BSDL.SET 1. PORT GPIO_AD_B1_06 0
WAIT 6.s
BSDL.SET 1. PORT GPIO_AD_B1_06 1
WAIT 6.s
BSDL.SET 1. PORT GPIO_AD_B1_06 0
WAIT 2.s
BSDL.SET 1. PORT GPIO_AD_B1_06 1
WAIT 2.s
BSDL.SET 1. PORT GPIO_AD_B1_06 0
WAIT 2.s
BSDL.SET 1. PORT GPIO_AD_B1_06 1
WAIT 2.s
BSDL.SET 1. PORT GPIO_AD_B1_06 0
WAIT 2.s
BSDL.SET 1. PORT GPIO_AD_B1_06 1
WAIT 2.s
BSDL.SET 1. PORT GPIO_AD_B1_06 0
WAIT 2.s
BSDL.SET 1. PORT GPIO_AD_B1_06 1
WAIT 2.s
Function: Pull the GPIO_AD_B1_06 pin high and low 6 times, with no delay, delay 5s, delay 2s. After the script is written, save it and debug it.
Fig 13
This is the video for the testing:
It can be seen that automatic control of the onboard GPIO_AD_B1_06 and J22_2 pins can be achieved, and there is no disconnection issue when the test delay is greater than 5S, indicating that the BSDL automatic test has been completed so far. If you encounter problems, be sure to pay attention to whether the hardware modification points of the board have been completely modified.
At last, thanks so much for my colleague @leilei_du and @albert_li 's endless help!
Excellent job!