Hello Kerry,
1)
the map file of bootlaoder indicates that the length is 0x4920:
.text 0x00000000 0x4920
2)
As for your second question, I think I've already answered in previous post: I've programmed periph_blinky AXF manually (FLASH start at 0x0000 8000) and it says page 1-1 has been flashed (that should be correct i believe)
This is output from flash tool:
Nt: Loading 'periph_blinky.axf' ELF 0x00008000 len 0x2408
Nc: Opening flash driver E:\nxp\LPCXpresso_8.2.2_650\lpcxpresso\bin\Flash\LPC5411x_256K.cfx
Nt: Writing 9224 bytes to address 0x00008000 in Flash
Pb: 1 of 1 ( 0) Writing pages 1-1 at 0x00008000 with 9224 bytes
Ps: ( 0) at 00008000: 0 bytes - 0/9224
Ps: (100) at 00008000: 16384 bytes - 16384/9224
Nt: Erased/Wrote page 1-1 with 9224 bytes in 341msec
Pb: (100) Finished writing Flash successfully.
Nt: Flash Write Done
Nt: Loaded 0x2408 bytes in 640ms (about 14kB/s)
If I enter bootloader debug, this is disassembly of location 0x8000:
00008000: movs r0, r0
00008002: movs r0, #1
00008004: strh r1, [r2, #16]
00008006: movs r0, r0
00008008: strh r1, [r4, #14]
0000800a: movs r0, r0
0000800c: strh r1, [r5, #14]
0000800e: movs r0, r0
00008010: movs r0, r0
00008012: movs r0, r0
00008014: movs r0, r0
00008016: movs r0, r0
00008018: movs r0, r0
When i step into (user_entry)();
000081e8: push {r7}
000081ea: add r7, sp, #0
000081ec: b.n 0x81ec
000081ee: nop
000081f0: push {r7}
000081f2: add r7, sp, #0
and according to blinky map file, this is the function:
0x000081e8 HardFault_Handler
It looks like rom binary perspective, everything is there.
I'm just not sure why HardFault_handler. What causes it?
What resides at 0x8000? First instruction or vector table?
Best regards,
Matej
PS: could it me an error in my calling blinky code?:
typedef void (*USER_ENTRY_PFN) ();
#define SBL_SLV_FIRMWARE_START (0x8000)
USER_ENTRY_PFN user_entry;
.
.
.
.
in main()
__disable_irq();
SCB->VTOR = SBL_SLV_FIRMWARE_START;
__enable_irq();
//__set_MSP(SCB->VTOR);//load stackpointer with initial value
__set_MSP(*(uint32_t *)SBL_SLV_FIRMWARE_START);
(user_entry)();