• AVR Freaks

Hot!Cannot compile UART6_ReceiverIsReady().

Author
ysaitoysaito
Super Member
  • Total Posts : 409
  • Reward points : 0
  • Joined: 2010/08/13 08:31:35
  • Location: 0
  • Status: offline
2020/06/22 19:55:42 (permalink)
0

Cannot compile UART6_ReceiverIsReady().

I use Harmony Ver.3. and PIC32MZ2048EFH100.

I would like to try to test UART of the following  byte-by-byte model usage ,which exist in help_harmony_csp.chm. (Peripheral Library Overview > Peripheral Libraries Help > Peripheral Libraries > UART Peripheral Library Help > Using the Library)

 Namely the following code is Microchip sample code for UART.


 char rxData;
 char txData = 'A';

int main(void)
{
    if(UART6_ReceiverIsReady() == true)
    {
        rxData = UART6_ReadByte();
    }

    if(UART6_TransmitterIsReady() == true)
    {
        UART6_WriteByte(txData);
    }

}


I stepped below.
//----------------------------------------------
1. Activated Components are as follows.
   Core, Device Family Pack(DEP), System, UART6, USART-Instance 0

2. After I Activated  above, I connected UART6 and USART-Instance 0,

3. I checked "Enabled" of UART6 : "Enable interrupt ?"  at configuration option.

4. I generated the source code by MHC and I modified above in main.c

5. I tried to "Clean and Build project".
   
6. I encountered below compile error.  

../src/main.c:44:5: error: implicit declaration of function 'UART6_ReceiverIsReady' [-Werror=implicit-function-declaration]
     if(UART6_ReceiverIsReady() == true)
     ^
../src/main.c:46:9: error: implicit declaration of function 'UARTx_ReadByte' [-Werror=implicit-function-declaration]
         rxData = UARTx_ReadByte();
         ^
../src/main.c:49:5: error: implicit declaration of function 'UART6_TransmitterIsReady' [-Werror=implicit-function-declaration]
     if(UART6_TransmitterIsReady() == true)
     ^
../src/main.c:51:9: error: implicit declaration of function 'UARTx_WriteByte' [-Werror=implicit-function-declaration]
         UARTx_WriteByte(txData);


What should I do for fix above error ?
 What kind of header files should I add ?
or What should I do in MHC

 
Any advise me pleased.


ysaito
#1

2 Replies Related Threads

    vgandhi
    Senior Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2016/10/24 21:28:35
    • Location: 0
    • Status: offline
    Re: Cannot compile UART6_ReceiverIsReady(). 2020/06/22 21:06:14 (permalink)
    5 (1)
    It seems you are using UART driver (UART driver instance 0 is connected to UART6 PLIB). The functions mentioned by you are not available when UART is configured in interrupt mode. Moreover, when a driver is connected to UART PLIB, application should use the APIs provided by the UART driver and should not directly access the UART PLIB that is owned by the driver. If you want to try out the byte model of UART then you must disconnect the UART driver from the UART6 PLIB. Then disable interrupt in UART6 PLIB. Regenerate and build your application.
    #2
    ysaitoysaito
    Super Member
    • Total Posts : 409
    • Reward points : 0
    • Joined: 2010/08/13 08:31:35
    • Location: 0
    • Status: offline
    Re: Cannot compile UART6_ReceiverIsReady(). 2020/06/23 02:02:22 (permalink)
    0
    Dear vgandhi

     Thank you very much for quick and excellent advise. I could compile my project by following your advise.  Namely I disconnected the UART driver from the UART6 PLIB and I removed Check of "Enable interrupts ?".
     I attached the screenshot of Project Graph.

    Again thank you very much indeed. I have annoyed this compiler error more than 1 week.

    ysaito

    Attached Image(s)

    #3
    Jump to:
    © 2020 APG vNext Commercial Version 4.5