using s-record file in x-loader 1.4.4ss

21 views
Skip to first unread message

Guru Charan

unread,
May 13, 2013, 9:08:42 AM5/13/13
to x-lo...@googlegroups.com

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


Nishanth Menon

unread,
May 13, 2013, 11:07:40 AM5/13/13
to x-lo...@googlegroups.com
On 06:08-20130513, Guru Charan wrote:
> 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.

Could you start using u-boot SPL support instead? X-loader is no longer
being actively maintained now that u-boot SPL has been defacto
stage1 bootloader option replacing x-loader.


--
Regards,
Nishanth Menon

Guru Charan

unread,
May 22, 2013, 1:41:06 AM5/22/13
to x-lo...@googlegroups.com
Hi Everyone,
 
                  As per my previous post I want to use srecord file(u-boot.srec) in X-loader file instead of binary file, could anyone help me in this issue. The details are in my previous post please refer and do the same.

Thanks and Regards,
Guru Charan
Reply all
Reply to author
Forward
0 new messages