Micro stops running when try to write to Uart Egress Data Register

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

cross mob
Anonymous
Not applicable

Hi,

   

I am developing on fx3 super speed board. First the board boots from USB as cypress bootloader and I upload my own image to RAM. Then the board is enumerated as Cypress FX3.  A set configuration command is received from host computer, followed by a unknown vendor request 0xa0. Writing to UART Egress Data Register 0xE0000810  works fine before receiving unknown 0xa0 request, I can communicate with the micro attached to UART and finish protocol messages. After receiving the 0xa0 request and return with handle=False, I find a strange problem: I tried to write to UART Egress Data Register 0xE0000810, the whole micro totally stopped running.

   

 I checked the most UART registers just before writing to the Egress data Register.  UART Config Register= 0x80071103, UART Status Register=0x1f0000f0, UART Power Register=0x80000001, Uart interrupt Register=0xc8, Uart interrupt mask register = 0x202. All looks good. 

   

 

   

Can anybody kindly tell me what caused the problem?

0 Likes
5 Replies
Anonymous
Not applicable

Hi,

   

I am wondering if this has anything to do with the vendor command. Many PCs do send this unknow vendor command 0xA0, and as you mentioned, handle = false is the correct way to handle this. 

   

Can you please check if the UART has successfully written to the micro before micro fails?

   

Also, can you wait till 0xA0 is received and handled and then start the whole process of writing to UART register. This is just to corner down the source of the problem.

   

Regards,

   

- Madhu Sudhan

0 Likes
Anonymous
Not applicable

Hi, 

   

Writing to UART works before receiving 0xA0. I send "0x3F""Synchronized",clock rate and echo off commands to the UART attched micro, and received correct responses. After receiving 0xA0, I still can read the UART registers with status looks correct. Only writing to the egress data register cause the failure.

   

The register I read:

   

uart_config (0x80071103), uart_status(0x1f0000f0), uart_power(0x80000001), and uart_interrupt(0xc8)

   

If regardless of 0xa0 request, is there any known reason that writing to egress data register may cause system failure?

   

Thank you very much.

0 Likes
Anonymous
Not applicable

Hi,

   

Are you able to see the UART peripheral working once the system failure occurs? (Are you able to see the signal toggling on the UART Lines when you probe it? (Irrespective of whether the microcontroller receives it or not)

   

Regards,

   

-Madhu Sudhan

0 Likes
Anonymous
Not applicable

Hi Madhu,

   

Unfortunately, I can't probe it. But I am sure the UART peripheral is working.  I can write to Power register, I reset power register and am able to see the Config and Status register all react as expected.

   

Also, if I don't register for USBSetupCallback function (CyU3PUsbRegisterSetupCallback), means I don't have to receive and handle the 0xa0 request in my firmware, the UART works good. So all evidence point to the 0xa0 request, which cause a side effect of disabling writing UART egress data register.

0 Likes
Anonymous
Not applicable

Hi,

   

Can you please attach your firmware here?

   

Regards,

   

- Madhu Sudhan

0 Likes