SPI boot and SPI device

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KeWa_2323766
Level 4
Level 4
25 sign-ins First solution authored 25 replies posted

I am debugging FX3 SPI bus now. The schematic is as following:

  1. U1 is FX3
  2. U2 is the SPI flash memory for firmware image
  3. J3 is the connector for CMOS sensor with 1.8V SPI interface. GPIO 17 is used as its chip select signal.
  4. U3  is level shifter with /OE control signal which is pulled up to high level at power on.

  Capture.PNG

The problems I have are:

  1. If U3 installed, firmware image can’t download to SPI flash memory U2, FX3 can communicate with CMOS sensor through SPI
  2. If U3 not installed, firmware can download, but FX3 can’t communicate  with CMOS through SPI

Do you have a way to implement booting from SPI flash memory and configure CMOS through SPI after FX3 booting? Thanks in advance.

0 Likes
1 Solution

Hello,

When you keep U3 installed and try to download firmware from flash, the GPIO57 will go low. This is documented in the following Application Note.

https://www.cypress.com/file/201991/download

Please refer to page 40 of the application note mentioned above. From this, the state of GPIO57 will be LOW during SPI boot. Due to this reason, the level translator is enabled. This is the reason why FX3 reads data from image sensor when you are trying to boot from flash. The possible solution is to use another GPIO which remains in tristate when you try to boot from flash. You can also verify that the new GPIO do not go LOW when you try to Boot from Flash.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
10 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please route Slave select signal from FX3 to A4 pin of the level translator IC. After that, pull DIR4 also to VCCA. Please do this and let me know the result.

Also, i find that the Chip select for the Camera connector is always high. This might be the reason that when you connect U3, the camera starts communicating with FX3 and the bootmode is falling back to USB. But whenever U3 is not connected, the connector is not getting SPI clock and other signals from FX3. This causes FX3 to boot from flash. So please make use of a GPIO as chip select for camera connector and enable it whenever necessary.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Jayakrishna,

Thank you for your reply.  Chip select for camera is low valid, i.e. when chip select is high, the Camera SPI bus is not selected. At the same time, OE of U3 is pulled up and DIR signal of U3 for SCK is used  to block SCK from camera sensor  to FX3.  So, rerouting SS of camera to U3 does not work so far.

0 Likes

Hello,

Please find my comments below:

1. As you might be knowing, FX3 can act as an SPI master only. That is it can supply SCK to any slave device. So, the flash which stores the firmware and the camera both are acting as slave devices.

2. As you have two slave devices with SS active low for both, you need to have 2 slave select lines to select the correct slave device. This means that you need to use an additional GPIO as SS in addition to SCK,MOSI and MISO for communicating with the camera sensor. This GPIO can be turned HIGH for disabling the camera and maybe turned low for communicating with it.

Also, please answer my following questions:

1. Why have you pulled SS for camera high? This will permanently disable the camera right?

2. Why have you pulled OE High? From the datasheet of the level translator, i understand that when OE is pulled high, there is no operation at all. This is mentioned in table 2(Page 21) of the datasheet of the level translator. The link to the datasheet is given below:

http://www.ti.com/lit/ds/symlink/sn74axc4t774.pdf

Also, it is mentioned in the datasheet that OE should be pulled high during power on and power off. There is also a circuit diagram showing the connections for making the chip work as a level translator. This can be found in Page 22 of the datasheet (fig 10). This shows that a GPIO is used for turning the OE low when required.

3. Please let me know the power domain voltage level for the GPIOs also.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Jayakrishna,

Thank you for you reply.

1. As you might be knowing, FX3 can act as an SPI master only. That is it can supply SCK to any slave device. So, the flash which stores the firmware and the camera both are acting as slave devices.

A: yes. I am aware of FX3 can only be master

2. As you have two slave devices with SS active low for both, you need to have 2 slave select lines to select the correct slave device. This means that you need to use an additional GPIO as SS in addition to SCK,MOSI and MISO for communicating with the camera sensor. This GPIO can be turned HIGH for disabling the camera and maybe turned low for communicating with it.

A:  flash memory use original SPI bus SS signal and CMOS uses GPIO 17. GPIO is set to high at power up. That is its pulled up resistor R27.

Also, please answer my following questions:

1. Why have you pulled SS for camera high? This will permanently disable the camera right?

A: It does not permanently disable the cmaera.

2. Why have you pulled OE High? From the datasheet of the level translator, i understand that when OE is pulled high, there is no operation at all. This is mentioned in table 2(Page 21) of the datasheet of the level translator. The link to the datasheet is given below:

http://www.ti.com/lit/ds/symlink/sn74axc4t774.pdf

Also, it is mentioned in the datasheet that OE should be pulled high during power on and power off. There is also a circuit diagram showing the connections for making the chip work as a level translator. This can be found in Page 22 of the datasheet (fig 10). This shows that a GPIO is used for turning the OE low when required.

A:I have the data sheet and I understand /OE has the functions you mentioned

3. Please let me know the power domain voltage level for the GPIOs also.

A: 1 & 2 are of 1.8V, others are of 3.3V.

0 Likes

Hello,

I understand that GPIO 17 is of 1.8V power domain voltage. Please correct me if Iam wrong. Also, I find that GPIO 17 is not connected in the schematic shared. Please confirm whether you are connecting it or not.

Also, in your first question, it was mentioned that when U3 was installed, you were able to communicate with the CMOS sensor but booting from flash failed. Please explain the steps that you followed for this test with respect to the different signals issued by FX3.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Jayakrishna,

GPIO17 is in another page of schematic. Since the whole schematic is big, I only show the part related SPI bus which I have problem with now. VIO1 adn VIO2 are connected to 1.8V.

In firmware, I set/OE to low to enable U3 and then write/read from CMOS through SPI. The read back value from CMOS sent to UART for display. I verified that the read back and write to is correct.  To run this firmware, I load firmware image to RAM in control center.

After I try to download the firmware to SPI memory, I can't download firmware to SPI flash memory. After I removed U3, I can download firmware to SPI flash memory and can boot from SPI memory.

0 Likes

Jayakrishna,

In short, I am trying to make both SPI booting and CMOS configuration works.

0 Likes

Hello,

Please let me know what is the the voltage output at GPIO 17 when you are trying to boot from Flash (SPI Memory). Also, please probe and share the SPI lines at CMOS sensor and SPI flash when U3 is installed and U3 is not installed.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hello,

When you keep U3 installed and try to download firmware from flash, the GPIO57 will go low. This is documented in the following Application Note.

https://www.cypress.com/file/201991/download

Please refer to page 40 of the application note mentioned above. From this, the state of GPIO57 will be LOW during SPI boot. Due to this reason, the level translator is enabled. This is the reason why FX3 reads data from image sensor when you are trying to boot from flash. The possible solution is to use another GPIO which remains in tristate when you try to boot from flash. You can also verify that the new GPIO do not go LOW when you try to Boot from Flash.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Thank you very much.

0 Likes