Error: 'UART_0' undeclared (first use in this function)

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

cross mob
PierceBoughton
Level 1
Level 1
First like given 5 sign-ins First reply posted

Hi,

I've been using DAVE IDE to program my XMC4700 Relax Kit. I've tried using some sample code to get UART working, but keep getting the error as shown in the title. Additionally, I am also receiving warnings for implicit declaration of function 'UART_Transmit' and 'UART_RECEIVE'. 

The UART_0 APP is in the APP Dependency tree, and I've followed all the steps outlined in the UART index.chm file.  I think the UART APP must not be initializing correctly. Any help would be appreciated. Thanks

Here is my code:

#include "DAVE.h"


uint8_t data[] = "Infineon Technologies";
uint8_t rec_data[10];
int main(void)
{
DAVE_STATUS_t status;

status = DAVE_Init(); /* Initialization of DAVE APPs */

if(status == DAVE_STATUS_FAILURE)
{
/* Placeholder for error handler code. The while loop below can be replaced with an user error handler */
XMC_DEBUG(("DAVE Apps initialization failed with status %d\n", status));
while(1U)
{
}
}

UART_Transmit(&UART_0, data, sizeof(data) - 1); //Transmit the string "Infineon Technologies".

while(1U)
{
}

return 1;
}

void EndofTransmit()//Callback functin for "End of transmit" event.
{
UART_Receive(&UART_0, rec_data, sizeof(rec_data));
}

void EndofReceive()//Callback function for "End of receive" event.
{
UART_Transmit(&UART_0, rec_data, sizeof(rec_data));
}

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Owen_Su
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi, @PierceBoughton ,

    Are you using our official routine? Or do you add an 'UART' APP to your code yourself?

    If you add APP by yourself, do remember to click 'Generate Code' to generate relevant function definitions.

    You can refer to the attachment, or you can share your project with us. Hope this can help you.

BR,

Owen

View solution in original post

2 Replies
lock attach
Attachments are accessible only for community members.
Owen_Su
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi, @PierceBoughton ,

    Are you using our official routine? Or do you add an 'UART' APP to your code yourself?

    If you add APP by yourself, do remember to click 'Generate Code' to generate relevant function definitions.

    You can refer to the attachment, or you can share your project with us. Hope this can help you.

BR,

Owen

Yes. All fixed. Thank you!

0 Likes