Which way to go to separate NOR flash into multiple volumes

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Which way to go to separate NOR flash into multiple volumes

    Hi all,

    We have a NOR-flash chip connected via SPI to the micro-controller.
    We want to separate the available memory space of this chip into different volumes.
    This separation is static and will never be changed.
    One volume shall be mounted read-only to avoid accidentally deleting it.
    A separate "log volume" shall ensure the "root file system" can not be filled up by log files.

    My question is: which is the way to go?
    a) Use a Master Boot Record, or
    b) call FS_NOR_BM_Configure() multiple times with varying StartAddr and NumBytes, or
    c) is there a better way to split a single NOR-flash into separate volumes?

    Volumes might be used from different threads simultaneously.
    Is there anything to be considered regarding locking of the shared resource SPI bus in scenarios a) or b)?

    Thanks
    Stefan
  • Hello Stefan,

    You can use FS_LOGVOL_Create()/FS_LOGVOL_AddDevice() functions to create
    two separate volumes on the NOR flash. An example is provided in the section
    "4.3.7 FS_LOGVOL_AddDevice()" of the emFile manual.

    The volumes can be accessed from different tasks provided FS_OS_LOCKING
    is set to 1 or 2.

    Best regards,
    Marius
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.