Home
Developer Resources
Technical Articles

QNX Technical Articles

QNX® Momentics® 6.3.0 SH4 Critical Patch: Flash Filesystem & Embedding Technology Development Kit Release Notes

QNX® Momentics® 6.3.0

Date of this edition: January 14, 2005

Target OS: QNX® Neutrino® 6.3.0

Host OS: Microsoft Windows XP SP1 or SP2, 2000 SP4, NT SP6a; Sun Solaris 7/8; QNX® Neutrino® 6.3.0; Linux (Red Hat 8/9)

This patch addresses various problems, but most importantly, it fixes the ones reported for the SH4 architecture:

The SH4 compiler optimizations may result in flash write failures. In addition, filesystem corruption may occur if power is lost during flash write operations.

Note: The SH4 Critical Patches are included in QNX Momentics 6.3.0 Service Pack 1. We highly recommend that you install SP1 instead of these patches.
  • For information on installing this patch, see the SH4 Critical Patch installation note.
  • QNX Neutrino 6.3 supports only the new flash filesystem (FFS3). The older flash filesystem (FFS2) has been discontinued.

Contents


Note: Throughout this document, you may see reference numbers associated with particular issues, changes, etc. When corresponding with our Technical Support staff about a given issue, please quote the relevant reference number. You might also find the reference numbers useful for tracking issues as they become fixed.

What's in this patch?

There are two forms of this patch; one includes binary components, and the other includes source code.

Binary Components

The binary patch includes new SHLE versions of the following:

  • shle/sbin/devf-bigsur
  • shle/sbin/devf-generic
  • shle/sbin/devf-ram
  • shle/sbin/devf-systemh
  • shle/usr/lib/libfs-flash3.a

The binary patch also includes the related header files, but they haven't changed since the original release of this TDK.

Source code

The source patch contains all the source, including new versions of the following files in the src/lib/fs-flash3 directory (or project_name/lib/fs-flash in the IDE):

  • f3s.h
  • f3s_log.h
  • recover.c
  • resmgr.c
  • struct.c
  • table_find.c
  • unit.c
  • util.c

Location of the libfs-flash3.a library

The BSP flash driver looks for the flash filesystem library in two locations. Make sure to copy libfs-flash3.a from the patch directory to one of these locations:

  • $QNX_TARGET/shle/usr/lib

    Or:

  • the BSP's prebuilt directory.

Note: You need to copy the library whether you're using the binary or source version of this patch. If you've customized your flash driver, you need to relink it with the new version of this library.

Fixed issues

This patch addresses the following issues in the devf-* drivers:

  • SH4 compiler optimizations may result in flash write failures. (Ref# 21612)
  • Flash lock / unlock / unlockall operations formerly might have completed prematurely if the flash was interleaved. Polling for completion now takes interleaved flash into consideration. (Ref# 20908)
  • Power loss during a reclaim cleanup used to cause corruption. We've modified the repair code to prevent stale space reclaim while repairing flash corruption. Flash is properly repaired before reclaims are allowed. (Ref# 21105)
  • Allocated but unwritten flash extents formerly caused corruption. Repair code used to try to recover an allocated but unwritten extent from previous power loss, causing unrecoverable corruption. Dangling extents are now always repaired by marking them as invalid / stale. They're cleaned up when the block is later reclaimed. (Ref# 21121)
  • Power loss while creating a spare block (part of reclaim) used to cause unrecoverable corruption. Fixed to scrutinize spare blocks for corruption. (Ref# 21123)
  • When a block was retired due to an erase failure, no permanent markers were written to indicate this state. If the failed erase left enough data intact, the next power cycle may have accidentally used the block's stale data. The driver now properly tags retired blocks to avoid accidentally reusing their old data. (Ref# 21040)
  • It was possible for the driver to SIGSEGV while manipulating files. We added a missing check for a NULL pointer. (Ref# 21110)
  • If the flash filesystem was corrupted externally (e.g. by bad hardware, faulty address lines, or a DMA overrun), the filesystem may have reformatted the affected blocks as spares before determining that the corruption was unrecoverable. To aid in postmortem analysis of this corruption, checks were added to prevent the creation of more spares than what the filesystem was formatted to have. (Ref# 20312)
  • If power was lost while an extent was being initialized, certain fields may have been written before the extent was marked as active. The repair code was enhanced to better detect and repair such corruption. (Ref# 20150)

Known issues

  • When compiling the source code, two benign warnings will be reported:
    • Warning: implicit declaration of function `exit' debug.c os-efsys_efsys/lib/flash-nand line 33
    • Warning: implicit declaration of function `memcmp' ecc.c os-efsys_efsys/lib/flash-nand line 245

Be sure to check the SH4 Critical Patch release notes for related issues.

Documentation

The functionality provided by the TDKs is already described within the QNX Momentics documentation set. For information on flash, see:

  • Filesystems chapter of the System Architecture guide
  • Working with Filesystems chapter of the User's Guide
  • Customizing the Flash Filesystem chapter of Building Embedded Systems
  • devf-* entries in the Utilities Reference

Technical support

If you have any questions, comments, or problems with a QNX product, please contact Technical Support. For more information, see the How to Get Help chapter of the Welcome to QNX Momentics guide or visit our website, www.qnx.com.