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

fixed ESP32-C3: "app image at 0x10000 has invalid magic byte" if the … #50

Merged
merged 1 commit into from Nov 10, 2022

Conversation

LeoYan
Copy link
Contributor

@LeoYan LeoYan commented Nov 3, 2022

Fixed issue #48

if fileArray[i].data.length % 4 == 0, there will be extra 4 bytes, so overlap with the following image
image = fileArray[i].data + '\xff\xff\xff\xff'.substring(0, 4 - fileArray[i].data.length % 4);
btw:

  1. the address of C3 bootloader is 0x0

Copy link
Collaborator

@adwait-esp adwait-esp left a comment

Choose a reason for hiding this comment

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

Minor comments else changes look good

image = fileArray[i].data + '\xff\xff\xff\xff'.substring(0, 4 - fileArray[i].data.length % 4);

image = fileArray[i].data;
const reminder = fileArray[i].data.length % 4;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Changes look good. Minor typo suggestion - can we call it remainder instead of reminder?

ESPLoader.js Show resolved Hide resolved
@adwait-esp adwait-esp merged commit 076af26 into espressif:main Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants