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

Is it possible to write arbitrary data to flash memory? #447

Open
mortie opened this issue Dec 6, 2024 · 1 comment
Open

Is it possible to write arbitrary data to flash memory? #447

mortie opened this issue Dec 6, 2024 · 1 comment

Comments

@mortie
Copy link

mortie commented Dec 6, 2024

Hi,

I need to write some data that's generated on the fly (e.g not part of a .wic file) to flash as part of a manufacturing process. There are three ways I can see to approach this:

  1. Simply write the bytes to some pre-defined flash address. This seems like the simplest solution, and the one I think I prefer.
  2. Have an empty FAT partition specified in the .wic file, then run uuu commands to write a file to that FAT partition.
  3. Write the data to a u-boot environment variable and save that environment variable.

Does uuu have a way to achieve these things? I have looked into SDP: write in an attempt to implement solution 1, but haven't had much success. Nothing in uuu indicates failure, but the data simply isn't in the /dev/mmcblk2 block device after boot, so I might have misunderstood something.

For solution 3, FB: ucmd env save fails because u-boot doesn't know how to persist environment variables while in the uuu flashing mode. I haven't investigated thoroughly why this is.

@mortie
Copy link
Author

mortie commented Dec 6, 2024

I found a way to achieve solution 1: using the u-boot command mw, I can write the data I need into memory, and then using mmc write, I can copy from memory to MMC. I'll leave this issue open since I'm still interested in suggestions for other/better ways to achieve this, but feel free to close it at will.

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

1 participant