Hi jeremyzhou,
Thanks for the reply.
Please find below steps to replicate the issue and board, code which i used for my testing
Board used : LPCXpresso4337 Development Board (Link FYI: LPCXpresso4337 Development Board|NXP ).
Code used : LPC4337_multiple_flash example code(Download Link : Configuring projects to span multiple flash devices | www.LPCware.com ).
1. Download code from above code link.
2. Import into LPCXpresso IDE and compile(without any changes in project).
3. Connect LPCXpresso4337 board to PC and start debug(JTAG).
Code :
int main(void) {
volatile unsigned addr;
addr = (unsigned) const_data_table;
printf("const_data_table at address : %#010x\n", addr);
printf("%#010x %#010x %#010x %#010x\n", const_data_table[0], const_data_table[1],
const_data_table[2], const_data_table[3]);
printf("Calling spifi_func\n");
addr = spifi_func(); ---------------------------->>Jumping to hardfault handler
printf("spifi_func at address : %#010x\n", addr);
// Force the counter to be placed into memory
volatile static int i = 0;
// Enter an infinite loop, just incrementing a counter
while (1) {
i++;
}
return 0;
}
Please find remaing code files in project(Download link provided above)
Output Log :
const_data_table at address : 0x14000010
0xdeadbeef 0xbaddcafe 0xfacefeed 0x000ff1ce
Calling spifi_func
After this it is jumping to Hardfault handler
Revert me back for more details required.
Thanks & Regards,
Mllikarjuna