cr_startup_lpc13xx.c AND INTERRUPT PROBLEM

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

cr_startup_lpc13xx.c AND INTERRUPT PROBLEM

847 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dimaios on Wed Jul 22 09:09:22 MST 2015
Hi,
     I'm using version LPCXpresso v7.8.0 [Build 426] [2015-05-28] of the IDE.

I've created a new project importing the library lpcopen_2_05_lpcxpresso_nxp_lpcxpresso_1347.zip

I'm using a testing board LPCXpresso LPC1347.

I've built and debugged the sample periph_uart_rb and [u]everything was ok[/u].

I've created a new project to test the UART starting from the file uart_rb.c.

The IDE [u]auto generates[/u] the files sysinit.c and cr_startup_lpc13xx.c.

I've simply copied the content of uart_rb.c into my main file.

RESULT : the application doesn't work.

The problem starts when the UART interrput is enabled.

[color=#06f]NVIC_EnableIRQ(UART0_IRQn); [/color]<<<===== Put a breakpoint here

.... pausing the code execution you can see that the program is running into this code section of the cr_startup_lpc13xx.c file.

[color=#0c3]//*****************************************************************************
//
// Processor ends up here if an unexpected interrupt occurs or a handler
// is not present in the application code.
//
//*****************************************************************************[/color]
[color=#33f]__attribute__((section(".after_vectors")))
void IntDefaultHandler(void) {
//
// Go into an infinite loop.
//
while (1) {
}
}[/color]

OBSERVATION :

The cr_startup_lpc13xx.c file generated by the new IDE is different from the old one you can find into the  uart_rb.c folder.

Overwriting the new file ( auto generated by the IDE ) with the old one everything works well!  :~

I don't understand why .... it seems that the interrupt isn't correctly linked to the callback ....
I've checked all compiler directives and option .... I never found differences.

Any idea ?

Thanks.



Labels (1)
0 Kudos
Reply
5 Replies

808 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dimaios on Thu Jul 23 08:32:08 MST 2015
[color=#0c6]If you created a project for LPC1347, using the LPC13xx (12-bit ADC) wizards, then the startup file will be called cr_startup_lpc13uxx.c - with the "13u" in the filename being critical.[/color]

Perfect. I've found the bug. During wizard for some reason the file was created without the "u" letter.
Following your suggestion I've solved the problem.

Thank you very much.
0 Kudos
Reply

808 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Jul 23 00:18:01 MST 2015
If you created a project for LPC1347, using the LPC13xx (12-bit ADC) wizards,  then the startup file will be called cr_startup_lpc13uxx.c - with the "13u" in the filename being critical.

If you create a new project and the startup file is called cr_startup_lpc13xx.c - then you have used the wrong wizard.

I suggest that if you are still having problems, export and post your project.

https://www.lpcware.com/content/faq/lpcxpresso/how-importexport-projects

Regards,
LPCXpresso Support
0 Kudos
Reply

808 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Jul 23 00:14:52 MST 2015
Could be a good idea to post this project...
0 Kudos
Reply

808 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dimaios on Wed Jul 22 23:51:37 MST 2015
Thanks for your reply.

__USE_LPCOPEN was included in the symbols list and the project was create choosing the "LPC13xx (12-bit ADC)" MCU but the application doesn't work anyway.


0 Kudos
Reply

808 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Wed Jul 22 09:24:49 MST 2015
try defining __USE_LPCOPEN

Edit: BTW: When using the New Project... wizard, for LPC1347 make sure you choose "LPC13xx (12-bit ADC)" and not "LPC13xx" as they are quite different.
0 Kudos
Reply