MCU Testing and External NOR Programming Using JTAG_BSDL – LPC1857 Example

1. Introduction

Previously, we sharedhttps://mp.weixin.qq.com/s/BeL6UbSg2HI9qKemZugOhw?token=1054074707&lang=zh_CN

the article titledLow-Cost Learning FPGA Based on“Mining Board”” which usesJTAG boundary scan for quick pin correspondence reverse engineering..

Not only forFPGAs, but we can also useJTAG for boundary scan testing inMCUs, provided that the corresponding chip supports this feature and the manufacturer providesBSDL files.

Here, we will demonstrate using theLPC1857 MCU, with the development board beingMCB1800.

As mentioned earlier, TopJTAG is a commercial software that requires purchase; here we provide a harmonious version for testing purposes only. If needed, please purchase the legitimate version to support it.

Files shared via cloud storage:TOPJTAG.zip

Link: https://pan.baidu.com/s/1ea_Bsyf4GIaqAfYheNlmhg?pwd=ybqc Extraction code: ybqc

Shared by Baidu Cloud Super Memberv3.

2. Preparation

From the user manual, we can see that if theDBG_EN pin is pulled high, it is inARM debug mode, and if pulled low, it is inJTAG BSDL mode. We

will remove the jumper cap, thus pulling downDBG_EN to useJTAG BSDL mode. If you want to useJTAG to debug the simulation program, you need to short the jumper cap to pull upDBG_EN.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Download theBSDL file; login is required for download.

https://www.nxp.com.cn/products/LPC1857FET256

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

ConnectJINK, power on the development board.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

3. Operation Process

OpenTopJTAG Probe

File->New Project Wizard

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

The chip is recognized, and theJTAG BSDL mode IDCODE is different from that of theARM DEBUG mode.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Select theBSDL file.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

If the selectedBSDL file IDCODE is incorrect, a prompt will appear.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

If the version selected is incorrect, a prompt will also appear.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

You can directly open theBSDL file to see how the IDCODE is parsed.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

You need to select the correctIDCODE and the right version of theBSDL

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Taking the test key input as an example.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

AddP40, P43, P44 to the waveform.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Clickrun

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Press the button on the development board, and you can see the waveform change.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

You can also directly control theLED, corresponding to the pins below, directly control the pin output to1 or 0, and see the LED turn on and off.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

4. Read and WriteNOR

Two 8M 16-bitNOR FLASH chips form a 32-bit access, with a total capacity of16MB.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

OpenTopJTAG Flash Programmer

File->New Setup

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Set theFLASH properties.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Set the pins.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

You can set certain pins to a fixed level, but it is not needed here.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Start reading.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Info shows the deviceID

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

and corresponds to the manual.

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

You canFile->Save Setup As… to save the environment for next time.

If you have already saved thesetup file, just load it directly.

File-Load Setup

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

Setup->JTAG Connection…

MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example
MCU Testing and External NOR Programming Using JTAG_BSDL - LPC1857 Example

5. Summary

UsingJTAG BSDL allows for quick testing of the chip. For example, upon receiving a development board, you can quickly test whether the corresponding pins’ input and output are correct, determining functionality faster than writing a program for testing. You can also directly control pins to read and writeFLASH. Here, TopFlash supports parallelNOR FLASH. In fact, we can write a host computer to support any protocol forFLASH, as we can directly manipulate any pin. For instance, the programming ofSPI FLASH throughJTAG in Vivado follows a similar principle. The advantage of usingJTAG for reading and writingFLASH is flexibility; however, the downside is that the speed is limited by theIO simulation speed, which depends on the speed ofJTAG, and the JTAG protocol consumes relatively more resources, making it generally slower.

Leave a Comment