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.
do you have the solution? I have the same problem.
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.
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.
please also have a look into the document "Programming External Nonvolatile Memory Using SDFlashfor TMS320C28x Devices":
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?
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.
from what you write it seems quite simple. But I still cannot follow your steps. Can you please add a bit more explanations?
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.
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.
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?
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.
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.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.