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

Question about flashing nand image on qcom arm #85

Open
mbanders opened this issue Nov 15, 2016 · 1 comment
Open

Question about flashing nand image on qcom arm #85

mbanders opened this issue Nov 15, 2016 · 1 comment

Comments

@mbanders
Copy link
Contributor

Someone has suggested that we should use $filesize for the line nand write in the function below.

They suspected (but didn't prove) that if you do nand write larger than the file size, then it will be filled with junk. Does that sound possible?

Maybe $filesize was tried for a while, but wasn't as good as using that calculated hsize?

    def nand_flash_bin(self, addr, size, src):
        # make sure we round writes up to the next sector size
        hsize = hex((((int(size, 0) - 1) / self.flash_block_size) + 1) * self.flash_block_size)

        self.sendline("nand erase %s %s" % (addr, size))
        self.expect("OK", timeout=90)
        self.expect(self.uprompt)
        self.sendline("nand write $fileaddr %s %s" % (addr, hsize))
        self.expect("OK", timeout=90)
        self.expect(self.uprompt)
@mattsm
Copy link
Contributor

mattsm commented Nov 15, 2016

The write could probably use the actual size. The erase probably need to erase the entire block because some fs will scan the entire block and give up if it sees old data. Although I'd think garbage could have the same problem.

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

No branches or pull requests

2 participants