Page tree
Skip to end of metadata
Go to start of metadata
Q

The application firmware (NAI file) is located in application flash (IFLASH2) of netX 90, the maximal size of an NAI file is 512K. If the application firmware is bigger than 512K, it is possible to generate an NAE file as the application firmware extension, it should be flashed to external flash(SQI flash).

How to build an application firmware extension in an application project with netX Studio?

A

Hardware requirements

SQI flash, SDRAM

Application project changes

  • wscript

Add the following parameters by firmware build in the wscript under the Targets. (0x64300000 is Hilscher default start address of the NAE file)

        segments_intflash      = ".text.nai_header .text.pagereader .text.pageflasher .text .ARM.exidx .ARM.extab .data",

        segments_extflash      = ".nae_header .nae_data",

        headeraddress_extflash = 0x64300000,

        sdram_split_offset     = 0x00400000,


  • netx90_app_iflash.ld

Add section .nae_header and section .nae_data between section .text.pageflasher and section .text in the linker file "netx90_app_iflash.ld".  

Note: If there is already sections .nae_header(NOLOAD) and .nae_data(NOLOAD) at the end of the linker file, they should be deleted.

   /* Section prepared for the external SQI Flash content */

    .nae_header :

    {

        __qspi_flash_start__ = .;

        /*KEEP(*(.app_cpu_hboot_boot_header_nae)) is put here by waf automatically*/

        KEEP(*(.app_cpu_header_nae))

    } > SDRAM

    

    .nae_data :

    {

        KEEP(*(.QFlash*))

        *(.rodata*) /* For Demonstration purposes, not recommended */

        . = ALIGN(4);

        KEEP(*(.app_cpu_secure_boot_header))

        __qspi_flash_end__ = .;

    } > SDRAM


  • netx90_app_header.c

Correspondingly add boot header, common header and device info of the NAE header, which should be consistent with the NAI header information.

ATTENTION:
If you have Hil_FileHeaderV3.h version $Id: Hil_FileHeaderV3.h 343 2020-11-09 12:24:03Z ABessler $: or higher version, please use the header HIL_FILE_NAI_NAE_APP_HEADER_V3_0_T instead of HIL_FILE_NAE_HEADER_V3_0_T.

HIL_FILE_NAI_NAE_APP_HEADER_V3_0_T app_cpu_header_nae __attribute__ ((section (".app_cpu_header_nae"))) =

{

  .tBootHeader =

  {

    .ulMagicCookie = HIL_FILE_HEADER_FIRMWARE_NAE_COOKIE,

    .ulAppChecksum = 0,

    .ulAppFileSize = 0,

    .ulSignature = HIL_FILE_BOOT_HEADER_SIGNATURE,

    .ulBootHeaderChecksum = 0,

  },

  .tCommonHeader =

  {

    .ulHeaderVersion = HIL_VERSION_COMMON_HEADER_3_0,

    .ulHeaderLength = sizeof(app_cpu_header_nae),

    .ulDataSize = 0,

    .ulDataStartOffset = 0,

    .bNumModuleInfos = 0,

    .aulMD5 = {0},

    .ulTagListSize = 0,

    .ulTagListOffset = 0,

    .ulTagListSizeMax = 0,

    .ulCommonCRC32 = 0,

    .ulHeaderCRC32 = 0,

  },

  .tDeviceInfo =

  {

    .ulStructVersion = HIL_VERSION_DEVICE_INFO_V1_0,

    .usManufacturer = HIL_MANUFACTURER_HILSCHER_GMBH,

    .usDeviceClass = HIL_HW_DEV_CLASS_CHIP_NETX_90_APP_FOR_COM_USECASE_C,

    .bHwCompatibility = 0,

    .bChipType = HIL_DEV_CHIP_TYPE_NETX90,

    .ausHwOptions = {HIL_HW_ASSEMBLY_ETHERNET, HIL_HW_ASSEMBLY_ETHERNET, HIL_HW_ASSEMBLY_NOT_AVAILABLE, HIL_HW_ASSEMBLY_NOT_AVAILABLE},

    .ulLicenseFlags1 = 0,

    .ulLicenseFlags2 = 0,

    .usNetXLicenseID = 0,

    .usNetXLicenseFlags = 0,

    .ausFwVersion = {0},

    .ulDeviceNumber = 0,

    .ulFwNumber = 0,

    .ulSerialNumber = 0,

  },

};

Download NAI and NAE files to the flash

After the wscript, linker file and header file are changed accordingly, you can rebuild your application project, an NAI and an NAE file should be generated under the build folder. Flasher tool of netX Studio can be used to download both files to the flash. Flasher will choose the correct flash type and use the default address automatically by detecting the file extension name. If you use other start offset address, you can change the start offset manually.


How to update NAI and NAE files with maintenance firmware (MFW)

It is possible to update NAI and NAE files together with MFW.

The NAI file and the NAE file should be placed under XIP directory of the fwupdate.zip according ZIP container format(Firmware update).

An NAE Area with the correct start address and content type should be defined in the FDL file so that the MFW knows where to download the NAE file to.

SQI flash and SDRAM should be configured correctly in the hardware configuration file.

Use Flasher tool to download FDL file and HWC file before making a firmware update process.

If NAI/NAE update fails, the SYS led bleibs yellow.

netHOST windows utility can be used to check the system error, which helps to find out the reason.

The error code 0xC0001152 means ERR_HIL_NOT_AVAILABLE.

If the FDL or/and HWC files haven't been changed accordingly, then the MFW will fail to copy the NAE file to the desired location. It will cause this error.


The error code 0xC0001151 means ERR_HIL_INCOMPATIBLE.

Inconsistency of the NAI header and the NAE header will cause this error. (e.g. HwOptions are different)


For other error codes please refer to the FAQ page of firmware validation (Firmware validation for LFW(Protocol stacks) and APP-FW --Troubleshooting guide when MFW fails to start the updated firmware)