cancel
Showing results for 
Search instead for 
Did you mean: 

spc56 UART

Fabio Malatesta
Associate II
Posted on September 27, 2017 at 19:17

Hello,

I am writing a test program on my board (xpc56xx evb motherboard) and I want to receive on my terminal throught the UART numbers and text strings.

When I get the data on my serial terminal (RealTerm) I  receive properly the strings ('Test program start')  but  not the variables' value   (pcval1,pcval2,pcval3). (see screenshot).

This is my code:

#include 'components.h'

uint32_t volatile *pcval;

uint32_t volatile cval;

uint32_t volatile *pointer1;

uint32_t volatile *pw;

uint32_t volatile w = 0x000FFF;

uint32_t volatile giri1,giri2,giri3;

/*

 * Application entry point.

 */

int main(void) {

  /* Initialization of all the imported components in the order specified in

     the application wizard. The function is generated automatically.*/

  componentsInit();

  giri1=0x00000001;

  giri2=0x00000002;

  giri3=0x00000003;

  /*

   * Activates the serial driver 1 using the driver default configuration.

   */

  sdStart(&SD1, NULL);

  /* Application main loop.*/

  while (1) {

    unsigned i;

    osalThreadSleepMilliseconds(100);

    osalThreadSleepMilliseconds(100);

    osalThreadSleepMilliseconds(100);

    osalThreadSleepMilliseconds(100);

      chnWriteTimeout(&SD1, (uint8_t *)'Test program start\r\n', 20, TIME_INFINITE);

      chnWriteTimeout(&SD1, (uint8_t *)'Test program start\r\n', 20, TIME_INFINITE);

      giri1=giri1+1;

      pcval=&giri1;

      chnWriteTimeout(&SD1, (uint8_t *)pcval,4,TIME_INFINITE);

      giri2=giri2+1;

      pcval=&giri2;

      chnWriteTimeout(&SD1, (uint8_t *)pcval,4,TIME_INFINITE);

      giri3=giri3+1;

      pcval=&giri3;

      chnWriteTimeout(&SD1, (uint8_t *)pcval,4,TIME_INFINITE);

      chnWriteTimeout(&SD1, (uint8_t *)'\r\n',2,TIME_INFINITE);

  }

}

is there a strategy with I can read proper values?

Thank you in advance!

Fabio
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee
Posted on September 28, 2017 at 09:10

Hello Fabio ,

I think that you use SPC5Studio.

You can use the Ouput Formatter to perform this task. (RLA or HAL)

0690X00000608NXQAY.png

    Best Regards

                      Erwan

View solution in original post

2 REPLIES 2
Erwan YVIN
ST Employee
Posted on September 28, 2017 at 09:10

Hello Fabio ,

I think that you use SPC5Studio.

You can use the Ouput Formatter to perform this task. (RLA or HAL)

0690X00000608NXQAY.png

    Best Regards

                      Erwan

Posted on September 29, 2017 at 14:46

Thank you Erwan