HOWTO: Use FlashSDK to add support for QuadSPI flash memory devices for S32 Flash Tool

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HOWTO: Use FlashSDK to add support for QuadSPI flash memory devices for S32 Flash Tool

HOWTO: Use FlashSDK to add support for QuadSPI flash memory devices for S32 Flash Tool

The S32 Flash Tool is provided with support for a few QuadSPI flash memory devices which are typically the devices provided as part of the standard NXP EVB for each of the support NXP Automotive Processors. This will work for most users, but some may select a device for which support is not included with the tool. The FlashSDK was created to provide an easy method for adding support for additional QuadSPI flash memory devices to the S32 Flash Tool.

First, a brief explanation of how the S32 Flash Tool works. The S32 Flash Tool programs external flash devices such as QuadSPI, SD, MMC, and eMMC. For each external flash device, there is a flash device-specific flash algorithm file. This flash algorithm file is downloaded by S32 Flash Tool to the target device SRAM, where it will be executed by the target device BootROM. The S32 Flash Tool then sends commands to the flash algorithm along with the image to be programmed to external flash. The flash algorithm will perform the programming of the image to the external flash device.

The Flash SDK provides the capability to produce new flash algorithm files, which could then be uploaded to the target device by the S32 Flash Tool and then used to program images to the associated external flash device.

The FlashSDK is provided in the form of a S32 Design Studio for S32 Platform v3.x project. This example project, as provided, will build and output a binary file similar to the MX25UM51245G.bin,

MX25UW51245G.bin files included in the S32 Flash Tool. The project is designed to build for the Arm M7 core. It is located within the S32 Flash Tool installation directory and inside the folder 'FlashSDK_Ext'. For example, since the S32 Flash Tool is included within the S32 Design Studio 3.x, if the default installation settings were used, this could be found at the path: C:\NXP\S32DS.3.x\S32DS\tools\S32FlashTool\FlashSDK_Ext

There is some limited documentation included with the FlashSDK, it can be found by navigating to the '...\FlashSDK_Ext\doc\html' directory and then open 'index.html' with your web browser.

In this document, an example process for using the FlashSDK to produce a new binary file will be detailed.

Prerequisites

  1. Install S32 Design Studio
  2. Locate or prepare an image file to be programmed to flash memory
  3. Setup hardware to Serial Boot mode

Procedure

  1. Launch the S32 Design Studio
  2. Import the FlashSDK project, using copy to workspace option to preserve the original project.
    1. File -> Import

      image.png

    2. Select 'Existing Projects from Workspace'

      image.png

    3. Click 'Browse', locate and then select the 'FlashSDK_Ext' folder, check the box for 'Copy projects into the workspace'

      image.png

  3. Open source files. The files in the project which should be modified for a new flash device are: ...\FlashSDK\Algo\Generic\qSPI_Algorithm.c and qSPI_chip_commands.h
    Locate the files within the Project Explorer and double click them to open them in the editor.

    image.png

  4. Edit source files. The header file 'qSPI_chip_commands.h' contains many #defines for the flash memory chip which should be adjusted to your new device. Please refer to the reference manual provided by the flash device manufacturer for details on the correct values. As you can see, it is currently setup for the MX25UM51245G device from Macronix.

    image.png

  5. Build the project. The project is setup for 2 build types for you, Debug and Release. The Release build type is more efficient and will run faster, and the Debug build type will allow you to run the debugger in attach mode to investigate issues with the changes you've made.

    image.png

  6. Test new binary on the target and flash memory device. Follow the usual steps to use the S32 Flash Tool.
No ratings
Version history
Last update:
‎05-26-2021 02:25 PM
Updated by: