QN908x / J-Link flash error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

QN908x / J-Link flash error

1,766 次查看
Dassom
Contributor I

Hello!

We're getting this error on QN908x / J-Link / MCUExpress v11.7.0 setup when trying to run qn908xcdk_demo_apps_hello_world.

...

Downloading 16048 bytes @ address 0x00000000 - Verified OK
Downloading 920 bytes @ address 0x00003EB0 - Verified OK
ERROR: Timeout while erasing sectors, RAMCode did not respond in time (PC = 0x200004D6, XPSR = 0x01000000, SP = 0x20000660)!
Failed to erase sectors.

It seems from flash driver downloaded to RAM which is from SDK_2.x_QN908XC 2.2.8.

Any advice on this error?   Below is the full log. Also noted "Failed to power up DAP" once.

....................................................................

Connecting to J-Link...
J-Link is connected.
Device "QN9080C" selected.
Firmware: J-Link V11 compiled Dec 14 2022 09:09:01
Hardware: V11.00
S/N: 261006318
OEM: SEGGER-EDU
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 1.80 V
Listening on TCP/IP port 2342
Connecting to target...
$$UserActionStart$$: Terms of use
$$UserActionEnd$$: Terms of use
Found SW-DP with ID 0x2BA01477
Failed to power up DAP
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
[0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
[0][1]: E0001000 CID B105E00D PID 003BB002 DWT
[0][2]: E0002000 CID B105E00D PID 002BB003 FPB
[0][3]: E0000000 CID B105E00D PID 003BB001 ITM
[0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
[0][5]: E0041000 CID B105900D PID 000BB925 ETM
Connected to target
Waiting for GDB connection...Connected to 0000:0000:0000:0000:0000:0000:0000:0001
Reading common registers: R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, SP, LR, PC, XPSR
Read 4 bytes @ address 0x0302364E (Data = 0xE551E7FE)
Read 2 bytes @ address 0x0302364E (Data = 0xE7FE)
Connected to 0000:0000:0000:0000:0000:0000:0000:0001
Reading common registers: R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, SP, LR, PC, XPSR
Read 4 bytes @ address 0x0302364E (Data = 0xE551E7FE)
Read 2 bytes @ address 0x0302364E (Data = 0xE7FE)
Received monitor command: reset
Resetting target
Downloading 16048 bytes @ address 0x00000000 - Verified OK
Downloading 920 bytes @ address 0x00003EB0 - Verified OK
ERROR: Timeout while erasing sectors, RAMCode did not respond in time (PC = 0x200004D6, XPSR = 0x01000000, SP = 0x20000660)!
Failed to erase sectors.

 

 

0 项奖励
12 回复数

1,747 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Dassom ,

Thanks for contacting NXP support.

Just to confirm, is there a project running on your board? If so, could you please make it running in wake-up mode and try to erase flash with GUI Flash Tool.

Gavin_Jia_0-1680060399519.png

 

Hope you are doing well!

 

B.R.

Gavin

0 项奖励

1,738 次查看
Dassom
Contributor I

Hi @Gavin_Jia,

Thank you so much for the advise!

We were able to flash the hello world demo once. Therefore, it may be running on power up.

Could you please give more specifics on how to make it running in wake-up mode?

When trying to erase flash with GUI Flash tool, we are getting this error.

 

Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.

J-Link>exec EnableEraseAllFlashBanks

J-Link>erase

No address range specified, 'Erase Chip' will be executed

'erase': Performing implicit reset & halt of MCU.

Erasing device...

****** Error: Timeout while erasing chip, RAMCode did not respond in time (PC = 0x200004E0, XPSR = 0x41000000, SP = 0x20000660)!

Failed to erase chip.

Failed to execute RAMCode for chip erase!

J-Link: Flash download: Total time needed: 20.191s (Prepare: 0.100s, Compare: 0.000s, Erase: 20.049s, Program: 0.000s, Verify: 0.000s, Restore: 0.041s)

ERROR: Erase returned with error code -5.

Script processing completed.

Unable to perform operation!

Command failed with exit code 1

Thanks!

 

 

 

0 项奖励

1,728 次查看
Dassom
Contributor I

On another setup with MCU-LINK Pro, similar flash erase errors are seen.

The flash on this board has never been programmed. No program is running on it.

The probe was able to connect to the QN908x but failed to erase the flash inside the SOC with the given driver.

Here is the full log.

------------------------------------------------------------------------------------------------------------------------------

Executing flash operation 'Erase' (Erase flash) - Fri Mar 31 12:18:42 PDT 2023
Checking MCU info...
Scanning for targets...
Executing flash action...
MCUXpresso IDE RedlinkMulti Driver v11.7 (Jan 12 2023 18:05:45 - crt_emu_cm_redlink.exe build 1)
( 0) Reading remote configuration
Wc(03). No cache support.
Found part description in XML file QN908XC_internal.xml
( 5) Remote configuration complete
Reconnected to existing LinkServer process.
============= SCRIPT: RunBootRomConnect.scp =============
DpID = 2BA01477
APID = 0x24770011
Halt on reset vector catch
Halt on watchpoint read of vector table
============= END SCRIPT ================================
Probe Firmware: MCU-LINK Pro (r0CF) CMSIS-DAP V3.108 (NXP Semiconductors)
Serial Number: 3IFXVH1ODFABH
VID:PID: 1FC9:0143
USB Path: 0001:0023:00
Using memory from core 0 after searching for a good core
( 30) Emulator Connected
( 40) Debug Halt
( 50) CPU ID
debug interface type = CoreSight DP (DAP DP ID 2BA01477) over SWD TAP 0
processor type = Cortex-M4 (CPU ID 00000C24) on DAP AP 0
number of h/w breakpoints = 6
number of flash patches = 2
number of h/w watchpoints = 4
Probe(0): Connected&Reset. DpID: 2BA01477. CpuID: 00000C24. Info: <None>
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Content of CoreSight Debug ROM(s):
RBASE E00FF000: CID B105100D PID 04000BB4C4 ROM (type 0x1)
ROM 1 E000E000: CID B105E00D PID 04000BB00C Gen SCS (type 0x0)
ROM 1 E0001000: CID B105E00D PID 04003BB002 Gen DWT (type 0x0)
ROM 1 E0002000: CID B105E00D PID 04002BB003 Gen FPB (type 0x0)
ROM 1 E0000000: CID B105E00D PID 04003BB001 Gen ITM (type 0x0)
ROM 1 E0040000: CID B105900D PID 04000BB9A1 CSt TPIU type 0x11 Trace Sink - TPIU
ROM 1 E0041000: CID B105900D PID 04000BB925 CSt ETM type 0x13 Trace Source - Core
NXP: QN908XC
DAP stride is 4096 bytes (1024 words)
Inspected v.2 On-chip Flash Memory QN908XC_512K.cfx
Image 'QN908XC_512KB Jan 13 2023 11:53:39'
( 65) Chip Setup Complete
Connected: was_reset=true. was_stopped=false
( 70) License Check Complete
Opening flash driver QN908XC_512K.cfx
Sending VECTRESET to run flash driver
After error Nn(05). Wire ACK Wait in DAP access -
Failed to read address register in DAP - Nn(05). Wire ACK Wait in DAP access
flash driver polled mailbox (8 bytes at 0x400A1A8) read failed (on poll 1/301) - retrying after 1ms - rc Em(17). Debug port inaccessible after access at location 0x0400A1A8
After error Nn(05). Wire ACK Wait in DAP access -
Failed to read address register in DAP - Nn(05). Wire ACK Wait in DAP access
flash driver polled mailbox (8 bytes at 0x400A1A8) read failed (on poll 1/301) - halting for postmortem - rc Em(17). Debug port inaccessible after access at location 0x0400A1A8
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Wait in DAP access
Cannot halt processor
failed to halt target for postmortem - rc Ep(04). Cannot halt processor.
failed to read registers - Ep(08). Cannot access core regs when target running.
Flash Driver V.2 startup failed - rc Em(17). Debug port inaccessible after access at location 0x0400A1A8
Failed to erase flash: Em(17). Debug port inaccessible after access at location 0x0400A1A8
(100) Target Connection Failed
error closing down debug session - Nn(05). Wire ACK Wait in DAP access
Unable to perform operation!
Command failed with exit code 1

0 项奖励

1,699 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Dassom ,

 

Sorry for my late reply. I cost some time to find a right board. And tested on my side with LPC-Link, it works well.

If you have to use J-Link, could you please refer to this post? It is very detailed.

I think the most critical reason for this problem is that different jumper configurations need to be paid attention to when flashing with different drivers.

- LPC: using the default Jumper configurations, and usb link to J2. J1 is only power-up interface.

- J-Link : configuring as the post referred.

 

B.R.

Gavin

0 项奖励

1,685 次查看
Dassom
Contributor I

Hi @Gavin_Jia ,

Thanks again for your reply.

The thread you pointed out is about using J-Link to debug QN908x-DK board.

However, we are not using QN908x-DK. 

We built our own QN908x board and trying to debug it with any probes, J-Link or LPC-Link pro.

The logs show that both probes were able to connect to the QN908x chip but failed to erase flash with the given flash driver. 

Any suggestion on how to debug this issue would be greatly appreciated. Thanks!

 

0 项奖励

1,677 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Dassom

Thanks for your additional information.

Switching the board's boot mode to ISP mode maybe helpful for this issue.

Please find another jumper and connect JP15.

1. And try to erase flash with the GUI flash tool.

2. If it doesn't work, here is another way: using QN908x Programming Tool.

Gavin_Jia_0-1680577076163.png

Download it at this link.

 

Hope you are doing well!

 

B.R.

Gavin

 

标记 (1)
0 项奖励

1,647 次查看
Dassom
Contributor I

Hi @Gavin_Jia ,

Thank you so much for the advice.

1. When the board is put into ISP mode by jumper setting, MCU-Link pro/J-Link fail to connect to the QN908x chip.

2. QN908x Programming Tool also fails to connect to the ports shown below.

Dassom_0-1680735637724.png

Those bring some questions on our HW setup.

1. For ISP mode, is UART connection required in addition to SWD lines?

2. Are external crystal oscillators (34MHz and 32KHz) required for this operation?

This chip has internal oscillators. QN908x product data sheet 8.23.1.1 says "The internal 32 MHz oscillator can be used as a clock that drives the CPU. Upon power-up, or any chip reset, the QN908x uses the internal oscillator as the clock source. Software switches to one of the available clock sources later" 

So we assumed that the internal oscillators can be used in this operation.

 

 

 

 

0 项奖励

1,639 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Dassom ,

1. For ISP mode, UART connection is required in addition to SWD lines.

2. It use internal crystal oscillators 32MHz.

3. For QN908x Programming Tool , I flashed bin file via J2 LPC-Link.

 

B.R.

Gavin

0 项奖励

1,630 次查看
Dassom
Contributor I

Hi @Gavin_Jia ,

Thank you so much for the answers. 

In ISP mode, my understanding is that bin file will be downloaded through UART to flash memory, which will resolve downloading issue.

However, we would still need SWD working for debugging purposes.

1. Is there any test program to run or any test signal for us to check?  We would like to understand why this error is happening so that we can fix in the next revision if needed.

2. Is there a way to bypass flash erase/write steps and download binary to RAM and run it from there?

 

 

0 项奖励

1,615 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Dassom ,

I am very glad to hear that it is okay to download code to the board now.

And I think this post maybe useful for this situation. Will it solve your problem if you use other interfaces to put the board into ISP mode?

For the second question, I didn't find there is a way to bypass flash erase/write steps on QN9080. Sorry for any inconvenience.

 

B.R.

Gavin

 

0 项奖励

1,605 次查看
Dassom
Contributor I

Hi @Gavin_Jia ,

We haven't had a success in downloading in ISP mode either.

What I meant is even if ISP mode download worked, it wouldn't be sufficient. We still need debugging capability.

Can you please confirm MCU-LINK Pro and MCU-LINK officially support QN908x?

 

0 项奖励

1,552 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Dassom ,

You can use the same P1 connector with an external probe to program the QN9080, however, you need to isolate the LPC from these lines, as it interferes with the external debugger if powered on. The easiest way to do this is by powering the QN9080DK board via the J1 connector, this way only the QN9080 gets powered and the LPC remains off. So MCU-LINK Pro and MCU-LINK support QN908x as well.

 

B.R.

Gavin

0 项奖励