Git Product home page Git Product logo

Comments (7)

igrr avatar igrr commented on August 18, 2024

@timkoers this should be already supported. Just keep in mind that the emulation performance is pretty low, since every operation is first represented as SPI commands (serialized to bytes) which are then handled by SPI Flash chip emulation layer. If you are running one of the flash related examples, you need to wait a fair bit, especially if the code is formatting a large partition.

from qemu.

timkoers avatar timkoers commented on August 18, 2024

The examples that I could find where of the SD MMC and the internal flash. I'd like to emulate an external SPI flash. Whilst your at it, would you mind providing an example on how to create such a image to be used during qemu emulation?

from qemu.

igrr avatar igrr commented on August 18, 2024

Okay, I understand your use case now. Indeed there is no support for emulating external flash in QEMU with ESP32. In principle this should be doable, need to create another instance of the SPI controller (SPI2) and attach a flash chip to it in the emulator.

I would suggest you to try the emulation of the internal flash, first. It's pretty slow, so please make sure it is okay for your purposes before we try to add support for external flash.

Regarding creating the flash image of an app, you can follow the instructions in this wiki section: https://github.com/espressif/qemu/wiki#build-test-app

from qemu.

timkoers avatar timkoers commented on August 18, 2024

Can I also use the vfs_fat filesystem on the internal flash, it doesn't look so

I do see that I can use the SD card with the FatFS filesystem, but then I'll need to change every initialization function to use the SD card instead of the spi flash when unit testing, which defeats the point of unit testing, since I want to test if the SPI flash works, instead of the SD card 😋

from qemu.

igrr avatar igrr commented on August 18, 2024

You should be able to use the filesystem in the internal flash, please refer to storage/wear_levelling example in ESP-IDF.

from qemu.

igrr avatar igrr commented on August 18, 2024

Closing this issue since support for esp_vfs_fat_spiflash_mount for the internal flash is currently available, and works in QEMU.

from qemu.

timkoers avatar timkoers commented on August 18, 2024

I'd still like to see this getting implemented for an external flash since I don't want to mess around with the internal flash as that contains the actual program.

from qemu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.