Time out while initializing flash if CTimer3 output is wired to PINT interrupt pin.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Time out while initializing flash if CTimer3 output is wired to PINT interrupt pin.

2,010 Views
jmueckl
Contributor IV

I am using CTimer3 as a 100ms timer to initiate a PINT Pin interrupt which in turn sets a flag that is tested in a while loop in main.  This requires jumping the CTimer3 output’s header receptacle to that of the PINT input header receptacle.  However, I cannot jumper the two header pins before I flash the board using the blue bug icon.  If I forget to remove the jumper, I obtain the following error.  How can I program the flash leaving the jumper inserted?      

Opening flash driver LPC540xx_SPIFI_SFDP.cfx

Using SOFT reset to run the flash driver

Cannot halt processor

warning - failed to halt processor on startup timeout - rc Ep(04). Cannot halt processor.

Flash Driver V.2 startup failed - rc Ef(34): Timed-out initializing flash.

chip initialization failed - Ef(34): Timed-out initializing flash.

failed to initialize flash driver LPC540xx_SPIFI_SFDP.cfx

 

I get the same error flashing the LPC54018 OM40003UL from my laptop’s USB port as I do if I flash the LPC54018 through my separate LPC-Link2 board. 

The relevant code is attached.

Labels (1)
0 Kudos
12 Replies

1,930 Views
jmueckl
Contributor IV

Alice,

The project you sent me doesn't display the error I originally specified while the program is being flashed.  It looks like you resolved it. Xie xie.  Now please explain what you did and why my code may have failed.    

0 Kudos

1,893 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello jmueckl,

I really did nothing, just create a new project, then copy your code into it.

 

BR

Alice

0 Kudos

1,889 Views
jmueckl
Contributor IV

Alice,

Like you, I created a new project and copied all of my project files into it.  However, rather than create a C project as you did, I created a C++ project, just like my original project.  Unfortunately, I still get the same flash error unless I remove the jumper I described. 

I looked at my header files to see if any of the functions I called in main were outside of my #if defined(__cplusplus)  statement, but found them all to be included.  That is often the reason a C++ project fails if the code works in a C project.

Please let me know if you have any further thoughts.  If not, I’m not able to qualify your fix as a solution for my C++ project, and I will continue to remove and attach my jumper each time I flash for debug.

0 Kudos

1,886 Views
converse
Senior Contributor V

Make sure your interrupt handlers are defined as extern “C” - this is a very common issue.

0 Kudos

1,993 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello jmueckl,

Please show the detail steps that how to use LPC54018 OM40003UL to reproduce your issue,

then I will help to check it on my side, thanks.

 

BR

Alice

0 Kudos

1,989 Views
jmueckl
Contributor IV

Import the project I have attached and build it.  No errors should result.

Plug J8 of the OM40003 into the USB port of the host

Hit the blue bug icon to flash the program and then Run the debugger.  Jumper J13 pins 1 & 5.  The program will not do anything visible, but just the fact that it doesn't crash is good enough for this test. 

Hit the red terminate button.

Jumper J13 pins 1 & 5 should still be jumpered.

Hit the blue icon to flash the program and Run the debugger.  The debug error I described will result.

J13 pin 5 is the output of CTimer3 which outputs a 10Hz square wave.  

J13 pin 1 is the input to PINT2, which initiates pint_intr_callback() on the rising edge of Ctimer3's 10Hz output. 

You should not have to disconnect J13 pins 1 & 5 for debug to run.  What is causing this issue?

0 Kudos

1,974 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello jmueckl,

I have test your project on my side, the same with you.

Because the J13 pin5 (P3_14) have the function of TRACEDATA, you can see from UM11060:

Alice_Yang_0-1622690627050.png

So I think the reason is, after you download the project one time, before next time, the code is running on your chip, this TRACEDATA pin (J13 pin5 ) is sending  10Hz square wave, not the correct Tace data debugger need, so failed.

You can test other SDK demo also connect the J13 pin1 and pin5, it can connect to the debugger can download well.

 

BR

Alice

 

0 Kudos

1,966 Views
jmueckl
Contributor IV

Alice,

Are all four TRACEDATA signals exercised at the same time?  I attempted to use P3_10 @ J3[7] instead of P3_13 @ J3[5] and obtained the same result. P3_10 is also used for TRACEDATA[0]. Also, are these signals exercised all of the time that I am debugging?

0 Kudos

1,962 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello jmueckl,

I'm not very sure the reason, only can confirm this is related your code.

Recommend removing the jumper before debug, or easing whole flash before debug. 

 

BR

Alice

0 Kudos

1,957 Views
jmueckl
Contributor IV

Alice,

Please provide information regarding the four TRACEDATA signals.  It's okay if it takes a few days. 

What data is sent via these signals?

Is the data sent in parallel and simultaneously? 

Please confirm that they are only used at the beginning of the debug session and not for the entire debug session.

 

0 Kudos

1,939 Views
jmueckl
Contributor IV

I'm going to ask the same question in a different way.  I will be spinning a PCB with my current firmware.  If I want to be able to debug the new board, what do I need to do with the TRACEDATA signals?  Do they still get connected as they are on my LPC54018 development board?  If that is the case, then I cannot use the same processor pins for another purpose, such as a timer.

0 Kudos

1,936 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello jmueckl,

Sorry for my last comment, that is wrong guess. There is no relationship with TRACEDATA signals.

The problem maybe is your project , I create a new one , then copy your code into it , it can work well, please see my attachment.

 

BR

Alice

0 Kudos