LINFLEXD_UART_DRV_SendData() not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LINFLEXD_UART_DRV_SendData() not working

2,567 Views
barkly_lin
Contributor III

Hi all

Creating a S32 flexuart example project, LINFLEXD_UART_DRV_XXX() functions are working well.

IDE-flexuart-example.jpg

When creating a new S32 project, then porting flexuart function.

IDE-flexuart-example01.jpg

Then modify main() for UART communication based on LINFlex I/F.

main()

...

CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_FORCIBLE);

PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

//Simply add couple lines to configure LINFlexD_10 for UART communicaiton

PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

LINFLEXD_UART_DRV_Init(INST_LINFLEXD_UART10, &linflexd_uart10_State, &linflexd_uart10_InitConfig0);

while(1)
LINFLEXD_UART_DRV_SendData(INST_LINFLEXD_UART10, (uint8_t*)msg, strlen(msg)); //No response from console at all

The example code as attachment "test_flexcan_uart.zip"

Anyone knows what problem about S32 DS?

Thanks in advance.

9 Replies

2,035 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

how do you notice that FLEX UART is not transmitting data? I modified example (for some reason your project got stuck when upload into board) - and I can see UART data on PG4 pin on scope. 

Only what I did is changing Device to LinFlexD_10 and speed. Nothing else. 

pastedImage_1.png

In main I left INST_LINFLEXD_UART1 - this macro is defined as 10U in generated code. 

pastedImage_2.png

Try to check your clock settings against S32DS example. 

Jiri 

0 Kudos

2,035 Views
barkly_lin
Contributor III

Hi Jiri

It seems clock source and INST_LINFLEXD_UART10 are the problem, because I created another project by "New\S32DS Project from Example\linflex_uart_mpc5748g", and its UART works.

I use the same pinmux/clock source/INST_LINFLEXD_UART10 with both of projects.

The project as attachment "linflexd_uart_mpc5748g.zip"

Maybe there is something wrong with my S32DS environment..>.<..

Thanks,

0 Kudos

2,035 Views
mikedoidge
NXP Employee
NXP Employee

Hello barkly.lin@quantatw.com‌,

After comparing the generated Processor Expert Code, I can see that there are a number of changes which need to be made inside Processor Expert.

In Clock Manager

pastedImage_1.png

In LINFlexD/UART

pastedImage_2.png

In Pin Mux

pastedImage_3.png

I also noticed you are using the S32 SDK MPC574xx EAR 0.8.1, I would recommend that you install the update ( S32 Design Studio for Power Architecture 2017.R1 - Updates 5 and 6 available) and use the latest S32 SDK MPC574xx RTM 1.0.0

Hope it helps,

Mike

2,034 Views
barkly_lin
Contributor III

Hi Mike

It is still not working after modified clock source & INST_LINFLEXD_UART10.

When I try to do "Install new software" with S32DS_PA_v2017.R1_UP5_UP6.zip in S32DS.

System stuck here.

S32DS-update-stuck.jpg

Thanks for reply.

0 Kudos

2,035 Views
mikedoidge
NXP Employee
NXP Employee

Hi barkly.lin@quantatw.com‌,

The Processor Expert settings I mentioned were just a few of the differences to give you a place to start. You should perform the comparison yourself and see what other changes may be required.

Best Regards,

Mike

0 Kudos

2,035 Views
mikedoidge
NXP Employee
NXP Employee

Hello barkly.lin@quantatw.com‌,

How long did you wait to see progress? Depending upon your connection speed, it could take some time. I have seen this take longer than expected on another customer's PC.

Best Regards,

Mike

0 Kudos

2,035 Views
barkly_lin
Contributor III

Hi Mike

I wait more than 1 hour, my connection speed is acceptable because it's smooth for downloading S32DS_PA_v2017.R1_UP5_UP6.zip(> 1GB).

Should I have to wait overnight?

Thanks,

0 Kudos

2,035 Views
mikedoidge
NXP Employee
NXP Employee

Hi barkly.lin@quantatw.com‌,

It should not take so long to install, especially since it appears you have downloaded the file from the NXP website prior to installing. Are you seeing any error messages? Is there a dialog window somewhere that is expecting a response from you? Have you tried relaunching S32DS and starting the update again? Do you have an active debug session running when you performed the update? I sometimes forget to end those.

Regards,

Mike

0 Kudos

2,035 Views
barkly_lin
Contributor III

Hi Mike

When update process stuck again, just leave it overnight, then I saw it finished this morning.

S32DS-update-stuck-02-overnight-pass.jpg

I created a new project based on S32 Design Studio MPC574xx SDK RTM 1.0.0.

Now FLEXCAN_DRV_xxx()s are working well, message come out from UART success.

Thanks for your help.