Skip to contentSkip to conversation

NAND Flash emulation?

DISCUSSION Rogan Dawes 1 participant 1 message Dec 31, 2024

lore
Share & tools
lore
#0 lore raw

Hi folks,

I am trying to modify a file on a UBI/UBIFS filesystem on a NAND flash on a locked down i.MX6UL device. I have desoldered the flash, and read it with an xgecu flash reader, but am now faced with the problem of trying to decode the flash (FCB, OOB, etc), mount the mtd partition, modify it, then convert the image back to something that can be written to the flash chip again.

I have tried nand_sim so far, without any luck. It appears that the version of UBI is no longer compatible with current kernels.

One alternative is to purchase an imx6ul_evk, solder the NAND onto the board, and boot from my own kernel. Another alternative I am considering (purely due to the cost of the EVK), is emulation.

I was wondering whether it might make more sense to try and run the kernel under emulation, pointing to a different root partition, mount the flash partitions, modify them under Linux control, and then write the resulting image back to the flash.

However, it seems that there is no GPMI implementation/emulation in qemu, and so this seems doomed to failure. Unless, that is, that I try to implement such emulation myself. I have no idea how complicated a task this would be, but it seems like it might be simpler than the other alternatives that I have considered so far.

Does anyone have any pointers on where I should start reading, on how to accomplish such a task?

Many thanks

Rogan