This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C5509A bootloader from external Flash without using JTAG/XDS/FlashBurner

Hello!

 

We want to run the parallel EMIF bootloader from external Flash without using FlashBurner, JTAG or other tools. We made a program, loaded through the USB Bootloader, to load a simple code (blinking LED) to the external Flash and it is working, the data are indeed written to the Flash. Although, we do not know how the code must be written to the Flash in order to be correctly started.

We generated the LED code using command:

hex55 led_mem.out -boot -v5510:2 -parallel16 -a -o led_mem.hex -map led_mem.bxp

The led_mem.hex file contains the boot table and entry point in ASCII hex and we loaded it as is to the Flash, by putting all the hex bytes from the led_mem.hex file in an Uint16 vector. The generated files are shown at the end of this post. However, the code does not run.

 

Is it possible to load and run the code this way? Are there any special requirements on memory data arrangement  to do so? Do we need to load the code in word format instead of byte?

 

Thanks in advance.

 

Regards,

Nelson

 

Beginning of led_mem.hex file:

 

00 00 05 24 00 00 00 00 00 00 03 C4 00 00 02 00 4E FF 6C 00 05 C0 3C 04 

6C 00 05 9C 4E 01 48 04 4E FF E6 00 00 08 FF E8 08 00 2B EC 31 BE 0F 42 

40 90 B0 08 00 95 A9 00 76 00 10 08 18 01 49 6C 00 03 5C A9 00 36 99 C9 

 

 

led_mem.bxp file:

 

 

********************************************************************************

TMS320C55x Hex Converter                                                  v4.3.6

********************************************************************************

INPUT FILE NAME: <F:\C5509A_LED\Debug\DSP_C5509A_LED.out>

OUTPUT FORMAT:   ASCII-Hex

PHYSICAL MEMORY PARAMETERS

   Default data width   :   8

   Default memory width :  16

   Default output width :  16

BOOT LOADER PARAMETERS

   Table Type:  PARALLEL PORT (EMIF 16 bit Mode)

   Entry Point:  0x00000524

OUTPUT TRANSLATION MAP

--------------------------------------------------------------------------------

00000000..00ffffff  Page=0  Memory Width=16  ROM Width=16

--------------------------------------------------------------------------------

   OUTPUT FILES: led_mem.hex [b0..b15]

   CONTENTS: 00000000..0000056b   BOOT TABLE

                            .text : dest=00000200  size=000003c4  width=00000001

                           .cinit : dest=000006c8  size=00000074  width=00000001

                           .const : dest=000007b0  size=00000008  width=00000001

                          vectors : dest=000005c8  size=00000100  width=00000001

--------------------------------------------------------------------------------

00000000..00ffffff  Page=1  Memory Width=16  ROM Width=16  "*DEFAULT PAGE 1*"

--------------------------------------------------------------------------------

   NO CONTENTS

 

  • hi,

     

    You can read flash memory using the JTAG debugger and find out what format is written to flash by a FlashBurner.

    Then you can writhe the same format to the flash.

    Regards,

    Hyun

  • Thanks Hyun!

     

    The problem is that unfortunately I do not have the JTAG debugger, that is why I want to do this way.

     

    Would the difference between hex55 generated format and JTAG format be only in the beginning of the code or would it be more complex? 

     

    Regards,

    Nelson

  • Hi,

     

    Format should be in the boot loader document: http://focus.ti.com/lit/an/spra375f/spra375f.pdf.

    Please read section 2.5.2.

    Regards,

    Hyun

  • Thanks Hyun!

     

    I have read that and the generated hex file seems ok. The entry point 0x0524 is in the beginning of the table and it is the address of c_int00, as I saw in the CCS debugger. Besides, the rest of the code is also ok, the hex bytes in led_mem.hex is the same as in the CCS debugger, although in the second case the instructions size are variable.

    The problem might be when we load this file to the Flash. Do we have to load it in word format? I mean, instead of writing 0x05 and 0x24 at Flash word addresses 0x200000 and 0x200001, is the right thing to do writing 0x0524 at word address 0x200000?

     

    Regards,

    Nelson

  • Hi,

    If your flash is 16-bit, I'd try the second method.

    Regards,

    Hyun

  • Thanks Hyun,

     

    I wrote to the Flash in word format since the memory is 16-bit. However it did not work even when I changed the entry point, _c_int00 address, by half since it is generated in byte format by hex55. 

    I am running out of ideas. I connected a LED at IO4 and it goes down very quickly after reset, which indicates that the bootloader is loading the code, right?

    What test could I do to understand what is the problem?

     

    Regards,

    Nelson

     

  • Changed sections sizes and sections start word addresses but still no effect. 

    Regards,

    Nelson

  •  

    Hi again!

    I am really hopeless now and I would be really thankful if you could give me some advice.

    I pasted the Boot Table I generated with hex55 at the end of the post. I wrote to the external Flash the bytes converted to word since the memory I used is 16-bit. 

    I made it this way:

    @0x400000 byte address: 0x00, 0x00,0x03, 0xDC,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x03, 0xBC...

    becoming

    @0x200000 word address: 0x0000,0x03DC,0x0000,0x0000,0x0000,0x03BC...

    The data in the boot table are right and I compared the code with the code shown in disassembly debugger. I have also already tried dividing by 2 the section start addresses and sizes when converting from byte to word. However, when I read a random code written to internal RAM it seemed that it was not necessary to do this.

    I read the data on Flash several times and they are exactly the same as the boot table and written in the exact word addresses.

    1. Are there any other data that must be written to the Flash so that the code at the Flash is recognized by the EMIF bootloader?

    2. Do I have to make additional build configurations to compile the code in another way to write it to the Flash?

    3. Must entry point be other than _c_int00?

    4. Do I need to set additional parameter to linker .cmd file? Do I need to add ROMS directive?

    5. What is the best way to do this since CCS v4 does not have FlashBurn? Does FlashBurn writes the boot table to Flash exactly as it is?

    Sorry if these are too basic questions, I am not very experienced with TI DSPs. I read SPRA375F, SPRA840C, SPRU670A, SPRA804A, but it is still not clear to me what I must do.

    Thank you in advance.

    Nelson

    ---

    <HEX55 BOOT TABLE>

    |  Entry Point   |  Reg Count  | Section Size |   Start Addr   |  Code ...

    | 00 00 03 DC | 00 00 00 00 | 00 00 03 BC | 00 00 00 C0 | 4E FF 6C 00 04 78 3C 04 

    6C 00 04 54 4E 01 48 04 4E FF E6 00 00 08 FF E8 08 00 2B EC 31 BE 07 A1 

    20 90 B0 08 00 8D A9 00 76 00 10 08 18 01 49 6C 00 02 14 A9 00 36 99 C9 

    00 18 01 49 76 00 40 08 6C 00 02 14 4A 55 4E FB EC 31 BE 01 00 F4 EC 00 

    AE 4D 03 80 65 14 A9 51 07 FD 7D FF F8 99 1A 07 99 C9 51 07 FD E6 51 07 

    ...

    | Section Size |   Start Addr   |  Code ...

    | 00 00 00 74  | 00 02 01 00 | 00 22 01 00 BA 00 00 00 00 00 00 00 00 00 00 00 

    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

    ...

    <HEX55 MEMORY MAP>

    PHYSICAL MEMORY PARAMETERS

       Default data width   :   8
       Default memory width :  16
       Default output width :  16

    BOOT LOADER PARAMETERS

       Table Type:  PARALLEL PORT (EMIF 16 bit Mode)
       Entry Point:  0x000003dc

    OUTPUT TRANSLATION MAP
    --------------------------------------------------------------------------------
    00000000..00ffffff  Page=0  Memory Width=16  ROM Width=16
    --------------------------------------------------------------------------------

       OUTPUT FILES: led_mem.hex [b0..b15]

       CONTENTS: 00000000..00000563   BOOT TABLE
                                .text : dest=000000c0  size=000003bc  width=00000001
                               .cinit : dest=00020100  size=00000074  width=00000001
                               .const : dest=000201e8  size=00000008  width=00000001
                              vectors : dest=00020000  size=00000100  width=00000001

    --------------------------------------------------------------------------------
    00000000..00ffffff  Page=1  Memory Width=16  ROM Width=16  "*DEFAULT PAGE 1*"
    --------------------------------------------------------------------------------

       NO CONTENTS

     

     

     

  • Hello Nelson!

    Have you already solved your problem? I think it is necessary to write boot records to the flash as you can see in the programmer.pjt project which you can receive from TI.

    Best regards,

    Jiri

  • can someone send me a link to the programmer utility?

    I'm trying to burn NOR flash on C5504 external device (with EMIF 16 bit) using the nor_writer.prj but it doesn't work , nor_writer app. (which I used for burning) display "PASS" but after device power up the code is not running from external flash , more than that I checked with the debuger  and the memory in address 0x400000 looks exectly like the file I created with the hex55 application (start with 0x09AA).

    what I did is as following:

    1. after building my project I convert the out filr into a bin file using the hex55.exe application

    hex55.exe -i <input file name>.out -o <output file name>.bin -boot -v5505 -parallel16 

    2. running the nor_eriter app and download the <output file name>.bin file

    3. disconnect my device from JTAG

    4. power up the device

    which file format should be created for burning? does hex intel format (the one i created) is the right one? does -v5505 is the right version for c5504 device or should I write

    -vc5504 instead?

    Any help is appreciated .

    BR

    Talmor

  • Hi Talmor,

     

    you can still use v5505 for your device because the DSPs 5504/05/14/15 all have the same core.

    For the programmer file, refer to

    http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/t/112203.aspx

     

    Regards,

    Juliana Almeida

     

  • Hi Jiri Babka!

    Thank you for your concern and sorry about not answering quickly, Jiri Babka, I started working with digital filtering and communication, please forgive me.

    Unfortunately, I have not solved my problem... But following your advice, I will try to find the programmer.pjt and see the code. Soon I will be working back at this issue and posting the news!

    Again, thank you very much!

    Regards,

    Nelson

  • Hi everyone!

     

    I wanto to proudly say that it worked!

     

    But instead of using external Flash memory with EMIF bootloader we used the SPI Flash and SPI bootloader using the MMB0 Rev C Modular Motherboard from TI.

    The boot table generation was right, we just needed to write to the Flash each byte of the generated table. I believe the problem was in our interfacing with the Flash memory.

     

    Thanks everyone for all the suggestions!

     

    Best regards,

    Nelson