LPC54114 problem in uploaded code

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

LPC54114 problem in uploaded code

Jump to solution
2,425 Views
Dineshkumar_J
Contributor III

Hi,

I created my own sketch for the LPC54114 MCU using MCU Xpresso IDE. when I compile and debug the code it works fine. that means I can check my algorithm working fine and can read the respected data in console window. but after I stop the debug mode the code is not running by just powering up the board.

But when I do same process with example codes it works fine in debug mode and also by power it up.

I think I made a mistake in configuration settings. Can anyone help me to get out of this problem.

I am using LPCXpresso54114 evaluation board.

 

Thank you.

Labels (4)
1 Solution
2,101 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Dineshkumar J,

Unfortunately, I'm not able to reproduce the behavior you mentioned. Here are the steps I'm following to create the new project. 

Select New project in the Quickstart Panel

pastedImage_1.jpg

Select your development board, in this case LPCXpresso 54114.

pastedImage_2.jpg

 Select UART as the SDK debug console. 

pastedImage_3.jpg

Leave default properties in Advanced project settings and click on finish. 

pastedImage_4.jpg

When I enter to the debug session I'm able to see the Hello World printed in the terminal. If I exit the debug session and I reset the board I'm also able to see the Hello World in the terminal, so the project is still there once I exit the debug session.  

pastedImage_5.jpg

Could you please follow these steps and try with a simple project that just prints Hello World in the terminal? 

Hope it helps!

Victor.

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

Note: If this post answers your question, please click the Correct Answer button. Thank you!

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

View solution in original post

0 Kudos
Reply
12 Replies
2,101 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Dineshkumar J,

How are you creating the new project? Are you using the New project wizard? It sounds like you are saving the program in the RAM memory, this is why you are loosing the program. 

In the MCU settings of your project you should see the Flash memory at the top, could you please confirm this on your side? 

pastedImage_1.png

 

Regards,

Victor.

0 Kudos
Reply
2,101 Views
Dineshkumar_J
Contributor III

Hi victor,

I used a new project wizard to create a project. I checked my memory settings and flash memory was configured in memory settings of my project.

Thank you.

0 Kudos
Reply
2,101 Views
converse
Senior Contributor V

Are you using printf to the console? If so, that only works when debugging - otherwise it will hang, waiting for the debugger.

0 Kudos
Reply
2,101 Views
Dineshkumar_J
Contributor III

I don't think it could be the problem because printf command also used in the example codes but it still working after the debug closed.

0 Kudos
Reply
2,101 Views
converse
Senior Contributor V

Your project is probably configured semihosting printf : See section 15.4, "What is Semihosting?" (and in particular section 15.4.5,"Semihosted printf and Debugging"), of the MCUXpresso IDE v10.2.0 User Guide for details.

 

Either ensure that you have the hard fault handler in your project, or else you can probably use Quick Settings to reconfigure the PRINTF macro to point to the UART DEBUG_CONSOLE system (see section 18.1, "Quick Settings" for details).

2,101 Views
Dineshkumar_J
Contributor III

Hi,

Now I removed all PRINTF lines from my code but the problem still occurs. It runs in debug mode but not in normal mode.

I think there may be a any other problem which causes this.

I need to solve this problem as soon as possible.

Thank you.

0 Kudos
Reply
2,102 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Dineshkumar J,

Unfortunately, I'm not able to reproduce the behavior you mentioned. Here are the steps I'm following to create the new project. 

Select New project in the Quickstart Panel

pastedImage_1.jpg

Select your development board, in this case LPCXpresso 54114.

pastedImage_2.jpg

 Select UART as the SDK debug console. 

pastedImage_3.jpg

Leave default properties in Advanced project settings and click on finish. 

pastedImage_4.jpg

When I enter to the debug session I'm able to see the Hello World printed in the terminal. If I exit the debug session and I reset the board I'm also able to see the Hello World in the terminal, so the project is still there once I exit the debug session.  

pastedImage_5.jpg

Could you please follow these steps and try with a simple project that just prints Hello World in the terminal? 

Hope it helps!

Victor.

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

Note: If this post answers your question, please click the Correct Answer button. Thank you!

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

0 Kudos
Reply
2,101 Views
Dineshkumar_J
Contributor III

Hi victorjimenez,

I tried your solution it works great. 

The problem is when I use this settings with my coding it produce the same problem. So that I debugged the entire coding step by step. Then I figured out the real problem. My coding is entirely based on the current time based switching condition. For getting current time I used the clock() function described in the time library. This returns the correct value in the debug mode. But not in the running mode. To confirm this I unindent the clock function write the simple blinking condition based on input it works fine, and also I created a new project to print the clock() functions return value. It output is strange not like the expected one.

I would like to know alternate solution for getting current time or reason behind this strange action.

Thank you.

Have a great day!

0 Kudos
Reply
2,101 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Dineshkumar J,

You want to get the current time in the format hh:mm:ss? If so, I recommend you to check the example of the RTC module that comes with the SDK.  

Hope it helps!

Victor.

0 Kudos
Reply
2,101 Views
Dineshkumar_J
Contributor III

No, Not in that format. I just need it as the incremental value or in terms of seconds only. based upon that value and input I have to switch the condition.

For more clear explanation it is same as the millis() function in the Arduino IDE.

0 Kudos
Reply
2,101 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Dineshkumar J,

 

If you want to have a precision of seconds, then I highly recommend you to use the internal RTC instead of the time library. 

Hope it helps!

Victor.

0 Kudos
Reply
2,101 Views
Dineshkumar_J
Contributor III

Hi,

My project is automatically configured with the hard fault handler by IDE.

And also I can't able to change to change the Quick settings>SDK DEBUG CONSOLE settings it is blurred and I can't able to access it.

0 Kudos
Reply