Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPC546XX sector writes issues which causes bootloader update failure #562

Open
brianesquilona opened this issue Jan 3, 2019 · 7 comments
Labels

Comments

@brianesquilona
Copy link
Contributor

A sequence of flash_erase_sector and flash_program_page in critical_erase_and_program will produce a mismatch in the binary being written (can be checked by LPCScrypt_CLI.cmd ).

Another issue is programming a memory from rom location will cause a fault, and will revert the interface chip to an LPC USB device, to be flashed by LPCScrypt.

@brianesquilona
Copy link
Contributor Author

@mmahadevan108 if you can check this issue for this HIC.

@mmahadevan108
Copy link
Contributor

Can you please provide steps to reproduce this failure.

@brianesquilona
Copy link
Contributor Author

@mmahadevan108 on interface mode, we should be able to update the bootloader, on a LPCXpresso546XX, you can try drag n drop a _bl (lpc4322_bl_crc.bin) file or bootloader binary for lpc4322.

@mmahadevan108
Copy link
Contributor

I am unable to drag-n-drop the bootloader binary. I see a FAIL.TXT file created on drag-n-drop with the below message.

The application file format is unknown and cannot be parsed and/or processed.

I am using the Interface firmware from the 251 release.

DAPLink Firmware - see https://mbed.com/daplink

Unique ID: 105600001984a78e00000000000000000000000097969905
HIC ID: 97969905
Auto Reset: 0
Automation allowed: 0
Overflow detection: 0
Daplink Mode: Interface
Interface Version: 0251
Bootloader Version: 0244
Git SHA: 9295000
Local Mods: 0
USB Interfaces: MSD, CDC, HID, WebUSB
Bootloader CRC: 0x68b2eac9
Interface CRC: 0x076c30cb
Remount count: 1
URL: https://os.mbed.com/platforms/LPCXpresso54608/

@brianesquilona
Copy link
Contributor Author

brianesquilona commented Jan 9, 2019

@mmahadevan108 , you have to turn on the automation for now, create a file AUTO_ON.CFG in the drive with the target reset asserted.

@mmahadevan108
Copy link
Contributor

cc @flit
After debugging I noticed a few issues in the implementation

  1. The code fails when executing the below line
    https://github.com/ARMmbed/DAPLink/blob/master/source/daplink/drag-n-drop/iap_flash_intf.c#L460

It is passing in a Flash location as write buffer instead of RAM address, this causes the LPC program algorithm to fail.

  1. I am not clear why there is an erase and program done on Line 460, my guess is you would like to intercept the erase so that is done during the final program on line 422 https://github.com/ARMmbed/DAPLink/blob/master/source/daplink/drag-n-drop/iap_flash_intf.c#L422

  2. Line 422 is intending to program a sector however only 1 page is written, can you please clarify.

@brianesquilona
Copy link
Contributor Author

@mmahadevan108

  1. Yes, this is easy to fix.

  2. L460 is a precaution, in case something bad happened during programming of bootloader, it will revert to your interface program, the intent is just for vectors, but flash has a minimum write size.

  3. L422 will program a sector starting from the bootloader address, this was done at the end for the same purpose as 2. Although it will call flash_program_page, the size is for the whole sector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants