Hi everyone,
I'm using Devkit8000, according to my
requirement I need to load srecord file instead of binary file. I'm
reading srecord data from NAND using nand_read_block function it is
decoding correctly but not executing I have used printf statements to verify the data before decoding and after decoding there I got correct data but after decoding it should boot but it is not.
I'm not getting where the problem is, is there any problem in using srecord format instead of binary but I'm decoding srecord into binary before it reaches the RAM.
Below is my code where it loads srecord and decode it into binary,
#define CFG_LOADADDR 0x80008000
#define NAND_BOOT_START 0x80000
#define NAND_BOOT_END 0x120000
#define NAND_BLOCK_SIZE 0x20000
int i, j;
char uubin [255];
int uucnt;
ulong uuaddr;
uchar *buf;
for (i = NAND_UBOOT_START; i < NAND_UBOOT_END; i+= NAND_BLOCK_SIZE){ /*I have written s-record format in this memory instead of binary*/
nand_read_block(buf, i);
for(j = 0; j < 2788 ; j++) /*Here 2788 is for number of lines in one block i.e. 64 pages */
{
srec_decode(buf, &uucnt, &uuaddr, uubin);
uu_memcpy((char *)uuaddr, uubin, uucnt); /* This is for to read next line in srecord file each line consist of 46 bytes */
/* Here uuadddr is starts from address same as CFG_LOADADDR and uuaddr will increments as each srecord
line have different address*/
/* For srecord first line I'm using same address as CFG_LOADADDR i.e. 0x80008000 */
buf = buf + 47;
}
}
printf ("## Starting application at 0x%08lX ...\n", CFG_LOADADDR);
((init_fnc_t *)CFG_LOADADDR)();
I want to know whether we can use this procedure instead of default one which will read binary from NAND