• AVR Freaks

Hot!Many bugs Harmony V3 SST26 (SQI) and MPFS file system

Author
boatbodger
Starting Member
  • Total Posts : 46
  • Reward points : 0
  • Joined: 2011/03/27 15:39:07
  • Location: 0
  • Status: offline
2019/10/24 17:35:24 (permalink)
0

Many bugs Harmony V3 SST26 (SQI) and MPFS file system

Bug 1: Upload does not complete:
I am finding that the MPFS Upload stalls because after the first call to SYS_FS_MEDIA_MANAGER_SectorWrite() subsequent calls to SYS_FS_MEDIA_MANAGER_CommandStatusGet() never return with SYS_FS_MEDIA_COMMAND_COMPLETED.
They always return 0xFFFF
I believe this is because the means of the DMA notifying completion "up the stack" may be broken.
I notice that the Harmony Configuration tool has set the following:
    .isMemDevInterruptEnabled = false,

which would seem to me to be wrong, as whilst the memory chip itself does not have an interrupt line, the DMA driving it *can* interrupt to say "done it, boss".
Does anybody know whether I should alter this setting?
The symptoms may look slightly similar to another post with a similar title, but Luciano's post appears to derive from problems with cache issues - I don't think that's the case for this particular problem - although I guess I may run into that later.
 
post edited by boatbodger - 2019/11/05 10:44:29
#1

4 Replies Related Threads

    boatbodger
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2011/03/27 15:39:07
    • Location: 0
    • Status: offline
    Re: Bug 1 Harmony SST26 (SQI) and MPFS file system - upload writes never complete 2019/11/04 11:12:37 (permalink)
    5 (1)
    I eventually traced this to a bug in drv_memory.c.
    There needs to be a 'break' at line 579 to prevent fall-through to the READ_SECTOR label, as a) reading is un-necessary (because we're at page erase boundaries) and b) there is not enough read buffer declared (by default) to hold a whole erase chunk - 4096 bytes.  So if you *do* fall through to READ_SECTOR the next thing that happens is that HandleRead fails.
    post edited by boatbodger - 2019/11/05 10:45:45
    #2
    boatbodger
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2011/03/27 15:39:07
    • Location: 0
    • Status: offline
    Re: Many bugs Harmony V3 SST26 (SQI) and MPFS file system - Bug 2 2019/11/05 10:47:47 (permalink)
    0
    Bug 2: File system not recognised on mount
    This is because by default Harmony uses a different volume name for an external SQI volume and for an Program Flash volume.  Modify configuration.h to use the volume name "mtda1" for the web server volume to fix this.
    post edited by boatbodger - 2019/11/05 10:51:09
    #3
    boatbodger
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2011/03/27 15:39:07
    • Location: 0
    • Status: offline
    Re: Many bugs Harmony V3 SST26 (SQI) and MPFS file system - Bug 3 2019/11/05 10:49:53 (permalink)
    0
    Bug 3: Problems within the MPFS.c module on mounting (previous one was in sys_fs)
    For some reason, when MPFS calls SYS_FS_MEDIA_MANAGER_Read(), the buffer address it gives does not receive the data from the DMA-driven SST26.
    This turns out to be because - by default - variables are located in cached memory (which - on the PIC32MZ - starts at virtual address 0x8000_000).  The DMA does not have write-access to the CPU cache, so it all goes horribly wrong.
    Using the macro CACHE_ALIGN (which is defined in toolchain_specifics.h) pulls in the __attribute__(( coherence )) to the variable, and then the DMA reads work correctly.
    so change:
    static MPFS_FILE_OBJ gSysMpfsFileObj[SYS_FS_MAX_FILES];

    to read
    static MPFS_FILE_OBJ CACHE_ALIGN gSysMpfsFileObj[SYS_FS_MAX_FILES];

    and similarly treat gSysMpfsFileRecord and gSysMpfsObj
    Then things start to work...
     
    post edited by boatbodger - 2019/11/06 04:51:44
    #4
    boatbodger
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2011/03/27 15:39:07
    • Location: 0
    • Status: offline
    Re: Many bugs Harmony V3 SST26 (SQI) and MPFS file system 2019/11/05 10:58:15 (permalink)
    0
    Bug 4 (or Feature 1):
    You need to use the right mpfs generator.  Version 3.3.5 seems to generate files of a format acceptable to the mpfs2 system.  Version 3.3.0 does not, as far as I can tell.  Both are in the same folder, and 3.3.5 has an earlier date than 3.3.0.
    Version 3.3.0 has more buttons (includes dsPic24 and MDD, whatever that is).
      Go figure.
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5