Hi All,
Can anyone please explain how to get JTAG connection set up with MPC5746R via Once Command Register (OCR) ?
Thank you!
Hello,
I want to create my own JTAG Flash programmer. I had come across the mentioned pdf (https://www.nxp.com/docs/en/application-note/AN4365.pdf). Here are the steps and the results of each steps.
1) Set to Test Logic Reset State with 5 consecutive TMS pulses.
2) Read devie ID in DR-Shift . Reads 0x1834601d.
3) Write 000001 (JTAGC ID CODE Instruction) to Shift IR
4) Read DR-Shift again. Reads 0x1834601d again (expected).
5) Write ACCESS_AUX_CORE_1 (101001) to Shift-IR.
6) Write ENABLE_ONCE (000 111 1110) to Shift-IR (10 bit command).
7) Assert Reset
9) Write 0b101 (32-Bit Command) to Shift DR to set OCR [DR and WK as 1]
10) Deassert Reset.
11) Wait 10 ms
12) At this stage I would like to read backk the once status register to see if the debug bit is set on. So I write bypass command 0b1000010001 in Shift IR and read back the tdo parallely. The register reads 0x201. (debug bit is 0).
Please help me with knowing what went wrong in the above steps.
Thanks!!
I forgot to mention that I wrote this script as an addendum to the application note:
And I have also version for MPC5748G - attached.
I believe this script will help to make it working.
Regards,
Lukas
Hi @am8patil
what is your intention? Do you want to develop own JTAG flash programmer or is it a question related to some specific debug tools?
If you want to develop own JTAG flash programmer, we provide this application note:
https://www.nxp.com/docs/en/application-note/AN4365.pdf
It's written for MPC56xx devices but it can be used also for MPC57xx as not much has changed.
If it is related to some debug tools - do you already have anything? Or are you looking for some recommendations what to use? I can see that most of customer usually use tools from Pemicro which can be used with debugger in-built in S32 Design Studio IDE:
https://www.pemicro.com/products/product_viewDetails.cfm?product_id=15320180&productTab=5051
If we are talking about advanced debuggers, you can take a look at www.lauterbach.com
Regards,
Lukas
0x400081e4 is SRAM address. The SRAM needs to be initialized after reset due to ECC. If it is not initialized, read or write access will cause machine check exception, most likely, due to double bit ECC error. This is a screenshot from AN4365:
And this is from the reference manual:
I guess that this is the source of your problem.
Regards,
Lukas
Hello,
I am trying to Initialize ECC as below. However OSR returns error bit as 1. Here is how I am trying to initialize it
Write IR to select OCMD -> CPU SCAN Reg
Write to DR-SHIFT
WBRRLOW = ADDR ( from 0x40000000 - 0x40200000)
WBRRHIGH = 0x00000000
MSR = 0x00000000
PC = 0x40000000
IR = 0x181F0900 e_stmw r0,0(r31)
CTL = 0x00000402
JtagSingleStep();
Check Once Status Register (OSR)
OSR = 0x309 (0b1100001001)
Indicating Error bit is 1
(Repeat this above step to for ADDR from 0x40000000 to 0x40200000)
Is there anything that I did wrong or missed?
I can see no problem in this procedure. This should work.
Could you tell me what's the content of CPUSCR after this single step?
Regards,
Lukas
PC = 0x10 means that Machine Check exception was triggered. Could you read also core register MCSR? It's SPR number 572.
Or when loading e_stmw instruction to CPUSCR - could you try to set PC to some flash address instead of 0x40000000? I'm wondering if late-write feature on RAM could cause fetching of next instruction from 0x40000000 before it is written by e_stmw (i.e. fetching instruction from corrupted/uninitialized RAM). I didn't test it on this device.
Regards,
Lukas
I can see no problem there, it pretty much follows the JTAG.cmm script.
The only discrepancy I can see is right at the beginning:
WBRRLOW = ADDR ( from 0x40000000 - 0x40200000)
There's 256KB RAM, so it should be 0x40000000 - 0x4003FFFF.
But you should get error bit set if you write somewhere behind the RAM.
It's probably not the root cause but could you check it? I can see nothing else.
Regards,
Lukas