µC/FS Migration Guide

Migrating from V4.06.01 to V4.07.00

The following is a comprehensive list of the modifications you must apply to your µC/FS projects to update them to V4.07.00 from V4.06.01. The changes are easy to make and updating your project should take a short time.

New source code

µC/FS V4.07.00 is comprised of mostly bugfixes and minor changes in existing modules. The first step is to replace every file of your project by the new ones.

Updated requirements

An update of µC/LIB to V1.38.00 is required for µC/FS V4.07.00 to successfully build due to the usage of a new macro introduced in V1.38.00.

API changes

NAND Generic controller Board Support Package (BSP) API changes

The NAND generic controller now supports 16-bit NAND parallel devices. The DataWr() and DataRd() functions now take the width, in bits, of the requested bus access. See Board Support Package for API details.

Existing implementations may ignore the 'width' argument and assume 8-bit operation and return error code FS_ERR_INVALID_ARG if 'width' is set to 16, as in the following example:

Listing - DataWr() and DataRd() functions before migration
static  void  FS_NAND_BSP_DataWr (void        *p_src,
                                  CPU_SIZE_T   cnt,
                                  FS_ERR      *p_err)
{
    CPU_INT08U  *p_dest   = SAM9M10_NAND_DATA;
    CPU_INT08U  *p_src_08 = (CPU_INT08U *)p_src;
    CPU_SIZE_T   i;
 
 
    for (i = 0u; i < cnt, i++) {
        *(p_dest++) = *(p_src_08++);
    }
   *p_err = FS_ERR_NONE;
}
 
static  void  FS_NAND_BSP_DataRd (void        *p_dest,
                                  CPU_SIZE_T   cnt,
                                  FS_ERR      *p_err)
{
    CPU_INT08U  *p_src     = SAM9M10_NAND_DATA;
    CPU_INT08U  *p_dest_08 = (CPU_INT08U *)p_dest;
    CPU_SIZE_T   i;


    for (i = 0u; i < cnt, i++) {
        *(p_dest_08++) = *(p_src++);
    }
   *p_err = FS_ERR_NONE;
}
Listing - DataWr() and DataRd() functions after migration
static  void  FS_NAND_BSP_DataWr (void        *p_src,
                                  CPU_SIZE_T   cnt,
                                  CPU_INT08U   width,
                                  FS_ERR      *p_err)
{
    CPU_INT08U  *p_dest   = SAM9M10_NAND_DATA;
    CPU_INT08U  *p_src_08 = (CPU_INT08U *)p_src;
    CPU_SIZE_T   i;


	if (width != 8u) {					/* <-- Added check. */
       *p_err = FS_ERR_INVALID_ARG;
        return;
    }

    for (i = 0u; i < cnt, i++) {
        *(p_dest++) = *(p_src_08++);
    }
   *p_err = FS_ERR_NONE;
}
 
static  void  FS_NAND_BSP_DataRd (void        *p_dest,
                                  CPU_SIZE_T   cnt,
                                  CPU_INT08U   width,
                                  FS_ERR      *p_err)
{
    CPU_INT08U  *p_src     = SAM9M10_NAND_DATA;
    CPU_INT08U  *p_dest_08 = (CPU_INT08U *)p_dest;
    CPU_SIZE_T   i;


    if (width != 8u) {               /* <-- Added check. */
       *p_err = FS_ERR_INVALID_ARG;
        return;
    }

    for (i = 0u; i < cnt, i++) {
        *(p_dest_08++) = *(p_src++);
    }
   *p_err = FS_ERR_NONE;
}


Previous versions

The migration guide for previous versions of µC/FS is available in PDF: uC-FS-MigrationGuide.pdf