This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: During the process of address transfer, higher significant bits are lost and less significant bits are transfered correctly

Part Number: TMS320F28379D

Hi:

    During the code debugging, I encounted a issure. when one address are transfered from actual parameter to formal  parameter. Only less significan bits are transfered correctly, whereas the

higher significant bits are lost. I don't know why it happen and  can you give me solution about it. I hope that i can receive your response asap.

      Here  the address of gst_Uart  is 0x14680

  but the value of pst_Uart is 0x4680, higher bit are lost.   

   

    Best Regards!

   GOOD LUCK

  • Hi,

    For some reason, I am unable to view the images you have attached in the description
    Please make sure the parameter type is uint32_t. Also make sure the function prototype is correctly declared in the file which calls that function

    Regards,
    Veena
  •  HI:

       Thank you for your immediate reply.

       Data type of   gst_Uart  and pst_Uart  are both st_DBG_UART_t  which is a strcut type.


    typedef struct
    {
     // Input
     e_SCI   e_Sci;
     e_DBGPROTO_DEST e_Dest;
     e_DBGPROTO_RES (*e_pfunc_Interpreter)(st_FIFO *st_Fifo, e_DBGPROTO_CMD e_Cmd);

     // Auxiliary Variables
     uint16_t u16_State;
     uint16_t u16_RxState;
     //
     e_DBGPROTO_DEST e_DestId;
     e_DBGPROTO_CMD e_Cmd;
     uint16_t  u16_Len;
     st_CRC  st_Crc;
     //
     uint16_t u16_RxTimeOut;
     //
     st_FIFO  st_Fifo;
     uint16_t pu16_Buffer[DBG_UART_BUFF_LEN>>1]; // UART buffer
      }st_DBG_UART_t;

    DBG_UART_UartManager(&gst_Uart);

    void DBG_UART_UartManager(st_DBG_UART_t *pst_Uart)
    {
     uint16_t u16_Tmp;
     switch(pst_Uart->u16_State)
     {
            case DBG_UART_RX:

     

  • Hi,

    Do you have the function prototype defined in the file before the call is made? I see that the DBG_UART_UartManager function is called before its definition.
    I have come across a similar issue where the function prototype was missing and the compiler assumed the parameter is 16-bit whereas actually it expected a 32-bit parameter.


    Regards,
    Veena
  • Hi:

        Thank you for your reply.

        As you said, I have defined the function DBG_UART_UartMangager before it is called. This function is called in main.c file and defined in other file. At the

    same time, corresponding   .h  file  is included in the main.c file. The address of variable has been transfered to the formal parameter but the higher significant bit lost

    and only the less significant bits are reserved. I don't know the real reason!

         I hope you can give me a effective method to solve this problem. Thank you!

        Best Regards!

       

  • Hi.

    I am forwarding this query to the compiler team.

    Regards,
    Veena
  • I'd appreciate if you would prepare a test case for two source files.  One is the source file which contains the function DBG_UART_UartManager, and the other is the source file with the problem call to DBG_UART_UartManager .  For each file, please follow the directions in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George