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

Checksum the vector table of the LPC546XX #8319

Merged
merged 1 commit into from
Oct 25, 2018

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Oct 3, 2018

Description

LPC devices require a checksummed vector table to boot. To ensure this most programmers automatically compute the checksum when programming flash. This causes problems with verification if the original image does not have a checksummed vector table. This is because when reading the data back the checksum location differs from the original image.

To fix this verification failure this patch adds a post build hook to checksum the vector table of the LPC546XX. This fixes flash verification failures due to the checksum not matching.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change

@c1728p9
Copy link
Contributor Author

c1728p9 commented Oct 3, 2018

CC @studavekar @0xc0170 @kjbracey-arm

@mmahadevan108
Copy link
Contributor

@c1728p9 Thank you. Can you please make the same change for LPC54114.

@c1728p9 c1728p9 force-pushed the checksum_546xx_vector_table branch from f0307b6 to 04113df Compare October 3, 2018 17:12
@c1728p9
Copy link
Contributor Author

c1728p9 commented Oct 3, 2018

Updated for the LPC54114

Copy link
Contributor

@mmahadevan108 mmahadevan108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

Copy link
Contributor

@brianesquilona brianesquilona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better than implementing verify in flash algo just to skip the checksum area.

@kjbracey
Copy link
Contributor

kjbracey commented Oct 4, 2018

Everyone else seems to do be doing this via "inherits": ["LPCTarget"]. Any reason to break the pattern?

@c1728p9
Copy link
Contributor Author

c1728p9 commented Oct 4, 2018

Everyone else seems to do be doing this via "inherits": ["LPCTarget"]. Any reason to break the pattern?

@mmahadevan108 you added this target. Is there a reason this didn't inherit from LPCTarget? Should I update this PR so the targets inherit from LPCTarget?

@mmahadevan108
Copy link
Contributor

Please do. I was not aware of the availability of this feature inside mbed-os at the time I added these targets. Thank you.

@c1728p9
Copy link
Contributor Author

c1728p9 commented Oct 9, 2018

I rebased this PR to master and updated it to inherit from LPCTarget

@cmonr
Copy link
Contributor

cmonr commented Oct 13, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 13, 2018

Build : FAILURE

Build number : 3345
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8319/

LPC devices require a checksummed vector table to boot. To ensure
this most programmers automatically compute the checksum when
programming flash. This causes problems with verification if the
original image does not have a checksummed vector table. This is because
when reading the data back the checksum location differs from the
original image.

To fix this verification failure this patch adds a post build hook to
checksum the vector table of the LPC54XXX. This fixes flash
verification failures due to the checksum not matching.
@c1728p9
Copy link
Contributor Author

c1728p9 commented Oct 23, 2018

Reverted this PR to the previous implementation which just adds the post build hook. When these targets inherit from LPCTarget a second EMAC driver is pulled in and causes build errors:
https://github.com/ARMmbed/mbed-os/tree/master/features/netsocket/emac-drivers/TARGET_NXP_EMAC/TARGET_LPCTarget

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

Build : SUCCESS

Build number : 3453
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8319/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

@cmonr cmonr merged commit dd2d9ee into ARMmbed:master Oct 25, 2018
@c1728p9 c1728p9 deleted the checksum_546xx_vector_table branch January 2, 2019 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants