• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » How to load programs to the EEPROM via I2C(TMS320C28346)
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • How to load programs to the EEPROM via I2C(TMS320C28346)

    How to load programs to the EEPROM via I2C(TMS320C28346)

    This question is not answered
    BIN YAO
    Posted by BIN YAO
    on Aug 24 2012 00:42 AM
    Prodigy120 points

    Hi all,

    I have had a question for a long time and I still don't know how to deal with it.

    I want to load my program to the EEPROM via I2C so that I can do my experiment with the emulator. However, I don't  how I can achieve it.  One of the TI's examples shows how to load data to the EEPROM, but in my opinion, program and data may be a little different as we should add BOOTLOAD to the program. So I feel quite confused.

    If possible, I hope that someone show me that how to load the TI's example 'timed_led_blink' to the EEPROM via I2C and run it after reset.

    I am appreciate for any reply.

    C28346 EEPROM I2C
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Daniele Angelosante
      Posted by Daniele Angelosante
      on Aug 27 2012 08:43 AM
      Prodigy155 points

      Hi Bin,

      do you have the solution? I have the same problem.

      Best

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BIN YAO
      Posted by BIN YAO
      on Aug 27 2012 21:46 PM
      Prodigy120 points

      Hi Daniele,

      So far I have not found the solution and I am still trying to get it. If you find the solution, I hope that you share it with me. Of course, if I find it earlier than you, I will also tell you.

      Best wishes!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • David Oleszkiewicz
      Posted by David Oleszkiewicz
      on Aug 28 2012 00:30 AM
      Prodigy40 points

      If you set the GPIOs right you can get the boot rom code that is programmed by default into the boot rom section of the TI chip to pull code from your I2C EEPROM chip at address 0x50.  Set GPIO 84, 85, 86, 87 to 0, 1, 0, 0 respectively.  Of course you first need to program you executable into EEPROM.

      We had an issue since we had code that was larger in size than the 64 Kb (16 bit address space) limit that the boot rom code can use. We placed one 64 Kb EEPROM chip at I2C address 0x50 and another 256 Kb EEPROM at address 0x54.  The 256 Kb address space is split across subsequent 64 Kb chunks of memory which each get a separate I2C slave address (0x54, 0x55, 056, 0x57).  After a lot investigating I took the TI boot rom code from the controlSUITE and made a project and modified it to be able to access multiple EEPROM chips to load the code into memory.  I I took my modified the boot rom code project and wrote it to the 64 Kb EEPROM at address 0x50.  With the GPIOs set right, the TI boot rom loaded my "secondary" boot loader code into the lower address space and ran it and it read my 256 Kb worth of EEPROM and loaded the code into the higher address space and executed it.  I used the i2c_eeprom project in the controlSUITE as a model to make my EEPROM programmer project to write my modified boot rom to the 0x50 chip and to write my project binary to the 256 Kb chip. It was a little tricky to get both the loader and write to handle multiiple I2C slave devices to manage my 256 Kb EEPROM chip .

      The example led blink program is small enough to fit into the 64 Kb EEPROM so you can take the I2C EEPROM example (i2c_eeprom) in the controlSUITE and modify that to write your program image into EEPROM.  Use hex2000  to generate a program image that is compatible with the boot rom loader.  ex:

      hex2000 Debug/led_blink.out --boot -o led_blink.bin -i2c8 -i2cpsc 0 -iscclkh 54 -i2cclkl 54 -b

      Then program the resulting .bin file into EEPROM for the boot loader to pickup.  You might be able to play with the clock speeds to make the load faster.  To load my 200 Kb program image out of my 256 Kb EEPROM it takes almost 30 seconds ...although that's fine for my applications so I haven't played much with speeding things up. 

      David Oleszkiewicz

      Adsys Controls

      Delfino C28346
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Holger S
      Posted by Holger S
      on Aug 28 2012 00:44 AM
      Genius10700 points

      please also have a look into the document "Programming External Nonvolatile Memory Using SDFlash
      for TMS320C28x Devices":

      http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=spraaw0&docCategoryId=1&familyId=919

      Regards
      Holger

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BIN YAO
      Posted by BIN YAO
      on Aug 28 2012 01:48 AM
      Prodigy120 points

      Hi David,

      Thank you for your reply. Now I have the .bin file but I don't know how to add it to the 'i2c_eeprom' example. Do I have to copy the data from the .bin and paste in the example?  Is there any convenient method to write the data to EEPROM?

      In addition, the example limits that the 'MAX_BUFFER_SIZE' should be small than 16 due to the FIFO's. How can I write more data to the EEPROM? Where should I change my setting in order to get it?

      Best wishes!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Holger S
      Posted by Holger S
      on Aug 29 2012 04:30 AM
      Genius10700 points

      Hi,
      in CCS you can load a file inti the MCU memory. This function can be found in the debugger Memory Window. There is a button Load Memory. You can load your bin file in a free RAM space of the C2834x and then write it to the EEPROM over I2C.

      Regards
      Holger

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Daniele Angelosante
      Posted by Daniele Angelosante
      on Aug 29 2012 06:29 AM
      Prodigy155 points

      Hi Holger,

      from what you write it seems quite simple. But I still cannot follow your steps. Can you please add a bit more explanations?

      Best

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • David Oleszkiewicz
      Posted by David Oleszkiewicz
      on Aug 29 2012 12:08 PM
      Prodigy40 points

      The MAX_BUFFER_SIZE only applies to how much data can be written to I2C EEPROM during a single I2C bus access.  You can repeatedly build I2cMsgOut1 with information that you want to write to the EEPROM and send out the information.  The whole message thing that they build in the example seems needlessly complex, but basically when you write to I2C EEPROM memory you send out the slave address on the bus, then two bytes worth of memory address on the EEPROM device and then all the bytes of data that you want to write starting at the address sent out.  If you repeatedly populate I2cMsgOut1 with the address you want and the data you want and call I2CA_WriteData you can write out more information to EEPROM.  Also if you are running your application in a debugger you can just use fopen to load your file off your host file system.  So in the for loop I just read 2 bytes at a time, populated I2cMsgOut1 with that data and called I2CA_WriteData.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BIN YAO
      Posted by BIN YAO
      on Aug 30 2012 04:48 AM
      Prodigy120 points

      Hi David,

      Thank you  for you explanation.

      I now understand the idea you provide but I am not familiar with the 'fopen' operation. I wonder if you could share me with code which loads the 'timed_led_blink.bin'. since I am new for DSP, I didn't cantact with some peripherals,including i2c.

       Now I know that once I have transmitted 14 words to the EEPROM, I should jump to an interrupt which refresh the I2cMsgOut1.MsgBuffer and write to the EEPROM again. However, as I am confused about how the interrupt works I have no idea to modify my program.

      Best wishes!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BIN YAO
      Posted by BIN YAO
      on Aug 30 2012 04:52 AM
      Prodigy120 points

      Hi Holger,

      What confuses me most is that how to use the I2C interrupt to write my data to the EEPROM continuously. Could you make some more explanation?

      Best wishes!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BIN YAO
      Posted by BIN YAO
      on Sep 05 2012 21:17 PM
      Prodigy120 points

      Hi David,

      I now write the .hex file to the EEPROM from the page 00 to page 1C. However, when I restart the chip, the program cannot run. Is there anything else I should do to run the program? (The first address of each page is 0x00)

      Here are my .cmd file and .hex file.

      0412.LEDBlink_hex.txt

      5504.LEDBlink_cmd.txt

      Best wishes!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use