cancel
Showing results for 
Search instead for 
Did you mean: 

Internal JTAG on STM32

CircuitDev91
Associate

Hello all together! :)

Does anybody know if an internal JTAG device is integrated on the STM32H562 oder STM32H563?
In my case, I need to implement the functionality to flash an external microcontroller over the STM32 chip itself.

That would mean, I have a "JTAG input" interface for programming the STM32 itself, but also a "JTAG-output" interface to program an external microcontroller.

 

Thank you very much in advance!

Best regards,
CircuitDev91

7 REPLIES 7
STTwo-32
ST Employee

Hello @CircuitDev91 and welcome to the ST Community :smiling_face_with_smiling_eyes:.

>Does anybody know if an internal JTAG device is integrated on the STM32H562 oder STM32H563?

Yes, according to the DS14258, an Arm SWJ-DP interface is embedded and is a combined JTAG and serial-wire debug port that enables either a serial wire debug or a JTAG probe to be connected to the target.

 

>I have a "JTAG input" interface for programming the STM32 itself, but also a "JTAG-output" interface to program an external microcontroller.

I will verify if this "JTAG-output" is possible or not and i will be back to you soon.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi again @CircuitDev91 

"JTAG-output" as you described does not exist. If you are looking for a daisy chain application, you may find this post interesting.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

CircuitDev91
Associate

Hi @STTwo-32, thank you very much for your quick response :hugging_face:

Unfortunately, the JTAG Daisy-Chain application does not help me in this case, as the 'main microcontroller,' the STM32, is flashed via an external JTAG connection (external JTAG programming device).
The subsequent chip in my case, a CPLD, should be programmed separately and exclusively via the STM32, either by:

  • Having the bitstream data for the CPLD located in the Flash memory of the STM32, or
  • Directly forwarding the data, for example, via UART, to the programming interface for the CPLD.

 

Perhaps there is an alternative interface such as ISP or SWD that can be used for this purpose? Do you have any ideas?

I am still very grateful for your assistance so far! :)

Best regards,
CircuitDev91

I don't think there is any general-purpose microcontroller which implements a JTAG master interface.

But it's a relatively simple serial interface, so you should be able to implement it using combination of SPI and manual handling of TMS (and any other "slow" signal). Due to the variable number of bits in various situations, you'd need to change SPI's bit width quite often; not something you could easily clock in CubeMX. I'd recommend you to familiarize yourself with SPI first, starting with thorough reading of the SPI chapter in RM.

Bit-banging the protocol fully is always an option, of course.

JW

Check if there is a Boundary Scan BSDL file for the part, I'd imagine is has a full feed-thru JTAG implementation, but not going to check.

The ARM side JTAG is a bit involved, flashing will involve a lot of code injection and execution. See loader examples for cores supplied with STM32 Cube Programmer. Peeking and Poking the FLASH registers directly from the outside probably very inefficient.

Most would use the simpler USART methods of the System Loader as described in AN3155. Others for I2C and CAN, but if you can drive a JTAG bus the USART coding should be a walk in the park comparatively.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

@Tesla DeLorean,

@CircuitDev91  intends to use the STM32 as a JTAG master, to program a CPLD which would be JTAG slave.

JW

Don't most CPLD/FPGA have a simpler SPI FLASH type method for boot-strapping?

Programming JTAG for sure, also feed-thru / daisy-chain so one pod can program the board's components and perhaps test pin-to-pin connectivity also.

The JTAG pins on the STM32 are GPIO.

Perhaps those can be used for a bit-blit or bit-blast over the scan chain(s), and some simpler protocol for furnish the STM32 with stimulus / response packets via some more convenient interface.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..