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.

AIS Bootloader

Other Parts Discussed in Thread: OMAP-L137, CCSTUDIO

 Hello,

I have a very strange problem. I was using AIS bootloader to load program to EVMC6747 Starter kit. It worked.

After few days I wrote an AIS HOST interpreter on another EVM, that loads the first one, and it works. Then I go back to the program supplied by TI (AIS UART BOOT HOST) and trying to load again from PC, and this generates an error log:

(AIS Parse): Performing Opcode Sync...

(AIS Parse): Loading section...

(AIS Parse): Loaded 512-byte section to address 0x11813C00.

(AIS Parse): Processing command 6: 0x5853590A.

(AIS Parse): Performing Opcode Sync...

(AIS Parse): Filling section...

(AIS Parse): Filled 48-byte section with pattern 0x00000000.

(AIS Parse): Processing command 7: 0x58535901.

(AIS Parse): Performing Opcode Sync...

(AIS Parse): Loading section...

(AIS Parse): Loaded 128-byte section to address 0x118142BC.

(AIS Parse): Processing command 8: 0x58535901.

(AIS Parse): Performing Opcode Sync...

(AIS Parse): Loading section...

(AIS Parse): Loaded 869-byte section to address 0x118134F0.

(AIS Parse): Processing command 9: 0x5853590A.

(AIS Parse): Performing Opcode Sync...

(AIS Parse): Filling section...

(AIS Parse): Filled 4-byte section with pattern 0x00000000.

(AIS Parse): Processing command 10: 0x5853590A.

(AIS Parse): Performing Opcode Sync...

(AIS Parse): Filling section...

(AIS Parse): Filled 512-byte section with pattern 0x00000000.

(AIS Parse): Processing command 11: 0x58535901.

(AIS Parse): Performing Opcode Sync...

(AIS Parse): Loading section...

(AIS Parse): Loaded 15712-byte section to address 0xC4019500.

(AIS Parse): Processing command 12: 0x58535901.

(AIS Parse): Performing Opcode Sync...

(Serial Port): Read error! (The operation has timed out.)

(AIS Parse): I/O Error in read!

This is very strange, since the situation is that now I can load the file from another EVM by program that I wrote (which is a copy of TI code, translated from C# to C embedded), but I cannot do it from PC with a software provided by TI !

The question is: Could it be that I did something to reconfigure the board accidently? How do I reset to default?

The baud rate is the same: 230400,8,none,1, UART2.

Regards

Arye

  • Arye,

    I'm sorry that I missed this post!  Someone pointed this out to me in a recent discussion, and I wanted to make a (belated) suggestion: have you tried running the boot host utility on another PC?  Someone else was able to correct an error case similar to yours simply by using a different PC.  It could be worth trying, although I imagine that you've already moved on.

  • Hi Joe!

    Thanks for reply.

    I did tried to run this on different PC - it didnt solved the problem.

    I've worked it around in a bit strange way, - I rewritted the C# code, supplied with the software of application, to embedded C and has load it on another  proccessor that I connected to the DSP by UART (I write better embedded code than PC).

    Now, this proccessor loads program on DSP by D800K001 bootloader interface and start running the code on DSP. It works! So I dont really need a PC at this point, which still does not works.

    The problem I encountered with is a flash burn - I want a program that I load into DSP to be able to burn itself (or another program) into SPI FLASH memory and reload from there (when changing a boot switches).

    I didnt find any information on the format in which the program should be stored in SPI FLASH, in order to be recognized by DSP on boot as executable code.

    Can You point me to the documentation please?

     

    Thanks

    Arye Lerner

  • Arye,

    Are you trying to boot from SPI flash?  In that case, you should make sure that these conditions are met:

    1. Generate a binary AIS file (i.e. .bin or .ais; not .h)
    2. Store the contents of this file in the SPI flash starting at offset zero

    That should be all that you have to do.  Simply set your boot pin switches for SPI0 flash (on the EVM) and you should be able to boot from SPI flash.

    I may have misunderstood your question.  If you're asking how to run code directly out of SPI flash, then unfortunately there's no way to do that.  The contents of SPI Flash are not accessible via EMIF, so you can't execute code in place like you can with NOR flash.  In SPI flash boot mode, the bootloader copies program data out of SPI flash to memory (i.e. internal or external RAM) and executes it from there.

    Hope this helps.

  • Hi Joe,

    I didnt ment for DSP to boot from SPI FLASH, but as You said I expected the DSP to load program from SPI FLASH automatically into SDRAM and run from there.

    I'll try this and post the results.

    Just to be clear - I will create AIS image using the AIS generator with SPI0 option (SPI0 is the FLASH interface on EVMC6747). Any other important parameters should be set there, or all the rest can be used in default?

     

    Thank You.

    Arye Lerner

  • Hi Joe,

    Well, switching to a third computer did solved the problem - I guess I need to have more than 2 PC's for this application (lol)

    So, when I succeded to write to flash using PC application, I also succeded to read the data back from FLASH using my application, and verified the format You suggested.

    So I know how to finish the project now.

    Thank You Very Much!

    Arye Lerner

  • Hi Arye,

    I have an "OMAP-L137 EVM" and want to run a simple program(I loaded a simple project for turning on user led from support page of OMAP-L137 EVM ) on the EVM and when it turn off  the program rest on it.

    I want to use SPI0 flash. for this I setup sw2(boot pins) to boot from UART2(10100 position) and

    1)generat a binary AIS file(ais1.bin).

    2)I opened a command prompt on the host computer and erased the spiflash using the -spierase command and flashed my "ais1.bin" file using the -spiflash_noubl command .

    but I can't see user led's LED's blinking after turning off the EVM and turning on it again in spi0flash boot pins position(0101X)(my program don't run).

    is the problem about storing my program at offset zero?

    can you help me?

  • Mazaheri,

    There are some "gotchas" to watch our for when moving from development in CCS to running your application in a production context (i.e. booting to it from the ROM).  For instance, if you were relying on the GEL file to initialize the pinmux and PSC settings for you, then these steps may be missing from your application.  You may need to add these steps to your C code.

    To check whether or not your application is being run at all, you can follow this procedure:

    1. Flash your application AIS to SPI flash at offset 0
    2. Set the boot pin switches appropriately
    3. Make sure your JTAG connector is disconnected
    4. Power cycle the board
    5. Connect your JTAG and open CCS
    6. In CCS, use "load symbols only" to load the debug/symbol information for your application (without overwriting memory contents and resetting the program counter)
    7. Check to see whether the program counter is in your application code

    Hope this helps.

  • Hi Joe,

    I used the "load symbols only " submenu  to load my "led.out" file in CCS.

    now, how i should "Check to see whether the program counter is in my application code "?

    Regards.

  • When you connect CCS, you should see a "disassembly" window pop up showing an ASM-language view of where the program counter currently is.  When you load your app's symbols, a couple of additional things can happen:

    • CCS switches to a C-language view showing where the program counter is
    • CCS prompts you to open a C source file (i.e. <file name>.c)

    If this happens with a source file for your application, you can be pretty sure that the program counter is in your application code.  If it doesn't happen, you can do some more checking manually.

    Look in the disassembly window and note the address of the program counter (i.e. where the arrow is pointing).  If the program counter is still in the ROM (i.e. 0x117 or 0x007), then boot probably didn't complete successfully.  If you're not in the ROM, open the .map file that was generated alongside the .out file when you built your application.  Your program counter should be inside one of the symbols listed in this file.

    Also, just to be clear: we are talking about a DSP application, correct?  The OMAP-L137 ROM bootloader always boots to a DSP application, not to the ARM.

  • Hello Mazaheri,

    If You are using TI SPIFLASH tool, it will put the program by default at address 0. If you get success message after erasing and after writing, when there should be no problem.

    The problem I think You have, is that in your program You didnt configured the hardware (PLLs, PIN configurations, etc..).

    When You run the program in CCS, the GEL accessory does those configurations for You, but to run the program independently, You need to include the hardware configuration by yourself. I did that by taking the functions wth names SETUP_XXX() from thr gel file, and creating from them hardware configuration C file. Basically I just removed everything that generated errors. If creating this file by yourself causing complexity for You, You can search this forum to find one posted. Reply me if You didnt succeded, I will try to find it in one of my projects.

    Hope that helps

    Regards

    Arye

  • Dear Arye,

    thanks for your reply. i searched "hardware configuration C file for omapl137" in the forum but i could not find appropriate thing about this.

    would you please send me it ?

    in additoinal, there is another problem: when i connect CCS, i don't see a "disassembly" window( in TMS320C674XP window--->Option ---> Customize ---> Debug Properties, this behavior is turn on).

    I think  it's cause maybe is that my  program does not load onto my target . is it correct? does it have any important effect on my project? 

  • Dear Joe,

    when i connect CCS, i don't see a "disassembly" window( in TMS320C674XP window--->Option ---> Customize ---> Debug Properties, this behavior is turn on).

    I think  it's cause maybe is that my  program does not load onto my target .is it  true?

  • Hi again!

    I see my program counter that is in "117FAD80" (DSPL2ROM).

    I think that i should only add some function for hardware configuration in my application c code.correct?

  • Hello Mazaheri,

     I attached 1 file: gel.c  (just remove the txt from the end). gel.h that included in code simply holds functions declarations.

    Of course You will have to adopt it to your hardware configuration.

    Pins functions can be configured in Setup_System_Config() function in the file. See OMAP's GPIO User guide for that.

    As for the problem with dissasembly window - I am not sure, but the lack of this configuration is not suppose to cause anything like that.

    Are You sure you didnt forget to load the program into the target after compilation?

    When You load the program (File->Load Program->"browse to the *.out file located in \Debug") You will get notification if it fails. But if it didnt, you suppose to see dissasembly window.

     

    Regards

    Arye

  • Mazaheri,

    If your program counter is in the 0x117x range (i.e. in the ROM), then the chip did not boot successfully.  You should double check that your boot pins and SPI flash are setup correctly.

    As an experiment, you may also want to try creating a very simple AIS file for a "do nothing" application (i.e. void main() { while(1) asm(" nop"); }).  Sometimes if your application doesn't work correctly, it can reset the DSP and send the PC back to the ROM.  It can be helpful to rule this out with a very simple boot image.

  • Dear Arye,

    Thank you for your help.

    Now, I am sure that my problem is about configuration of the hardware (PLLs, PIN configurations, etc..).

    I add this command in the "main" page of my project : " #include "GEL_FILE[1].h"  " and save the file that you sent (GEL_FILE[1].h) in the include directory of my project.

    but some file is not find. i see these messages:

     "../../include/GEL_FILE[1].h", line 2: fatal error: could not open source file "std_bios.h"

    "../../include/GEL_FILE[1].h", line 2: fatal error: could not open source file "c64_bios.h".

    I searched for "std_bios.h" and "c64_bios.h" but could not find them.

    would you please send me them or guide me?

  • Hi,

    I have attached a zip file with two of those files You asked for. Just remove the txt expansion and unzip them.

    But I think it can ask you for additional *.h files. Instead, You can install Chip Support Library (CSL), that is what I did to get those files.

    I've found CSL with support for 64 series, not 67 as I needed, but it seems to work fine in my project, - still, I cannot recommend it as a correct way to do it.

    A PSP (P-somthing Support Package) is recommended as a newer version of CSL. It can be downloaded from ti site.

    Any way, have You tried to compile without them? If You want to skip a CSL, I suggest You compile without those files - It will probably generate You an errors as unknown type, or somthing like that, so You can just define it by yourself.

    Regards

    Arye

  • Hi Arye,

    I'm very confused!

    I removed the evmomapl137_dsp.gel file , then added some necessary  function and command in the main page of my project for configuration of the hardware (PLLs, PIN configurations, etc..).

    my program compile and build correctly . after loading and run it , I can see blinking of leds.( it works in all positions of boot mode switch ).

    however when i generate the ais.bin file from my application and flash it on SPI0 flash,I expect to see blinking of leds after set boot pins in spi0 flash boot mode and power cycle the board. ( independent from my computer )

    but it does not happen ( leds are still off ) and i don't know why?

    is there any help ?

  • Hi,

    What AISgen version are You using?

    I was using D800k001. Search the site or net for document called "Using D800k001 bootloader".pdf. - I just dont have it anymore.

    Do not confuse it with D800k002 - it is for L138 only!

    In this document where is a screen capture (called AISgen main window, or somthing like that) with correct configuration of busses, clocks and interfaces that should be when You are creating AIS bin file. Just make sure it is the same as yours.

    I saw that there is a new D800k003 version - I didnt tried it, so if You are using this one, I suggest You do the same - find the related document (sprab04d in this case) and make sure you have configured exactly the same way as it shown there.

    Let me know if it works

    Arye

     

  • Hi,

    I am using D800k003 version and read sprab04.

    I use the "configure for EVM " in file menu and this set all correct configuration of busses, clocks and interfaces auyomatically .

    do you have other idea?

  • Hi Mariana,

    I read the "Flashing the C6747 EVM" document. it is very clear and useful.

    i use  the CCS that comes with the Starter Kit.

    I executed all steps that is described in the "Flashing the C6747 EVM" document exactly( the difference is that i open a "led.pjt " from this directory: C:\CCStudio_v3.3\boards\evmomapl137_v1\dsp\tests\led that created during installation  the CCS that comes with the Starter Kit ) and still at power up, the board does not boot from SPI flash.(leds are off still ! ).

    I think my problem is about this : "  the configuration functions may not work well if you are using optimization, causing your program not to boot properly."

    for solving it , i select optimization "none" just for "main.c" file. but it was not solved. do you know why?

  • Make sure you follow this section of the Wiki article, especially pertaining to the GEL file contents. By default the example projects rely on the GEL file to initialize some peripherals. When you boot standalone from Flash this GEL file is not present, thus the automated peripheral configuration is as well. You will need to make absolutely certain that all required peripheral configuration is done either in the AIS stream (in the AISGen utility) or in software (e.g., main()).

  • One hint I get from UART host log is that the communication fails after first access to SDRAM (Command 11 loading data at 0xC4019500). Possibly SDRAM (EMIF) is not getting configured correctly?

  • Urmil,

    I get this message from UART host log :

    (File IO): Read 31612 bytes from file C:\aisfiletst\led2.ais.
    (Serial Port): Opening COM4 at 230400 baud...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME...
    (AIS Parse): Performing Start-Word Sync...
    (AIS Parse): Performing Ping Opcode Sync...
    (AIS Parse): Processing command 0: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Processing command 1: 0x58535901.
    (AIS Parse): Performing Opcode Sync...
    (Serial Port): Read error! (The operation has timed out.)
    (AIS Parse): I/O Error in read!
    (Serial Port): Read error! (The operation has timed out.)

      .

      .

      .

    AIS Parse): Opcode Sync failed after 11 consecutive I/O failures.
    (AIS Parse): Boot aborted.
    (Serial Port): Closing COM4.

    is the problem about com port? I use a USB to serial port convertor and receive the BOOTME message in hyper terminal .

    for testing other way ,I try to flashing my application ( led2.ais ) on the spi0 flash by using spiflash_writer_dsp.pjt. but is doesn't work too .

  • Hi mazaheri,

    This log is different from the log in the first post in this thread, so I assume this issue is different from the first one.

    Your COM port seems to be OK.

    1. You must be using AISgen for D800K001 and NOT for D800K003. Please confirm.
    2. What's the version of this tool?
    3. In the AISgen installation folder, you should find a command-line application named aisparse.exe. Please run 'aisparse led2.ais | grep //' and post the output here.
    4. In your application, you must have to configure PINMUX registers and enable required peripherals through LPSC before you use GPIO to control LEDs. Please confirm.

    In the mean time, I would also request you to try these experiments:
    1. Select 'Configure for EVM' and create led2-spi.ais. Write this to SPI flash and check if it boots correctly.
    2. Select 'Configure for EVM', change boot mode to UART2 and create led2-uart.ais. Try to boot this AIS using UART boot host and check if that works.

  • Dear Urmil,

     my bootloader is D800K001 but i have sprab04d.pdf and AISgen for D800K003 v0.1.0.0 and use it ( I found in my searches that the link for download AISgen for D800K001 is in  sprab04c.pdf  but i couldn't find it . )

    I can't find aisparse.exe In the AISgen installation folder . should i search for and download it ?

    i add some necessary c code in the main page of my project for Setup_System_Config .(my application run correctly in CCS whitout the .gel file . i think this means that the necessary configurations have down in the main page ).

    i did this: "1. Select 'Configure for EVM' and create led2-spi.ais. Write this to SPI flash and check if it boots correctly." then power cycle the board ( boot pins are set on spi0 flash ) result  : the leds are off yet !

    and did this : "2. Select 'Configure for EVM', change boot mode to UART2 and create led2-uart.ais." result (without turning off the board) : the leds are off yet !

    Zahra Mazaheri.

  • Dear Mazaheri,

    The last problem You've described (with I/O error on comport during bootloader load), I had (twice) using D800K001 bootloader , and unfortunatelly I havent being able to solve it by any means other than running an application on another PC (twice).

    At some point I even written my own bootloader utility (a C# code, supplied with AIS translated to embedded C) which were loading DSP from another microproccessor and it worked, but the AIS tool still didnt. I am allmost sure that the problem is somwhere in PC.

    If option of changing PC is possible, I suggest You try it. I used another PC, where no CCS components were installed.

    Regards

    Arye

  • Hi Mazaheri,

    If your boot loader is D800K001, I suggest you use AISgen for D800K001. The boot loaders are different and hence we have different set of tools.

    If you must use AISgen for D800K003, make sure to uncheck PINMUX & LPSC settings check boxes before making AIS image. Instead, you will have to do PINMUX and LPSC setup as first thing in your application. Also, do not enable CRC. This will let you create valid AIS file for SPI flash.

    For booting from UART2, you will not be able to make a valid AIS image with AISgen for D800K003 - unless you want to manually edit generatd AIS file in a hex editor.

    aisparse.exe is shipped along with AISgen for D800K001/3. You should update your version of AISgen. Current version is 0.5.0.0 (for D800K003).

  • Hi Urmil,

    thank you very much for your help,particular "If you must use AISgen for D800K003, make sure to uncheck PINMUX & LPSC settings check boxes before making AIS image."

    it was exactly my problem. i unchecked them and my application worked correctly .

    Best Regards,

    Zahra Mazaheri .

  • Dear Urmil Parikh,

    You wrote that one should "not enable CRC". Is there a specific reason for this?

    We are using D800K003 and we boot from SPI Flash or UART.

    Using SPI Flash, AIS streams with and without CRC are working correctly.

    Using UART, only streams without CRC works. If I enable the CRC in the AISgen tool, I got a timeout message, similar to the one at the top of this posting.

    Regards,

    Josef