Error in cr_startup_lpc177x_8x.c

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

Error in cr_startup_lpc177x_8x.c

655 Views
otsl
Contributor III

In version 8.2.0_647, the new LPCOpen project wizard creates an erroneous cr_startup_lpc177x_8x.c startup file.

The error seems to come from the file template in ....\nxp\LPCXpresso_8.2.0_647\lpcxpresso\Wizards\System\NXP\LPC177x_8x\Common.

I know that the error was also at least in the previous 8.1.2 build and 8.0.0 build as well.

Line 184 of the file (interrupt vector table -- shown as line 10 in the snippet below) seems to contain a comment that shouldn't be a comment and should instead be on line 185...all of the vector locations are therefore offset by 1.  I'm not sure how this made it through so many versions of the IDE and didn't get noticed.  This has caused all sorts of headaches here over the last day trying to bring up a new board. 

void (* const g_pfnVectors[])(void) = {

    // Core Level - CM3

    &_vStackTop, // The initial stack pointer

    ResetISR,                           // The reset handler

    NMI_Handler,                        // The NMI handler

    HardFault_Handler,                  // The hard fault handler

    MemManage_Handler,                  // The MPU fault handler

    BusFault_Handler,                   // The bus fault handler

    UsageFault_Handler,                 // The usage fault handler

    __valid_user_code_checksum,         // LPC MCU Checksum    0,                                  // Reserved

    0,                                  // Reserved

    0,                                  // Reserved

    SVC_Handler,                        // SVCall handler

    DebugMon_Handler,                   // Debug monitor handler

    0,                                  // Reserved

    PendSV_Handler,                     // The PendSV handler

    SysTick_Handler,                    // The SysTick handler

0 Kudos
2 Replies

324 Views
lpcxpresso_supp
NXP Employee
NXP Employee

You appear to be correct. There is an issue with a missing newline, affecting only the LPC177x_8x startup code generated by the New project wizard, causing all of the interrupt handler entries in the vector table to be one position out of alignment. I think this issue was actually introduced back in LPCXpresso IDE v7.9.0 when we brought in the inline image checksum functionality (Creating an LPC valid image checksum directly in the image).

I'm sorry for the problems this has caused you. This will be fixed for our next toolchain release, but in the meantime, if you extract the two startup files from the attached ZIP file and placed them into

<LPCXpresso_install_dir>\lpcxpresso\Wizards\System\NXP\LPC177x_8x\Common

to replace the versions already in that directory,  then any new projects you create should not be affected.

Regards,

LPCXpresso Support

0 Kudos

324 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Sorry for the trouble. We'll look into this.

Thanks and regards,

LPCXpresso Support

0 Kudos