2023-11-29 02:40 AM
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
2023-11-29 02:59 AM
Hello @CircuitDev91 and welcome to the ST Community :smiling_face_with_smiling_eyes:.
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 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.
2023-11-29 03:43 AM
Hi again @CircuitDev91
A "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.
2023-11-29 04:51 AM
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:
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
2023-11-29 05:47 AM
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
2023-11-29 05:59 AM
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.
2023-11-29 07:21 AM
@CircuitDev91 intends to use the STM32 as a JTAG master, to program a CPLD which would be JTAG slave.
JW
2023-11-29 07:36 AM
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.