Author Topic: What is HS.bin ?  (Read 6102 times)

Offline kourov

  • Newbie
  • *
  • Posts: 8
    • View Profile
What is HS.bin ?
« on: June 19, 2008, 09:56:00 AM »
Hello,

I would like to know what and where the file HS.bin when we download a new application to the board?

Thanks


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: What is HS.bin ?
« Reply #1 on: June 19, 2008, 12:37:51 PM »
Hi

When you upload a new file, you first create this file from the target binary using the conversion utility. This generates H_Upload.bin, or similar. When this is downloaded to the board there are 2 possibilities, depending in how the project is configured:

1. FLASH_FILE_SYSTEM or FLASH_FILE_SYSTEM and SPI_FILE_SYSTEM. This allows the file system to be placed in internal and/or external FLASH.
The download controls this on the administrator page using the following
<form action=HS.bin enctype="multipart/form-data" method="post">
This is a special method (used by uTasker) to cause the file to be stored as 'H'.bin and the resulting displayed side to be controlled by handling the 'S' command (see INFORM_POST_SUCCESS in fnHandleWeb() in webInterface.c.
The file is thus stored in the file system (either internal FLASH or an external SPI based FLASH) and can also been seen via FTP as "H.bin".
Note that the file can also be copied by FTP since its name corresponds.

2. SPI_SW_UPLOAD. This doesn't support the file system in SPI FLASH but does allow firmware uploads in SPI FLASH to take place.
In this case the operation is a bit different and the "HS.bin" causes the upload to copy the contents to a special location (in SPI FLASH, but outside of the file system). In app_hw_m5223x.h you will find this define:
#define SW_UPLOAD_FILE()       (*ucIp_Data == 'H') && (*(ucIp_Data+1) == 'S') && (*(ucIp_Data+2) == '.')  && (fnSPI_Flash_available() != 0)
This is used to identify this special case and cause it to be diverted to a pre-defined location.
In this case the file is not visible in the file system (can not be seen using FTP) but will be recognised later by the boot loader.
If the file H_Upload.bin is renamed to HS.bin it can in fact be loaded via FTP - "PUT HS.bin" and can also be retrieved via FTP using "GET HS.bin" - it is however not visible.

Note that the demo project is set up to work in SPI FLASH using SPI_SW_UPLOAD. This is in fact quite a special case which will probably be used less that the FLASH_FILE_SYSTEM and SPI_FILE_SYSTEM case, in which case the boot loader will need to know the location of the file chosen for the project operation as follows (or similar):
#define UPLOAD_FILE_LOCATION   (uFILE_SYSTEM_END + OFFSET) where OFFSET is the offset in the SPI FLASH of the file location.

Regards

Mark