Connection is unstable using JTAG with my custom board.

12 posts / 0 new
Last post
daniel59
Offline
Last seen: 1 week 5 days ago
Joined: 2016-01-08 04:34
Connection is unstable using JTAG with my custom board.

Hi,

my connection is unstable using JTAG with my custom board.

first I can detect my board, but when i go into the toolbox, and download the booter firmware, it goes wrong.

Log shows below:

[INFO General @19-01-11 16:33:26] Found SWD-DP with ID 0x0BB11477
[INFO General @19-01-11 16:33:26] Found Cortex-M0 r0p0, Little endian.
[INFO General @19-01-11 16:33:26] FPUnit: 4 code (BP) slots and 0 literal slots
[INFO General @19-01-11 16:33:26] CoreSight components:
[INFO General @19-01-11 16:33:26] ROMTbl 0 @ E00FF000
[INFO General @19-01-11 16:33:26] ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB008 SCS
[INFO General @19-01-11 16:33:26] ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 000BB00A DWT
[INFO General @19-01-11 16:33:26] ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 000BB00B FPB
[INFO General @19-01-11 16:33:26] BTLE device selected.
[INFO General @19-01-11 16:33:34] Found SWD-DP with ID 0x0BB11477
[ERROR General @19-01-11 16:33:34] DAP error while reading DP-Ctrl-Stat register.
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x50003200 with function JLINKARM_ReadMemHW
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x50003201 with function JLINKARM_ReadMemHW
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x50003202 with function JLINKARM_ReadMemHW
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x50003200 with function JLINKARM_ReadMemHW
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x50003204 with function JLINKARM_ReadMemHW
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x50003208 with function JLINKARM_ReadMemHW
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x5000320c with function JLINKARM_ReadMemHW
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x50040200 with function JLINKARM_ReadMem
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x50040204 with function JLINKARM_ReadMem
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x50040208 with function JLINKARM_ReadMem
[INFO General @19-01-11 16:33:35] Could not measure total IR len. TDO is constant high.
[ERROR General @19-01-11 16:33:35] Could not read memory address 0x5004020c with function JLINKARM_ReadMem
[ERROR General @19-01-11 16:33:35] No known chip found while opening JLink connection. Terminating proccess...
[ERROR Booter @19-01-11 16:33:35] Failed downloading firmware file to the board.

what's the problem? my cable or my board?

Device: 
PM_Dialog
Offline
Last seen: 12 hours 56 min ago
Staff
Joined: 2018-02-08 11:03
Hi daniel59,

Hi daniel59,

This is an indication from the Jlink software and not from Smart Snippets (when connected via JTAG, Smart Snippets uses the jlink in order to access the device). You mentioned that you have a custom board, so do you have the JTAG on you custom PCB or you are using either Pro or Basic DK in order to program your board?  I highly recommend you to check if you have configured correctly the SPI Flash pins in the Board Setup tab of SmartSnippets toolbox. Probably there is no connection between the processor on the custom PCB and the Jlink fw that tries to communicate with the device. That could be anything from connections up to problems with the PCB that make the 580 unable to operate. My suggestion is to check if the bootloader is executing in order to verify that the 580 is operating correctly. You could probe the P04 and P05 pins, and that pins should be toggled executing part of the bootloader, so when connecting to a terminal you should see the device printing garbage. Also i would suggest you to connect the board using the Jlink itself, instead using Smart Snippets and also i would try to download code via Keil.

Thanks, PM_Dialog

daniel59
Offline
Last seen: 1 week 5 days ago
Joined: 2016-01-08 04:34
Hi PM_Dialog,

Hi PM_Dialog,

I think I'm using a custom JTAG device, connected to my custom board.

I can use Keil go into the debug session, but when i run the code,using ble_app_barebone project, it go to code:
if ((GetWord16(SYS_STAT_REG) & DBG_IS_UP) == DBG_IS_UP)
__asm("BKPT #0\n");

I tested my 5 boards only 1 board can go through the code.

Is my boards quality bad?

PM_Dialog
Offline
Last seen: 12 hours 56 min ago
Staff
Joined: 2018-02-08 11:03
Hi daniel59,

Hi daniel59,

Could you please clarify what you mean with custom JTAG device? Which version of J-Link are you using? This means that you get an NMI. Could you please try to debug your code and try to find the cause of the NMI? Where does your application code get stuck? If unaware of how you can find the reason of the NMI, I would suggest you to have a look at Tutorial 8: Debugging methods_v1.1 from our support portal. Also, it is very possible that is error is due to bad quality of you PCB.

Thanks, PM_Dialog

daniel59
Offline
Last seen: 1 week 5 days ago
Joined: 2016-01-08 04:34
Thanks, PM_Dialog

Hi, PM_Dialog

Er...I mean custom J-link device. Which is like J-Link EDU Mini but only have swdio, swclk, vcc and gnd.

I'm using jlink v5.12f, which is recommended for da14580 by SmartSnippets studio v2.0.6.

I look the tutorial 8, but I cant found where the error is using both 2 methods.

I‘m thinking about my power supply. Commonly use J-link is directly connect swdio to pin 25, swclk to pin 26, vcc to pin 15 and gnd to pin 16, using QFN40 DA14580 .

but for my board, because i want to both charge battery and JTAG, I connect swdio to pin 25, swclk to pin 26, gnd to pin 16 but vcc to a battery management chip ltc4054 to charge li-ion battery, then connect battery to a 3.3v LDO, then connect 3.3v output from LDO to pin 15.

will this make things wrong?

i tried many times, sometime toolbox can find chip but shows CPU could not be halted, sometime toolbox cant find chip, sometime it directly shows Failed writing file D:\Desktop\empty_peripheral_template_580.hex at address 20000000.

PM_Dialog
Offline
Last seen: 12 hours 56 min ago
Staff
Joined: 2018-02-08 11:03
Hi daniel59,

Hi daniel59,

Be aware that we use H-Link Lite in our development boards and I am not completely sur if we have ever used J-Link EDU Mini. Could you please try to download firmware into the SysRAM using Keil in order to make sure that your custom board is working correctly? Only one of your boards has this problem or all of them?

Thanks, PM_Dialog

daniel59
Offline
Last seen: 1 week 5 days ago
Joined: 2016-01-08 04:34
Hi, PM_Dialog

Hi, PM_Dialog

Is download firmware into the SysRAM using Keil means using keil go into the debug session?

only some of my boards have this problem...

sometime the log shows Could not start CPU core. (Error code: -1).

and some boards after I tried and tried it can be connected by SPI Flash programmer, but then next time failed. As the attachment log show.

Will the length of cable I use to connect my boards with J-link affect the connection?

Daniel

Attachment: 
PM_Dialog
Offline
Last seen: 12 hours 56 min ago
Staff
Joined: 2018-02-08 11:03
Hi daniel59,

Hi daniel59,

Could you please check that you configured correctly the SPI Flash pins from the “Booter & Board Setup” tab of SmartSnippet? The “SPI Flash pin configuration” should be according to your board connections.  You mentioned that you are able to connect to the SPI Flash, so when the procedure failed when trying to read or write the flash? The length of the cables might be an issue, so try to use shorter cables. Regarding the SysRAM, yes, I meant to download your firmware using the Keil. It’s a little bit strange behavior, so this might be a hardware issue on your PCB.  Also you mentioned that only some boards have this problem, so let me ask you something for a clarification. Except those boards, could you please let me know if you have any completely functional boards (connect, read, write SPI Flash, bootable, and start advertising?  

Thanks, PM_Dialog

daniel59
Offline
Last seen: 1 week 5 days ago
Joined: 2016-01-08 04:34
Hi, PM_Dialog

Hi, PM_Dialog

Using keil, when i run the code,using ble_app_barebone project, it go to code:
if ((GetWord16(SYS_STAT_REG) & DBG_IS_UP) == DBG_IS_UP)
__asm("BKPT #0\n");

The SPI flash error I mean is, for example, this time I press connect it shows success, next time I press connect it shows fail.

And yes I have a completely functional boards, it can be connected correctly. So I think J-link device is working well.

Daniel

PM_Dialog
Offline
Last seen: 12 hours 56 min ago
Staff
Joined: 2018-02-08 11:03
Hi daniel59,

Hi daniel59,

This means that somewhere your application code gets stuck either to NMI_HandlerC or to HardFault_HandlerC. Could you please clarify where if gets stuck? I have recommended you a tutorial for how you are able to find the reason of the NMI / HARDFAULT. Since you have functional boards and you run some code, I suppose that some of your boards have hardware issue.

Thanks, PM_Dialog

daniel59
Offline
Last seen: 1 week 5 days ago
Joined: 2016-01-08 04:34
Hi PM_Dialog,

Hi PM_Dialog,

Yes I tried tutorial 8, and 2 methods both don't work.

Show callee just jump to the __asm("BKPT #0\n");

and the MSP method shows address 0xFFFF0000; which is MOVS r0,r0

maybe because of my custom j-link device?

and is there any method to detect whether bad chip or bad board?

PM_Dialog
Offline
Last seen: 12 hours 56 min ago
Staff
Joined: 2018-02-08 11:03
Hi daniel59,

Hi daniel59,

Did you check if the bootloader is executing in order to verify that the 580 is operating correctly?  You could probe the P04 and P05 pins, and that pins should be toggled executing part of the bootloader, so when connecting to a terminal you should see the device printing garbage.

Thanks, PM_Dialog