Skip to main content
Jerry MAO
Visitor II
September 1, 2017
Question

Problem when transfering Data between 2 UART Ports

  • September 1, 2017
  • 0 replies
  • 438 views
Posted on September 01, 2017 at 05:07

Hi,

im try to transfer Data through 2 UART ports. but the problem is only the first element of the Data received.

0690X000006085XQAQ.png

my model is like this. sent [50 1 1 52]or[50 2 2 52] through USART1 and receive it from USART3.

Both USART buffer size is 4

ToolChain used is EWARM.

   Matlab Function: generateBuff

   function [NbChar, Buff] = generateBuff(u1)

   if coder.target('Sfun')

      % Executing in MATLAB, Buff is null

      Buff = uint32(0);

      NbChar = uint16(0);

   else

      % Executing in the generated code.

      Buff = uint32(0);

      Buff = coder.ceval('getBuffPtr',uint8(u1));

      [nbChar,~] = size(u1);

      NbChar = uint16(nbChar);

   end

  end

i expect to receive[50 1 1 52], but actually i receive [50 0 0 0], like below

usart1TestRcvChar_B.USART_Receive_o3 = ['2'(0x32),'\0'(0x00),'\0'(0x00),'\0'(0x00)]

where shoud i modified?

#stm32f4-usart
This topic has been closed for replies.