Hi Mark,
We are using the AT45DB081 and following the configuration shown on uFileSystem in SPI FLASH document (
http://www.utasker.com/docs/uTasker/uTaskerFileSystemSPI_FLASH_003.PDF).
We keep the parameters block on the end of internal flash, while the file system is on the SPI FLASH.
We believe that the problem is in the bootloader FILE_LOCATION. We understood that the upload_file_location points to the end of the file system rather then to a specific file.
How can us associate a FILE_LOCATION (address) with the initial char of the file. I´m mean: what will be the address of H.BIN??
My SPI FLASH configuration on uTasker
config.h:
#define SPI_FILE_SYSTEM
#define FLASH_FILE_SYSTEM
#define FILE_GRANULARITY (8*SPI_FLASH_BLOCK_LENGTH)
#define uFILE_SYSTEM_START (MEMORY_RANGE_POINTER)(uFILE_START)
#define uFILE_SYSTEM_END (MEMORY_RANGE_POINTER)(uFILE_START + FILE_SYSTEM_SIZE)
app_hw_xx.h
#define FLASH_START_ADDRESS (0x00000000)
#define SIZE_OF_FLASH (256*1024)
//#define SPI_FLASH_SST25 // use SST SPI FLASH rather than ATMEL
//#define SPI_FLASH_ST // use ST FLASH rather than ATMEL
//#define SPI_DATA_FLASH // FLASH type is data FLASH supporting sub-sectors (relevant for ST types)
#define SPI_FLASH_AT45DB081
#define SPI_FLASH_PAGE_LENGTH 264
#define SPI_FLASH_BLOCK_LENGTH (8*SPI_FLASH_PAGE_LENGTH) // block size - a block can be deleted
#define SPI_FLASH_PAGES (4*1024) // 1Meg part
#define SPI_DATA_FLASH_0_SIZE (SPI_FLASH_PAGES*SPI_FLASH_PAGE_LENGTH)
#define SPI_FLASH_START (FLASH_START_ADDRESS + SIZE_OF_FLASH) // SPI FLASH starts immediately after FLASH
#define PARAMETER_BLOCK_START 0x3f000 // {34} FLASH location at 2 parameter blocks short of end of internal FLASH
#define uFILE_START 0x40000 // immediately after internal FLASH
#define SINGLE_FILE_SIZE (FILE_GRANULARITY) // each file a multiple of 16k (64k ST)
#define FILE_SYSTEM_SIZE (64*SINGLE_FILE_SIZE)
#define PARAMETER_BLOCK_SIZE FLASH_GRANULARITY // use the smallest size for the device
#define PAR_BLOCK_SIZE (2*PARAMETER_BLOCK_SIZE)
Boot definitions
config.h
#define SPI_SW_UPLOAD // new SW is situated in SPI FLASH {1}{2}
//#define SPI_FLASH_SST25 // {15} use SST SPI FLASH rather than ATMEL
//#define SPI_FLASH_ST // define that we are using ST FLASH rather than default ATMEL {9}
//#define SPI_DATA_FLASH
//#define USE_PARAMETER_BLOCK // enable a parameter block for storing and retrieving non-volatile information
#define USE_PAR_SWAP_BLOCK // we support a backup block which can be restored if desired
//#define SPI_FILE_SYSTEM // we have an external file system via SPI interface, rather than internal in FLASH
#define FLASH_FILE_SYSTEM // we have an internal file system in FLASH
bootloader.c
#define UPLOAD_FILE_LOCATION (uFILE_SYSTEM_END + 0) // start of SPI FLASH {3}
#define UTASKER_APP_START 0x1000 // external SPI FLASH solution requires two FLASH block for the boot code
#define UTASK_APP_LENGTH (MAX_FILE_LENGTH)(0x18000 - UTASKER_APP_START)// 92k
Best Regards.