UART_SpiUartGetRxBufferSize() doesn't work without debugger.

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

cross mob
tiphc_1376351
Level 3
Level 3
First like received

When I run my program with the debugger, it runs correctly.  When I run it without the debugger, the function  UART_SpiUartGetRxBufferSize() always returns 0, even when I type characters in.  Why would a function work when I run under debug and fail when I don't?

0 Likes
11 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you please post your complete project so that we all can have a look at all of your settings. To do so, use

Creator->File->Create Workspace Bundle (minimal)

and attach the resulting file.

Bob

0 Likes
lock attach
Attachments are accessible only for community members.

On Fri, Jan 25, 2019 at 2:21 PM user_1377889 <community-manager@cypress.com>

0 Likes
lock attach
Attachments are accessible only for community members.

Here it is, if our firewall doesn't strip it off.

On Fri, Jan 25, 2019 at 2:21 PM user_1377889 <community-manager@cypress.com>

0 Likes

Our firewall or the forum's is stripping the file from the reply. The

forum web-site's post button is not working for me.

On Fri, Jan 25, 2019 at 2:21 PM user_1377889 <community-manager@cypress.com>

0 Likes

I got two posts from you with the .zip attached. Probably your firewall is removing the attachment.

Bob

0 Likes

Having a look into your project: The interrupt priorities for UART and BLE are the same. Did you try using different priorities?

Bob

0 Likes

I did not try using different priorities. I have another project in which

the UART works perfectly well without any adjustment of priorities.

Tim Phillips

On Sat, Jan 26, 2019 at 6:44 AM user_1377889 <community-manager@cypress.com>

0 Likes
tiphc_1376351
Level 3
Level 3
First like received

I have found that if I do not enter the low power modes, the program works as expected.  So entering deep sleep is somehow incompatible with correctly-working reception of characters on the UART.

0 Likes

Hi,

You will have to enable wake up from deep sleep mode in the UART component customizer GUI, so that whenever a character is received, the system wakes up and handles it using an interrupt.

You could also refer to Low power modes in the SCB component datasheet.

Thanks,

Shanmathi

0 Likes

Already tried that. It didn't work.

On Mon, Feb 4, 2019 at 4:14 AM ShanmathiN_06 <community-manager@cypress.com>

0 Likes
lock attach
Attachments are accessible only for community members.
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi

I've attached a working project that uses UART to wake up from deep sleep and prints the data after waking up from a deep sleep mode.

Try adding UART_1_Sleep(); statement before entering into deep sleep (after line 171) and UART_1_Wakeup() after the deep sleep statement (after line 172). Details are provided in the component datasheet under Low power modes, pg 55.

Thanks and regards

Harigovind

0 Likes