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.

Loading program code on flash - OMAP-L138

Other Parts Discussed in Thread: OMAP-L138, OMAPL138

Hello,

I'm using the OMAP-L138 in a comercial device. We are starting planning the industrial production, that's why we need now to load the code in the external flash and make it work by it own. I've not seen any option in the CCS5 I'm using so, how can I do that? The program must run on the DSP side.

By the way, how can I encrypt the program and configure the device run that code?

Regards.

  • Hi Marcos,

    A good starting point for know about the booting process is the OMAPL138 Bootloader application notes found in the URL below:

    http://www.ti.com/lit/an/sprab41d/sprab41d.pdf

    The OMAPL138 supports boot from SPI, NAND, NOR flash devices. There are several wiki articles related to boot that will help you understand the process.I am providing links to some frequently discussed topics

    http://processors.wiki.ti.com/index.php/OMAP-L138_Bootloader

    http://processors.wiki.ti.com/index.php/Boot_Images_for_OMAP-L138

    http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138

    OMAPL138 is a ARM boot device so in order to load and run program on the DSP you will need a secondary bootloader to bring the DSP out of reset and start executing code frnm the entry point of your application. If you are using Linux on the ARM, you also have the option of using dsplink to load and run the code on the DSP.

    OMAPL138 also comes with an option of generic secure boot that provides IP protection. These devices are generally refered to as OMAPL138E devices. you can read more about them from the following pages.The tools and software is slightly different and would need some additional effort that booting on general non-secure device.

    http://www.ti.com/tool/secdevtool-omapl138c6748

    http://processors.wiki.ti.com/index.php/Basic_Secure_Boot_for_OMAP-L138_C6748

    Do let us know if you have any follow up questions, we can help you address.

    Regards,

    Rahul

  • Hello,

    I think I didn't give you the information as precise as I could. I'm working with the Logic PD Omap-L138 Experimenter Kit. This features a SPI flash, though it is said to be a NOR flash I think I must use the "SPI EEPROM or Flash Boot" insted of "NOR Flash Boot", isn't it? Anyway both methods need to create the AIS file, is that right?

    I understand I need to:

    •     Download the Flash and Boot Utility 2.4, and compile the Flash Loader Utility (downloading firstly the ARM compiler, .Net framework, and Cygwin).
    •     Download the AISgen and create the AIS file from the binaries.
    •     Load the AIS on the Omap device though the sfh_OMAP-L138.exe.


    I have followed all these steps to run the precompiled examples, using the OMAPL138-DSP-LED-NAND-SPI-UART.cfg config file to create the AIS script. It worked well and the leds blinked.

    Later, I have tried to adapt my DSP program to fit all that steps. I've used the same configuration file and the ARM program included in the example and my .out (compiled for C674x) to launch the DSP and my program in ti.

    However the program doesn't work. To be honest, there are some steps that I don't understand well:

    •     Do I need to modify the cfg file to make a further configuration of the device (PPLs, RAM, pinmux) to get the same configuration as the Gel file does?
    •     Can I use the same ARM program if I don't need any funcionality apart of booting DSP and launching its program?
    •     I have seen that the DSP led example is stored in the shared RAM, but my programm is intended to run from the mDDR/DDR2 memory (.text > DDR2 in linker file) Must I modify the address stored in HOST1CFG register to point out my program starting point?


    Because of these doubts I have tried to modify the example program not to run in the DDR but in the DSPL2 (.text > dsp_l2_ram), to avoid having to do any DDR configuration. Once tested it works. However if I try to place the code in the DDR (.text > external_ram) the debugger fails when verifying the loaded program, I get this error:

    C674X_0: File Loader: Data verification failed at address 0xC0000000 Please verify target memory and memory map.


    I have solved it using not the gel file OMAPL138_DSP.gel (provided by Logic PD) but the one for the C6748 (I don't remember where I took it from). Now the loading runs ok and the program works well, all by loading it in CCS. However I can't make it run by loading in the flash. I have copied the gel file configurations in the PPL0, PPL1, DDR and PSC tabs, I have compared it with the registers contents and they matched but the program still doesn't work.

    How can I configure the AIS to boot the example program from the mDDR?

    Regards.

  • I finally made it work!

    Last time I wrote I wasn't sure about what was wrong, the linker configuration or the AISgen one. Now I know both were mistaken.

    In order to make it work I did:

    • Place all the executable code in the external memory but the _c_int00 to stay in entry_point and the main function to do in dsp_l2_ram. I did it by creating a new section that is placed on dsp_l2_ram and forcing the main function to be placed on this new section:
    • myInitCode  > dsp_l2_ram
    • #pragma CODE_SECTION (main, "myInitCode")
    • I also changed the way I was creating the configuration file for the AISgen program. I decided starting from the example file and then adding my configuration for PPL0, PPL1, DDR and PSC to reach the gel configuration.

    By the way, I have firstly tried to reconfigure my original file to get to the same configuration as the example cfg file. However it doesn't work. I have opened both files in notepad and they are slightly different. Could anyone analise it?, I have include a comparing table below (at the left side is the original file, at the right mine):

    Boot Mode=(No Config) Boot Mode=NOR Flash
    Boot Speed=115200 Boot Speed=1
    Pinmux=4:2200+ Pinmux=

    Thanks for all. I hope this post could help other people.