LPUART_Receive does not read size

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

LPUART_Receive does not read size

Jump to solution
1,482 Views
vinicius_olivei
Contributor III

Hello all,

I'm trying to read 16 bytes from the serial interface, and I did the following comfiguration:

pastedImage_1.png

When I generate code, the function call is using 1 as size, and never changes:

pastedImage_2.png

Could you help me NXP team?

MATLAB: 2019b

NXP_MDBDToolbox_S32K1xx: 4.1.0

1 Solution
1,220 Views
constantinrazva
NXP Employee
NXP Employee

Hello again vinicius.oliveira@enfas.de‌,

Here's the file that you should change to make the block use the input for setting the size of the transfer (versus using the output's size to set the transfer size, as it is currently doing).

The location of the file is the following:

{ROOT}\mbdtbx_s32k\blocks\lpuart\lpuart_s32k_receive.tlc

Thank you again for reporting this issue.

Kind regards,

Razvan.

View solution in original post

5 Replies
1,220 Views
mariuslucianand
NXP Employee
NXP Employee

Hello vinicius.oliveira@enfas.de‌,

Even if the input is 16, the output is a single uint8_t variable. 

I was more interested about the output data type, like in the following model:

pastedImage_1.png

In order to achieve this, please declare a Data Store memory and adjust the following settings:

pastedImage_3.png

You can declare it as volatile.

Hope this helps,

Marius

1,220 Views
vinicius_olivei
Contributor III

Hello Marius-lucian Andrei,

 

Yeah, that is good work around

 

I created a stateflow chart which packes the buffer withing start character and end character, but your idea is better.

 

Thanks,

Vinicius.

1,220 Views
constantinrazva
NXP Employee
NXP Employee

Hello vinicius.oliveira@enfas.de‌,

Sorry for the late reply (was taking some time off). Thank you for reporting this issue! I will get a fix today and first post it here and in a few days on the hotfixes page for our latest release. Although the block is perfectly usable with the workaround that mariuslucianandrei‌ proposed, that is not the intended way for the block to work - you should be able to use variable length with more control than that for receiving blocks [eventhough for transfer blocks that is not the case]. I'll come back with the fix in a few!

Kind regards,

Razvan.

0 Kudos
1,221 Views
constantinrazva
NXP Employee
NXP Employee

Hello again vinicius.oliveira@enfas.de‌,

Here's the file that you should change to make the block use the input for setting the size of the transfer (versus using the output's size to set the transfer size, as it is currently doing).

The location of the file is the following:

{ROOT}\mbdtbx_s32k\blocks\lpuart\lpuart_s32k_receive.tlc

Thank you again for reporting this issue.

Kind regards,

Razvan.

1,220 Views
vinicius_olivei
Contributor III

Hi Constantin,

Thank you for the support and providing the hot fix. It works great.

NXP team aways helpful.

Best,

Vinicius.

0 Kudos