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.

Using SPI boot mode in C6678 EVM

Other Parts Discussed in Thread: TMS320C6678

Hi All ,

I understand from the datasheet that TMS320C6678 processor supports booting from flash devices (using SPI.EMIF16 boot modes). I want to have a single flash device on my system that will hold the application image and i wish to boot directly from this flash device on power on.

If i configure the boot mode pins to select the required boot mode (SPI or EMIF16) and place my application image in the flash device will i be able to achieve the functionality of bootling from Flash device. Does the ROM bootloader have the support to copy the application image from the flash device (depending on the bootmode pins configure) to DDR and execute the same i.e. non XIP (Execute In Place) mode?

I understand from an earlier post that TMS320C6678 Silicaon version 1.0 chipsets have a PLL lock issue and a workaround required to be implemented.

http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/101820/358059.aspx#358059

In the EVMs shipped by TI the workaround is implemented in a code sitting on the I2C based EEPROM.

In my case (where i have a single flash device and no EEPROM on board) can i have this workaround implemented in the applciation code sitting in my flash device? To Sum up what i essentially expect to happen on power on is:

(assuming that I have interfaced an SPI based  NOR Flash to TMS320C6678 processor)

1) I configure the bootlmode pins of processor to SPI boot.

2) On Power ON ROM bootloader copies the image in the SPI based NOR flash to DDR and executes this. The PLL is in bypass mode .

3) When the application code executes it first implements the PLL Lock up workaround suggested by TI in the errata. It than initializes the PLLS and proceeds.

Can i achieve the above steps? Please let me know if there are any mistakes in my understanding.

Also is there a way to test this on the TMS3206678 EVM ?

-Anil

 

 

 

  • Hi Arun,

    Please attache the bat file as I couldn't find it in the zip file, can you also attached the project which is the input to the bat file,

    Many thanks,

    HR

  • HR,

    Sorry, I thought I did. The updated zip file is attached.

     

    Thanks,

    Arun.4617.SPIBoot.zip

  • Arun,

    Can you add simple.c & simple.rmd , I want to see that I'm getting the same dat file,

    Many Thanks,

    HR

  • Hi Arun,

    I tried it with the post with not too much success, I tried to configure the EVM switch 3-6 as I2C and SPI, have you tried to download and run your project?

    Thanks,

    HR

  •  

    HI HR,

    I am not sure what you mean by I2C and SPI boot. These are the steps I tried.

    1. Put the EVM in noboot

    2. Load and run the gel

    3. Load NOR writer and write the spirom.dat file into NOR.

    4. After successful write, power down the EVm

    5. Set the bootmode to SPI

    6. Power up and you can see the code is executed.

     

    Thanks,

    Arun.

     

     

     

     

     

     

     

     

  • Hi Arun,

    As I don't now what the simple program is doing I used the post program, for the SPI switch mode I set

    sw3 - off, off, off, on

    sw4 - on, on, on, on

    sw5 - on, on, off, on

    sw6 - on, on

    is this correct?

    Thanks,

    HR

  • I am always confused with on and off. I see it as the position closer to the edge of the EV and one away from.

    0 - Position closer to edge

    1 - Position away from the edge.

    in that case the switch should be

                                  4         3        2      1

    SW3                     1          1       0       1

    SW4                     0          0       0        0

    SW5                     0          0       0        0

    SW6                     0          0       0        1

     

    Thanks,

    Arun.

     

  • Hi Arun,

    Yes, it is confusing, I tried it with no success, shouldn't  sw5-3 be "1" for 24 bit width, can you send me the simple project so we will be able to compare full project,

    Have you tried it?

    Thanks,

    HR

  • It shouldn't matter as you set the boot parameter table correctly for your boot table. Anyways, here is the simple package. Yes as I mentioned earlier i have tried it and it worked.

     

    Arun.7853.simple.zip

     

  • Hi Arun,

    Sorry but probably I'm missing something as the simple project doesn't work as well,

    Going back to the post, the steps I'm using for building the post on the mcsdk_2_00_04_16,

    - I'm using the files - post_evm6678l.out, post.rmd (from the directory - mcsdk_2_00_04_16\tools\post\evmc6678l\bin), in the file nysh.spi.map (your file) I changed "exe_file = "simple.i2c.ccs"" to "exe_file = "post.i2c.ccs""

    Building the spirom_le.dat file -

    - hex6x -order L post.rmd post_evm6678l.out

    - b2i2c post2.b post.i2c.b

    - b2ccs post.i2c.b post.i2c.ccs

    - romparse nysh.spi.map

    - byteswapccs i2crom.ccs spirom_le.dat

    - change the "51" in the dat file to "00"

    Upload the file spirom_le.dat

    - change spirom_le.dat to app.bin and load it to 0x80000000

    - use the nor_writer to upload the file

    Running it

    - change the EVM dip switch from left (near the C6678) to right

    1 0 1 1   0 0 0 0   0 0 0 0   1 0 

    - I have attached spirom.txt (I have changed the dat extension to txt as I'm not allowed to upload dat files), please  let me know if anything is missing,8512.spirom_le.txt

    Thanks,

    HR

  • Hi HR,

    One thing I see here is you converted it to .bin. Don't do that. Just keep it as .dat and change the input text file to the name you have. If the dip switch is from left to right, then i can see you have set the boot mode to 101 which is I2C. you need to be 110. so the format should be

     

    1 1 0 1     0 0 0 0   0 0 0 0  1 0

     

    Please use these two and let me know.

     

    Thanks,

    Arun.

  • Hi Arun,

    Still not working, I loaded the .dat file and set the switches to (left to right, left close to the c6678)

     sw3     sw4     sw5   sw6

    1234   1234   1234   12

    1011   0000   0000   10

    The SW is not loaded to it's place as I have checked the main function memory place,

    using "1101 0000 0000 10" loads the I2c boot sw,

    What am I missing?

    Thanks,

    HR

     

  • I don't see any issues. Only thing I want to check is that you are loading only the .dat file as such without converting to .bin right? Also try loading the nor writer in no boot mode. the SW3 should be set to

     

    1 2 3 4

    1 0 0 0.

     

    Also what you mean by i2c boot is loaded?  This is for SPI boot mode.

     

    Thanks,

    Arun.

     

  • Hi Arun,

    Yes, I'm loading the .dat file and I'm loading the file in no boot mode,

    When setting SW3 to 

    1 2 3 4

    1 1 0 1

    It runs an old post image going over the spec 101 is I2C boot using the below it is SPI boot (I hope)

    1 2 3 4

    1 0 1 1

    doesn't help,

    Can you try loading the attached .dat file (change the attached .txt file to .dat) and let me know if it is working (what post version are you gettin?)

    Thanks,

    HR7028.spirom_le.txt

  • Hi HR,

    I will try today. Did you try the spirom.dat file i sent. If you can boot that successfully, then it means the problem in creating your file. Please let me know your results.

     

    Thanks,

    Arun.

  • Hi Arun,

    Yes I tried to load the spirom_le.dat with no success, please send me the simple.out and simple.rmd files, I want to load the out file and compare the memory after the boot, is there an explanation how to read the dat file,

    Please let me know when you are testing my file,

    Many Thanks,

    HR

  • Hi HR,

    The problem is the FPGA in the EVM is programmed to always boot to the I2C to do the PLL fix and re-enter the boot to boot in the specified bootmode. I beleive that you would have over written the iBL that is there in the I2C, so it just hangs there. Can you please load the iBL and try it again. Sorry I couldn't catch this earlier.

     

    Thanks,

    Arun.

  • Hi Arun,

    I reloaded the ibl SW to the EEPROM which didn't help,  please send me the simple.out and simple.rmd files,

    Have you tried loading my file,

    Thanks,

    HR

  • Hi Arun,

    I have checked that the Ibl is working correctly by loading the post.out file to the NOR flash and running the ibl,

    Please let me know if you tested my SW,

    Thanks,

    HR

  • Hi Arun,

    Any update? any issues with testing my SW?

    Thanks,

    HR

  • HI HR,

    I am not able to get your code booted up. But I can do my code. Can you please check the code. Were you able to run the .out file through CCS?

     

    Thanks,

    Arun.

  • Hi Arun,

    The code is the post with a change in the version# and it is working under CCS, can you try converting the TI post out and try loading it, is there a different with the rmd when using the EEPROM or the NOR flash?

    Thanks,

    HR

  • HR,

    The problem is not in the generating the .dat file, but the problem is in setting the bootstrap pins.

    The address width on the Shannon EVM is 24 bit so you need to set it to 24 bit in the bootstrap pin also. The correct values are below

    Switch positionss:    4   3    2   1

    SW3 :     1   1   0    1

    SW4 :     0    0   0    0

    SW5: :     0    1   0    0

    SW6 :     0    0   0    1

    Thanks,

    Arun.

  • Hi Arun,

    Thanks, with this setting the bin files works (The batch file needs to be changed as there are a few additional lines which teir output is not used) while the dat files doesn't work, there are changes in the map file while the bin file uses an I2C params and the dat file uses the SPI params, Any reason for this?

    The bin prepare file - 

    - hex6x

    - bconvert64x

    - b2i2c

    - b2ccs

    - romparse

    - ccs2bin

    The dat prepare file (with changing the 0x51 to 0x0 in the dat file)- 

    - hex6x

    - b2i2c

    - b2ccs

    - romparse

    - byteswapccs

    Thanks,

    HR

  • Hi Arun,

    Have you tested the bin or the dat file?

    Thanks,

    HR

  • Hi HR,

    Just closing it as it is verified.

    Thanks,

    Arun.

  • Hi Arun,

    Have you checked loading the dat file? Is there a place which describes the dat file structure?

    Thanks,

    HR

  • Hi Arun,

        I have implemented booting from SPI NOR Flash on C6678 EVM. Now I am trying to do it on a custom board whose input clock runs at 50 MHz..

    But it can't be booted up. I use the  following parameters and utility you posted before.

    ArunMani said:

    length 40
    checksum 0
    boot_mode 50
    portNum 0
    swPllCfg_msw 0
    swPllCfg_lsw 0
    options 0
    addrWidth 24
    nPins 4
    csel 0
    mode 1
    c2tdelay 1
    cpuFreqMhz 800
    busFreqMhz 0
    busFreqKhz 500
    read_addr_msw 0
    read_addr_lsw 0
    next_csel 0
    next_read_addr_msw 0
    next_read_addr_lsw 0

     

        Here are my questions.

    1. Since the main PLL stays in bypass mode during spi boot process,then swPllCfg_msw and swPllCfg_lsw should be set to 0,right?

    2. Do I need to program the main PLL to bypass mode in my application?

      Or this is done in the bootloader automatically?

    I am looking forward to your reply.

    Thanks.

    Nuoxi

  • Hi Nuoxi,

    There might be few issues. First the NOR writer we package in MCSDK is EVM specific. It depends on the NOR you have in your board. If you have the same NOR, then don't worry about it. Second, we have 24bit address width. In our EVM we do not support 16 bit. You need to find out what is the address width configuration in you NOR device. Based on that the above parameter table need to be changed. Another more frequent issue is that in the EVM the wiring are such that you use the byteswaping to swap the bytes in the boot table that we created. It might not be the case, so use the bin file that was not byteswaped and try if that works.

    Thanks,

    Arun. 

  • Hi Arun,

        I have tried according to what you said,but it still can't be booted up. 

        Someone tells me that secondary_pll_fix downloaded from wiki should be programmed into I2C EEPROM to implement SPI boot. Please confirm.

    However,my board doesn't have a I2C. So in my application, according to the errata, I set the Powndown bit ,wait for some time,and then clears it.

    Then I initialize the PLL and set it in bypass mode.Is this correct?

        I also doubt that wether the port number of SPI is 0 or not. Is there any document that describes the allocation of port number?

    Thanks,

    Nuoxi

  • Dear Arun,

     I also ran into the same issues.

     I am using TMDXEVM6678LE Rev 1.0, with mcsdk_2_00_05_17, CCS version 5.1.

     I2C factory P.O.S.T. boots ok from I2C (although UART output is inconsistent).

     I did not modify the factory I2C EEprom.

     I tried to load various ".bin" files to the SPI NOR using nor_writter, including post.bin generated by the supplied tools.

     The load and boot dip switches were configured correctly each time.

     From the above long community post, I still can't manage to achieve a full process of creating my own application and booting it from SPI NOR.

     I can see that it worked for Member HRi.

     Can you elaborate on the working process of creating my own application and booting it from SPI NOR?

     Thanks,

     ATl.

     

  • Hi Arun,

    Following my previous question, do you have a suitable method for creation SPI NOR boot for the 6678?

     

    Avi Tal said:

    Dear Arun,

     I also ran into the same issues.

     I am using TMDXEVM6678LE Rev 1.0, with mcsdk_2_00_05_17, CCS version 5.1.

     I2C factory P.O.S.T. boots ok from I2C (although UART output is inconsistent).

     I did not modify the factory I2C EEprom.

     I tried to load various ".bin" files to the SPI NOR using nor_writter, including post.bin generated by the supplied tools.

     The load and boot dip switches were configured correctly each time.

     From the above long community post, I still can't manage to achieve a full process of creating my own application and booting it from SPI NOR.

     I can see that it worked for Member HRi.

     Can you elaborate on the working process of creating my own application and booting it from SPI NOR?

     Thanks,

     ATl.

     

     

    In addition, I am looking for a way to send and receive data to and from the 6678 EVM via PCIE.

    Do you have a Windows 7 side PCIE driver and sample code that achieves this?

    A while back I was working with the DM648, and the EVM manufacturer (Lyrtech) provided such a driver (by Sheldon Instruments), along with a sample application.

    Do you have such an example for the 6678 EVM (Advantech)?.

    Thanks,

    Avi Tal.

     

     

  • Hi Arun,

    I followed the steps you mentioned in this thread and wrote SPIboot_le.dat file into NOR flash with no boot mode. After power off and on i changed the boot settings as sw3(1-4) 1011 sw4(1-4)0000 sw5(1-4)0000sw6(1-4)0001 and my evm board is 6670 rev3. After power how come i will know that code is flashing from NOR? Is it like a blink of leds some thing like that..Please reply