PSoC 6 Pioneer BLE Board Virtual Com Port Rx Stops working but Tx still working.

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

cross mob
SimonCanada
Level 3
Level 3
25 replies posted 10 questions asked 50 sign-ins

I have got the Pioneer kit working with various peripherals. In a testbed program I make extensive use of the virtual com port to the PC to carry debugging information and to select various hardware tests to run. Everything has been running nicely.I am using PSoC Creator 4.4.

I have just added a new hardware module to this testbed which consists of a hardware board connected by the Arduino connectors and a code library from its manufacturers, for which I supplied a port for the PSoC 63. On its own in an app, this code seems to work very well, and it seems to be working in my testbed, except:

After I have run its initialisation routine, the virtual com port continues to send more data to the PC, but no data is received from the PC. Pressing the Reset button on the Pioneer board resets the program but the RX from the PC still doesn't work. The only way to restore full function seems to be to unplug the USB and plug it back in again, which works every time.

The new routines do make some use of the com port, but only using printf(). My input function just uses getchar().

Can anybody suggest what is happening to "lock up" the RX function?

0 Likes
1 Solution
PandaS
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 5 likes given

Hi @SimonCanada ,

The link to the Architecture TRM of PSoC62 : https://www.infineon.com/dgdl/Infineon-PSoC_6_MCU_PSoC_62_Architecture_Technical_Reference_Manual-Ad...

The link to the Register TRM of PSoC62 : https://www.infineon.com/dgdl/Infineon-PSoC_6_MCU_PSoC_62_Register_Technical_Reference_Manual-Additi...

Steps to observe register in debug mode on PSoC Creator:

1. Debug the application by clicking on the following icon

PandaS_0-1652156095701.png

2. Go to Memory window and enter your desired register address. Follow the Register TRM for the same.

PandaS_1-1652156273274.png

Note: If the Memory Window is not open, go to Debug -> Windows -> Memory.

 

Regards

Sobhit

 

View solution in original post

5 Replies
PandaS
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 5 likes given

Hi @SimonCanada ,

May I know if Rx and Tx mentioned in the thread are from the PSoC or the PC's point of view i.e. Whether data coming from PC is not captured by PSoC or vice-versa.
Next, I would also like you to try; removing the External Module and running the code by handling the errors. That would ensure the module is not using the Rx or Tx Pins.
Lastly, it would be great if you can share the code so that I can assist you better.

Thank you
Sobhit

0 Likes

Hi Sobhit

The Rx and Tx that I mentioned are the Rx and Tx designated by the UART. These are connected as per many examples for PSoC 6 supplied by Infineon using the PSoC Creator 4.4. So, here are the pin assignments

SimonCanada_0-1651494128347.png

I have assigned UART RX to P5.0 and TX to P5.1. On the PSoC 6 BLE Pioneer board, these pins are then connected to signals called UART_RX and UART_TX respectively:

SimonCanada_1-1651494384747.png

SimonCanada_2-1651494415767.png

Now, the rest of the work of converting this to a virtual com part is all done by the Pioneer's PSoC 5LP-based KitProg2 circuit.

When we build the program, the instructions are to Select Build Settings then Peripheral Driver Library, then Retarget I/O.

SimonCanada_3-1651494673324.png

And then we are instructed to use Build | Generate Application, then find stdio_user.h, and modify the define got IO_STDOUT_UART and IO_STDIN_UART as shown here:

SimonCanada_4-1651494896562.png

I have renamed my UART instance to just UART, rather than the default UART_1.

Anyway, this all works perfectly, and I use it to provide the in-house user with a simple text menu-driven interface through the virtual com port. This proves that I am both reading and writing data correctly. 

Then, ONLY when I command it run the new piece of code, after the command has finished, the RX is no longer working and I need to power cycle the PSoC Pioneer to get it to work again.

" it would be great if you can share the code so that I can assist you better ": I have done my best to show you the set-up. I am not allowed to show you the source for our application on a public forum, and you would not be able to run it because all it will do is to detect that the additional (expensive) hardware that I am testing is not present, and put up an error message. You would not be able to see the problem occur.

So "removing the External Module and running the code by handling the errors": if the module is not present, everything works perfectly. If the module is present, everything works unless I invoke the new function.

I realise that it is difficult: what I am looking for is an answer to how the virtual com port on the Pioneeer board can lock up this way, and stay locked up until a power cycle. In the case of the UART/SCB, I would like to know if there is:

  1. Documentation of the hardware registers (both of the SCB and of the NVIC) that show if the port is blocked because one of the error flags is set and not being handled/cleared by stdio?
  2. How can I use PSoC Creator V4.4 to see hardware registers in debugging mode?

I did look for answers to these questions yesterday and I simply could not find them.

Thank you, Simon

0 Likes
PandaS
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 5 likes given

Hi @SimonCanada ,

The link to the Architecture TRM of PSoC62 : https://www.infineon.com/dgdl/Infineon-PSoC_6_MCU_PSoC_62_Architecture_Technical_Reference_Manual-Ad...

The link to the Register TRM of PSoC62 : https://www.infineon.com/dgdl/Infineon-PSoC_6_MCU_PSoC_62_Register_Technical_Reference_Manual-Additi...

Steps to observe register in debug mode on PSoC Creator:

1. Debug the application by clicking on the following icon

PandaS_0-1652156095701.png

2. Go to Memory window and enter your desired register address. Follow the Register TRM for the same.

PandaS_1-1652156273274.png

Note: If the Memory Window is not open, go to Debug -> Windows -> Memory.

 

Regards

Sobhit

 

Hi Sobhit

Thanks for that. Does it make any difference that I am using a PSoC BLE Pioneer which your 101 training videos say is a PSoC 63 (your references are for 62)?

I did try to view the registers the way you describe but was rather put off by needing to type in a full address. In Keil and IAR I am used to a mnemonic interface for registers so I just assumed that Creator would have that, too.

Anyway I did find the root of my problem, which is that it seems that the Pioneer board's KitProg2 reserves P5.2 for CTS and reacts to CTS being driven active by blocking any characters received from the PC. Even if the project is configured not to use RTS/CTS handshaking on P5.3 and P5.3. I am using an AD5940 EVAL board as a slave in the PSoC's Arduino connections and this is hard wired to use P5.2 as an interrupt output.

Now I understand what was happening, I can work around it by resetting the slave board while my menu system is also running.

Thanks for your help, Simon

0 Likes

Oh, in addition to my reply, I have already ordered some more patch leads and a USB-serial 3V3 convertor so I can try reassigning the virtual port to pins that I can use a scope on, in case it is a weird issue with the Pioneer.

0 Likes