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

Projects
None yet
7 participants
@c1728p9
Contributor

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 c1728p9 requested review from mmahadevan108 and brianesquilona Oct 3, 2018

@c1728p9

This comment has been minimized.

Contributor

c1728p9 commented Oct 3, 2018

@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Oct 3, 2018

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

@c1728p9 c1728p9 force-pushed the c1728p9:checksum_546xx_vector_table branch from f0307b6 to 04113df Oct 3, 2018

@c1728p9

This comment has been minimized.

Contributor

c1728p9 commented Oct 3, 2018

Updated for the LPC54114

@mmahadevan108

Thank you

@brianesquilona

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

@kjbracey-arm

This comment has been minimized.

Contributor

kjbracey-arm commented Oct 4, 2018

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

@c1728p9

This comment has been minimized.

Contributor

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

This comment has been minimized.

Contributor

mmahadevan108 commented Oct 4, 2018

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

@0xc0170 0xc0170 added needs: work and removed needs: review labels Oct 4, 2018

@c1728p9 c1728p9 force-pushed the c1728p9:checksum_546xx_vector_table branch from 04113df to 8a23fcb Oct 9, 2018

@c1728p9

This comment has been minimized.

Contributor

c1728p9 commented Oct 9, 2018

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

@0xc0170

0xc0170 approved these changes Oct 9, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Oct 13, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Oct 13, 2018

Checksum the vector table of the LPC54XXX
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 c1728p9 force-pushed the c1728p9:checksum_546xx_vector_table branch from 8a23fcb to 06c825f Oct 23, 2018

@c1728p9

This comment has been minimized.

Contributor

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 0xc0170 added needs: CI and removed needs: work labels Oct 24, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 24, 2018

/morph build

@mbed-ci

This comment has been minimized.

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

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr cmonr added ready for merge and removed needs: CI labels Oct 24, 2018

@cmonr cmonr merged commit dd2d9ee into ARMmbed:master Oct 25, 2018

15 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed , RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Passed, 677 files (+0 files)
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 10262 cycles (-2 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@cmonr cmonr removed the ready for merge label Oct 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment