pylink icon indicating copy to clipboard operation
pylink copied to clipboard

CORESIGHT_AddAP doesn't execute

Open engrnader opened this issue 1 year ago • 6 comments

Hi, i'm executing a the commands below to connect to Cortex-M55 however I was not successful: response_1 = jlink.exec_command('CORESIGHT_AddAP = Index=4 Type=AHB-AP Addr=0x00300000') response_2 = jlink.exec_command('CORESIGHT_SetIndexAHBAPToUse = 4')

It seems that the second command works fine but not the first command. I wrote a jlink script and ran it from keil following the same exact procedure and I was able to connect to the device. I'm trying to override AP[4] address to 0x00300000.

image

Can someone help me implementing this using pylink?

engrnader avatar Dec 21 '23 20:12 engrnader

Could you try to use the coresight_* functions instead? https://pylink.readthedocs.io/en/latest/pylink.html#pylink.jlink.JLink.coresight_configure

hkpeprah avatar Dec 21 '23 21:12 hkpeprah

If I use the coresight functions instead I would have to define the ir_pre and post and dr_pre and post. I don't know those parameters.

How would you do it given the code I provided before?

engrnader avatar Jan 02 '24 21:01 engrnader

AFAIK, you can omit those parameters (they're optional). What have you tried?

hkpeprah avatar Jan 03 '24 16:01 hkpeprah

Then how can I specify the ROM table address? Jlink by default assumes the ROM table is at address 0x0.

I tried coresight_configure() with no parameters and it didn't work.

Here is what I have tried per your recommendations: image

I gotten the same error. image

Now, the issue here is that there are multiple cores within the JTAG chain and I want to select a specific core within the JTAG chain shown in the code snippet above. When executing the commands mentioned before, it don't select the core specified.

Perhaps i'm using coresight_configure() wrong.

engrnader avatar Jan 03 '24 20:01 engrnader

If there are multiple cores on the JTAG chain, then you unfortunately have to use the arguments: https://pylink.readthedocs.io/en/latest/pylink.html#pylink.jlink.JLink.coresight_configure

I personally haven't used an ARM device with multiple cores on a single scan chain, so I can't tell you what the arguments you would pass for each of those would be. Sorry to say. I would look up a reference manual for your part to see if it specifies anything about that. I'm guessing the core_idx is related to the device index on the scan chain.

hkpeprah avatar Jan 08 '24 19:01 hkpeprah

@hkpeprah thank you for your response. I will look into this more.

engrnader avatar Jan 09 '24 22:01 engrnader