File system support

File system support is an optional feature that allows Device Cloud to remotely interact with a file system. This enables Device Cloud to read from and write to a file and list directory entries. In µC/OS, file system hooks are implemented using a µC/FS file system.

A 'File_system' example is ready to use for both the TWR-K60N512and TWRK53N512 towers. In this example the content of an SD Card inserted into the tower's SD Card socket is exposed to Cloud Connector.

To enable this feature on other examples you must perform the following steps:

  1. The following macro must be defined in connector_config.h:
    #define CONNECTOR_FILE_SYSTEM
  2. Maximum path length must be defined using the following macro (change it to save RAM):
    #define CONNECTOR_FILE_SYSTEM_MAX_PATH_LENGTH 256
  3. In the Workspace, right-click on the uC/FS component and select Options. Uncheck the Exclude from build combo box.
  4. Repeat this process for the uC/Clk component (required for uC/FS).

In this release, CONNECTOR_FILE_SYSTEM will automatically set APP_CFG_FS_EN (native define in µCOS to enable file system).

This release also provides a file system block device driver for the SD Card at:

C:\Program Files\Etherios\Cloud Connector\Kits\Kinetis\uCOS\Micrium\Software\EvalBoards\Freescale\TWR-K60N512\IAR\BSP\FS (same for TWR-K53N512)

Therefore the SD Card device is exposed as sdcard:0:\.

 

To test this feature, you will need an SD Card that was previously formatted.

Once formatted, follow these steps:

  1. Insert the SD Card into the socket.
  2. Build the example and launch it.
  3. Log in to your Device Cloud account.
  4. Open your device's Properties page by locating it from the Device list and double-clicking on it.
  5. Within the device's Properties page, there should be a File Management option. Click to select this option and you will see a list of files similar to the following:
  6. You can browse through your files, upload new files, download existing files, and delete unwanted files. To test full support, refer to Device Cloud’s user documentation where you can also find examples on how to use Web Services.

Warning

There is a known limitation on some hardware revisions of TWRK60N512, so it is recommended that you insert the SD Card with write protection enabled before launching the application.

From TWR-K60N512-UM.pdf:

On Rev D TWR-K60N512 boards, there is an erratum that sends a reset to the Ethernet PHY on the TWR-SER when inserting an SD Card. This will cause a loss of communication with the web server. To get around this erratum, you need to switch on Write Protect on the SD card, and insert it before the board boots up. Earlier boards do not have this issue.