Hi!
I got the Ethernet connection working to my bootloader. FM successfully erases selected flash blocks and FM can read the flash memory of my LPC2366 on my own PCB board.
But... When it comes to writing the new .hex file to the flash something goes wrong.
The message Operation Failed. (programming - failed to send data to the device) pops up and the procedure stops. (Allthough FM reports Finished at the status field at the bottom of the program).
The erased flash blocks are the ones used by the new .hex file. Block 5 - 10.
I managed to run the UART debug to see what happends during flash write. This is what happends:
LPC Rx: U 23130
LPC Tx: 0
LPC Rx: W 1073742336 512.
LPC Tx: 0
LPC Rx: ...Data...
...
LPC Rx: ...Data...
LPC Rx: 44524
LPC Tx: OK
LPC Rx: W 1073742848 512
Here it stops...
In the Rowley debugger, it seems as the code runs into a dabort_handler.
Any ideas?
Please see the debug file attached.
Regards
Please send us your hex file and reference this thread in your email. We will try it here.
Andy
Hi Andy!
Thank you for your answer! Here comes the WEB.hex file.
http://forum.flashmagictool.com/index.php?topic=3601.msg4665#msg4665
Regards
Daniel
I tried your hex file with an LPC2388 on a Keil MCB2300 board and it worked fine for me.
When the transfer stops Flash Magic is waiting for a response from the bootloader to the "W 1073742848 512" command. It should return "0". I'm not sure why it is aborting. I will try to get a LPC2366 to test with, but it could take some time.
Andy
Hi Andy!
Thank you for the info and your time testing. Sounds strange that it works with LPC2388 but not with mine 2366...
I will continue to try identify the problem too.
Regards
Andy.
I think I have located were the programming goes wrong... At this location:
for(no_of_param=0;no_of_param<NO_OF_ISP_PARAMS;no_of_param++)
{
*(param_buf[no_of_param]) = 'z'; //When executing this line, the CPU goes to dabort_handler
}
in isp_iap.c.
In assembler the code looks like this:
*(param_buf[no_of_param]) = 'z';
E51B201C ldr r2, [r11, #-0x01C]
E59F31C8 ldr r3, [pc, #+0x1C8]
E7932102 ldr r2, [r3, +r2, lsl #0x02]
E3A0307A mov r3, #0x0000007A
E5C23000 strb r3, [r2] //At this line the problem comes.
Any ideas why?
Regards
Please post back attaching the .map file for the ethernet bootloader project.
Andy
Here comes the file
/D
Sorry, wrong file. I want the memory map file generated by the linker. The Keil tools save this as <projectname>.map.
If you are compiling the bootloader with something other than the Keil tools then I would suspect your compiler/linker configuration as the cause somehow. The only compiler/linker I've personally tested the bootloader with is Keil.
Andy
Ofcource, how stupid of me... Here is the map file generated after linking in Rowley Cross studio.
/D
To my knowledge the Ethernet bootloader has only been tested with the Keil tools. There are many reasons why a port to another set of tools could cause problems for a bootloader, and as we haven't used Rowley ourselves we don't know what the problem could be.
For starters I see errors in your map file. You need to address all errors your program generates.
error: .vectors_ram is too large to fit in SRAM memory segment
error: .vectors is too large to fit in FLASH memory segment
error: .init is too large to fit in FLASH memory segment
.text is too large to fit in FLASH memory segment
error: .dtors is too large to fit in FLASH memory segment
error: .ctors is too large to fit in FLASH memory segment
error: .rodata is too large to fit in FLASH memory segment
error: .fast_run is too large to fit in SRAM memory segment
error: .data_run is too large to fit in SRAM memory segment
and plenty more...
Andy