S32K Autosar MCAL HLD LPUART Send Receive Error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K Autosar MCAL HLD LPUART Send Receive Error

5,981件の閲覧回数
nikhilvv07
Contributor II

hi,

Kindly go though following Post.

Re: S32K312 EVB Uart Not working - NXP Community

 

I have enabled Clock for LP Uart.

When am debugging the application am getting  Uart_AsyncSend = E_OK and Uart_GetStatus = ONgoing.

kindly help to resolve the issue

0 件の賞賛
返信
12 返答(返信)

5,251件の閲覧回数
nikhilvv07
Contributor II

hi,

I have cross checked with Example code given in S32DS and Did the similar configuration for Uart.

Still it is not working as normal.

Please check the mex file and other source codes attachment.

 

@cuongnguyenphu ..

0 件の賞賛
返信

5,267件の閲覧回数
nikhilvv07
Contributor II

HI,

Due to unavailability of EVB i could not able to test the code. Now i have received the EVB and tested again the UART Peripheral Test code.

Unfortunately i am receiving Some garbage Character in terminal and when i send any data from terminal to EVB , EVB not receiving any data.

When i connected Tx Pin to Rx Pin of Uart directly the Send and Receive functions are properly working. 

When i am checking in terminal software with help of level convertor am receiving unknown characters.

I checked Digital Input and EIRQ which are working Fine.

Kindly support me to solve the issue on UART. The codes and Mex files are attached.

0 件の賞賛
返信

5,936件の閲覧回数
nikhilvv07
Contributor II

hi,

Kindly Guide ...

S32K312 not sending any bytes..

0 件の賞賛
返信

5,933件の閲覧回数
cuongnguyenphu
NXP Employee
NXP Employee

Hi @nikhilvv07 , I saw in your previous Thread, @Robin_shen has spotted that you haven't initialized Peripheral Clock of LPUART0, did you try to update it yet?
If you still cannot monitor clock, could you please send to me your project via email [email protected]

 

0 件の賞賛
返信

5,927件の閲覧回数
nikhilvv07
Contributor II

Hi,

I have enabled the clock for LPUART0 and tried the same.

But not able to send any bytes.

Before enabling the clock the Uart_Init(NULL_PTR); itself getting failed to enable uart peripheral.

Now uart peripheral is successfully initiated and when trying to send am getting result as follows.

Send_Data(&char_a,1); // transmit n number of bytes to terminal

 

Uart_AsyncSend return with  E_OK

and 

Uart_GetStatus return ONgoing.

 

please check the attached LPuart transmit function for sending.

 

_nikhil

 

#include "Mcal.h"
#include "CDD_Uart.h"

#define UART_LPUART_CHANNEL  0	//LPUART Channel 0 for LTE Module.

Std_ReturnType Send_Data(const uint8* pBuffer, uint32 length);


Std_ReturnType Send_Data(const uint8* pBuffer, uint32 length) {
    volatile Std_ReturnType T_Uart_Status;
    volatile Uart_StatusType Uart_TransmitStatus = UART_STATUS_TIMEOUT;
    uint32 T_bytesRemaining;
    uint32 T_timeout = 0xFFFFFF;

    /* Uart_AsyncSend transmit data */
    T_Uart_Status = Uart_AsyncSend(UART_LPUART_CHANNEL, pBuffer, length);
    if (E_OK != T_Uart_Status)
    {
        return E_NOT_OK;
    }

    /* Check for no on-going transmission */
    do
    {
        Uart_TransmitStatus = Uart_GetStatus(UART_LPUART_CHANNEL, &T_bytesRemaining, UART_SEND);
    } while (UART_STATUS_NO_ERROR != Uart_TransmitStatus && 0 < T_timeout--);

    if ((UART_STATUS_NO_ERROR != Uart_TransmitStatus))
    {
        return E_NOT_OK;
    }

    return E_OK;
}

 

0 件の賞賛
返信

5,915件の閲覧回数
cuongnguyenphu
NXP Employee
NXP Employee

Hi, could you send me your project via mail if it ok for you, I would like to check further your configuration and your calling process

0 件の賞賛
返信

5,912件の閲覧回数
nikhilvv07
Contributor II

hi,

I already mailed you.. please check your mail.

Let me know if your not received the mail i will resend it ..

_Nikhil

0 件の賞賛
返信

5,909件の閲覧回数
cuongnguyenphu
NXP Employee
NXP Employee

Hi,
I still haven't received your mail yet, Could you try to send me again and this way also:
Go to Support.nxp.com > Cases > Find your create case with this thread (Case number 00586632)
> Attach your project here. This is the private way to share your project with non-NXP account

0 件の賞賛
返信

5,907件の閲覧回数
nikhilvv07
Contributor II

Hi sir,

 

i have sent the project file in private message.. Please check and let me know.

Thanks,

Nikhil v v

5,866件の閲覧回数
cuongnguyenphu
NXP Employee
NXP Employee

Hi, 
I checked your configuration, here is some findings:
1. If you want to use a pin SW5 as input to monitor interrupt:
  Port Module: Config PTB26 with mode EIRQ, not GPIO
  Icu Module: Create 1 Icu channel, refer to IcuSiul2. In IcuSiul2Channel, create an interrupt config array which use EIRQ[13] - PTB26. Then Enable IcuHwInterrupt config with corresponding SIUL2 IRQ channel (channel 13) 
  Platform module: Config ISR handler the same in Integration Manual (IM) document, which is contained in Icu module installation location:

cuongnguyenphu_0-1704284940551.png

cuongnguyenphu_1-1704284959501.png

Currently, you configured Platform ISR handler with your own function is incorrect. Instead, you can set your function Callback_IRQ13_SW5_PTB26 as Icu channel's Notification:

cuongnguyenphu_2-1704285089679.png

cuongnguyenphu_3-1704285503172.png

 

I think you should refer to the example of Icu: Icu_BlinkLed_ASR_Emios_S32K344, this example has config SIUL2 external interupt, and check my above findings.

2. Your Config platform module for UART's interrupt handler is wrong, you must set ISR handler's name as mentioned in Integration Manual (IM) of UART module:

cuongnguyenphu_4-1704285731703.png

cuongnguyenphu_5-1704285746482.png

And then set your Callback function for Uart in here:

cuongnguyenphu_6-1704285873831.png

For detail, I think you can also refer our example for Uart: Uart_Example_S32K344 to check my above findings.
Way to create example's project in S32DS:
File > New > S32DS Project from example >:

cuongnguyenphu_7-1704286045595.png

 

 

 

0 件の賞賛
返信

5,822件の閲覧回数
nikhilvv07
Contributor II

Hi,

As you said i added example project to my workspace from File->New->S32DS project from example.

After adding i direct build the project and am getting error while building.

Please find the build result.

 

12:17:05 **** Build of configuration Debug_FLASH for project Icu_BlinkLed_ASR_Emios_S32K344 ****
make -j8 all 
Building file: ../Project_Settings/Startup_Code/Vector_Table.s
Building file: ../Project_Settings/Startup_Code/startup.c
Building file: ../Project_Settings/Startup_Code/exceptions.c
Building file: ../src/main.c
Building file: ../Project_Settings/Startup_Code/nvic.c
Building file: ../Project_Settings/Startup_Code/system.c
Building file: ../Project_Settings/Startup_Code/startup_cm7.s
Invoking: Standard S32DS C Compiler
Invoking: Standard S32DS Assembler
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@src/main.args" -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.c"
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/Vector_Table.args" -o "Project_Settings/Startup_Code/Vector_Table.o" "../Project_Settings/Startup_Code/Vector_Table.s"
arm-none-eabi-gcc "@Project_Settings/Startup_Code/exceptions.args" -MMD -MP -MF"Project_Settings/Startup_Code/system.d" -MT"Project_Settings/Startup_Code/system.o" -o "Project_Settings/Startup_Code/system.o" "../Project_Settings/Startup_Code/system.c"
arm-none-eabi-gcc "@Project_Settings/Startup_Code/exceptions.args" -MMD -MP -MF"Project_Settings/Startup_Code/exceptions.d" -MT"Project_Settings/Startup_Code/exceptions.o" -o "Project_Settings/Startup_Code/exceptions.o" "../Project_Settings/Startup_Code/exceptions.c"
Invoking: Standard S32DS C Compiler
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/exceptions.args" -MMD -MP -MF"Project_Settings/Startup_Code/nvic.d" -MT"Project_Settings/Startup_Code/nvic.o" -o "Project_Settings/Startup_Code/nvic.o" "../Project_Settings/Startup_Code/nvic.c"
arm-none-eabi-gcc "@Project_Settings/Startup_Code/exceptions.args" -MMD -MP -MF"Project_Settings/Startup_Code/startup.d" -MT"Project_Settings/Startup_Code/startup.o" -o "Project_Settings/Startup_Code/startup.o" "../Project_Settings/Startup_Code/startup.c"
Invoking: Standard S32DS Assembler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/Vector_Table.args" -o "Project_Settings/Startup_Code/startup_cm7.o" "../Project_Settings/Startup_Code/startup_cm7.s"
In file included from C:/NXP/S32DS.3.5/S32DS/software/PlatformSDK_S32K3/RTD/BaseNXP_TS_T40D34M30I0R0/include/Mcal.h:65,
                 from ../Project_Settings/Startup_Code/exceptions.c:41:
C:/NXP/S32DS.3.5/S32DS/software/PlatformSDK_S32K3/RTD/BaseNXP_TS_T40D34M30I0R0/include/OsIf_Internal.h:45:10: fatal error: OsIf_Cfg.h: No such file or directory
   45 | #include "OsIf_Cfg.h"
      |          ^~~~~~~~~~~~
compilation terminated.
In file included from C:/NXP/S32DS.3.5/S32DS/software/PlatformSDK_S32K3/RTD/BaseNXP_TS_T40D34M30I0R0/include/Mcal.h:65,
                 from ../Project_Settings/Startup_Code/system.c:47:
C:/NXP/S32DS.3.5/S32DS/software/PlatformSDK_S32K3/RTD/BaseNXP_TS_T40D34M30I0R0/include/OsIf_Internal.h:45:10: fatal error: OsIf_Cfg.h: No such file or directory
   45 | #include "OsIf_Cfg.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [Project_Settings/Startup_Code/subdir.mk:42: Project_Settings/Startup_Code/exceptions.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Project_Settings/Startup_Code/subdir.mk:42: Project_Settings/Startup_Code/system.o] Error 1
../src/main.c:26:10: fatal error: Port.h: No such file or directory
   26 | #include "Port.h"
      |          ^~~~~~~~
compilation terminated.
make: *** [src/subdir.mk:20: src/main.o] Error 1
Finished building: ../Project_Settings/Startup_Code/Vector_Table.s
Finished building: ../Project_Settings/Startup_Code/startup_cm7.s
Finished building: ../Project_Settings/Startup_Code/startup.c
 
 
 
Finished building: ../Project_Settings/Startup_Code/nvic.c
 
"make -j8 all" terminated with exit code 2. Build might be incomplete.

12:17:07 Build Failed. 7 errors, 0 warnings. (took 1s.713ms)

 

 

when i tried to open mex file am getting following Warning.

Loaded Configuration has been created by older version of the tool. If saved, the old version of the tool may not be able to open it again.

and there is only one OK button. If i click OK and open peripheral module it is not opening at all.

 

any update required or missing path?

kindly guide to solve the issue,

thanks,

Nikhil

0 件の賞賛
返信

5,812件の閲覧回数
cuongnguyenphu
NXP Employee
NXP Employee

Hi, I think It would help if arrange a short call to solve your problem, please check my private message

0 件の賞賛
返信