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.
Tool/software: Linux
Hi,
I am working on a custom platform, running on linux, which uses TPS65981. The TPS65981 is connected to an application processor through I2C interface. An SPI Flash is connected to TPS65981 as shown in the block diagram.
There should be a firmware image or binary file, representing Application Code, that has to be loaded to the SPI flash in order to configure and initialize TPS65981. Can you provide inputs on how to generate the firmware image using TI's Configuration Tool and how to validate it?
I have used an open source device driver, tps6598x.c, for TPS65981.
Link - https://github.com/torvalds/linux/blob/master/drivers/usb/typec/tps6598x.c
But I don't see any support for programming the firmware to the external SPI flash in the above device driver.
Assuming that the firmware image or binary file has been successfully generated from TI's configuration tool, then how can I accommodate to program the SPI flash?
You may also share a reference device driver, if available, that can support SPI Flash programming.
Below is a section of block diagram of the platform.
----------------------------------- ---------------------------------- ------------------------
| | | | | Type-C |
| | | |<--------------------->| Connector |
| Application |<------------->| | --------------------------
| | | |
| Processor | | | --------------------------
| | | TPS65981 | | |
| | | | | SPI |
| | | |<---------------------->| Flash |
----------------------------------- | | | |
| | --------------------------
| |
----------------------------------
Hi Tarun,
You can use the TPS6598x application customization tool to generate your binary SPI Flash image. Here is a link to the tool:
There is also a user's guide for the tool at the following link:
Finally, after the SPI Flash has an original image on it, the TPS65981 can update the contents of the SPI flash over I2C using I2C commands. Here is an application note on this feature:
If this answers your question, PLEASE select This resolved my issue
Thank you,
Eric
Hi Eric,
Thanks for the reference documents and tools.
I used Application Customization Tool to generate a .bin file and Host Interface Tool to load the image to the SPI Flash using Totalphase software with the Aardvark. Though, the flashing process was successful I didn't observe the behaviour of PD controller as expected. There might be some more changes required in the configuration.
Actually, it took a lot of external wiring and rework to flash the SPI device using Aardvark.
As mentioned in your previous reply, after the SPI Flash has an original image, TPS65981 can update the contents of the SPI Flash over I2C using I2C commands.
-- Can TPS65981 load (not update) the contents on a (fresh) SPI flash over I2C using I2C commands through the processor? If that works, I can include it the device driver.
-- How can I validate the SPI flash content after successful flash?
For your reference, I've attached a block diagram of the platform.
Thank you,
Tarun
Hi Tarun,
The function of updating the SPI Flash contents over I2C will only work once there is already a valid configuration image inside the flash. In other words, the TPS65981 has to be fully booted and in "APP" mode for this function to work.
Make sure you are using the "Full Flash" .bin file when you are updating the SPI Flash. Once you have a valid full flash image onto the TPS65981, you can double check that it is functional by checking the Mode register and reading back "APP".
Once your TPS65981 is fully operational, you can then use the Low Region .bin file to update the contents of the SPI Flash over I2C. The app note that I linked in my previous post has more details on that feature.
Your block diagram looks correct to me, thank you for sharing.
If this answers your question, PLEASE select This resolved my issue
Thank you,
Eric
Hi Tarun,
1. for the TPS65981, you should use the IntEvent1 register.
2. Do you mean you are not seeing the I2C interrupt for plug insert or removal? I would suggest clearing all interrupts on the TPS65981 after booting. The right time to do this would be when you can read APP from the Mode register (0x3) after booting.
3. I'm not sure what could cause that behavior. I just tested this on the TPS65981EVM using firmware from the 4.01 GUI on TI.com and could not see this behavior. Do you have an EVM that you can test against?
4. We do not have a device driver for the TPS65981. Typically, the customer develops their own using our host interface documentation. Also, if you need a .bin for a DRP configuration, you can generate one using our GUI tool which can be downloaded from here:
If this answers your question, PLEASE select This resolved my issue
Thank you,
Eric
Hi Eric,
As you mentioned in the previous reply that I should use IntEvent1 register, but in my platform the I2C address of TPS65981 is 0x27 and according to the configuration tool 0x27 is for I2C2. (Screenshot attached)
It's little confusing as I can read both interrupt registers' PlugInsertOrRemoval bit as high all the time.
I can arrange TPS65986 EVM if you suggest. Will that work similar to TPS65981 in order to check the firmware?
There are few points which needs your explanation :
1) While configuration on TPS6598X Configuration Tool (v3.18 as well as v4.01), under the "Raw View" section there is a column named "Mask" which shows 0x80808080 for all the registers. What does it mean? (Screenshot attached)
2) How to clear all the interrupts on TPS65981 after boot ? I can see Mode register value as "APP". If I write 0xffffffff on IntClear1 or InClear2, based on your reply of the point 1) , will the IntEvent1 or IntEvent2 will become 0x0?
If yes, then what will be the value of IntClear1 or 2 register after interrupt is cleared? Will it hold the previous value or it will automatically become 0x0 ?
3) Do we need to clear the interrupts manually by writing it in the ISR? Or it will be cleared automatically as soon as ISR is returned?
I'm also attaching the project file of TPS6598x Configuration Tool for your reference. Kindly, have a look and tell me if I have missed anything or wrongly configured in that.
Thanks and Regards,
Tarun
Hi Tarun,
1. The Mask under Raw View indicates which device you are programming. If you have multiple devices setup using App Config GPIOs, the mask value would be different for those virtual devices. You can read more about the App Config GPIOs in our GPIO app note under the TPS65981 product page.
2. You are correct, writing all FF's to the IntClear registers will set the interrupts flag's back to 0. If a new interrupt event gets triggered right after, the interrupt will be set to 1 again.
3. Interrupts must be cleared manually.
I looked at your project file as well and do not see any obvious errors. Depending on your system schematic, I think it should be okay.
If this answers your question, PLEASE select This resolved my issue
Thank you,
Eric