Page 1 of 1

Have to flash twice

Posted: Wed Mar 28, 2012 8:08 pm
by matty3269
Hi there,

I seem to be having a weird problem. I have an ELF file that I'm trying to upload onto my board, LPC1768.

I firstly erase the flash:
Code: Select all
flash erase_address 0 0x1000
then double check that went okay:

Code: Select all
> arm disassemble 0x130 5                                            
0x00000130  0xffffffff  (32-bit Thumb2 ...)
0x00000134  0xffffffff  (32-bit Thumb2 ...)
0x00000138  0xffffffff  (32-bit Thumb2 ...)
0x0000013c  0xffffffff  (32-bit Thumb2 ...)
0x00000140  0xffffffff  (32-bit Thumb2 ...)

next I try and upload the elf...


flash write_image /home/matthew/Development/ucont/temp/temp/main.elf
Verification will fail since checksum in image (0x00000000) to be written to flash is different from calculated vector checksum (0xefff7b48).
To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
wrote 1136 bytes from file /home/matthew/Development/ucont/temp/temp/main.elf in 1.024985s (1.082 KiB/s)


and then I double check

Code: Select all
> arm disassemble 0x130 5                                             
0x00000130  0x466d      MOV     r5, r13
0x00000132  0xf0300d07  BICS    r13, r0, #7     ; 0x00000007
0x00000136  0x46cd      MOV     r13, r9
0x00000138  0xf3c067fd  UBFX    r7, r0, #27, #30
0x0000013c  0xff01fbee  (32-bit Thumb2 ...)

This should not be the code generated I even get an undefined instruction. So I uplaod a second time...


> flash write_image /home/matthew/Development/ucont/temp/temp/main.elf
Verification will fail since checksum in image (0x00000000) to be written to flash is different from calculated vector checksum (0xefff7b48).
To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
wrote 1136 bytes from file /home/matthew/Development/ucont/temp/temp/main.elf in 1.025992s (1.081 KiB/s)


and do one final check,

Code: Select all
> arm disassemble 0x130 5                                             
0x00000130  0x4668      MOV     r0, r13
0x00000132  0xf0200107  BIC     r1, r0, #7      ; 0x00000007
0x00000136  0x468d      MOV     r13, r1
0x00000138  0xf24023cd  MOVW    r3, #717        ; 0x2cd
0x0000013c  0xb501      PUSH    {r0, r14}

and this is the correct code. Does anyone have any idea's what I'm doing wrong?

Many Thanks,
Matt