Skip to main content
Associate
January 21, 2025
Solved

how to read UART messages in SPC58 ?

  • January 21, 2025
  • 2 replies
  • 974 views
/****************************************************************************
*
* Copyright © 2016-2019 STMicroelectronics - All Rights Reserved
*
* This software is licensed under SLA0098 terms that can be found in the
* DM00779817_1_0.pdf file in the licenses directory of this software product.
* 
* THIS SOFTWARE IS DISTRIBUTED "AS IS," AND ALL WARRANTIES ARE DISCLAIMED, 
* INCLUDING MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*****************************************************************************/
 
/* Inclusion of the main header files of all the imported components in the
   order specified in the application wizard. The file is generated
   automatically. */
#include "components.h"
#include "serial_lld_cfg.h"
#include <string.h>
 
uint8_t message[] = {0x01, 0x03, 0x04, 0x04};
uint8_t messageR[7];  // Buffer to store the 8-byte received packet
 
 
int ret = 0;
 
/*
 * 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();
 
    /* Enable Interrupts */
    irqIsrEnable();
 
    /* Start Serial Driver */
    sd_lld_start(&SD3, &serial_config_configuration_name);
 
 
 
    sd_lld_read(&SD3, (uint8_t *)messageR, (uint16_t)(sizeof(messageR)));
 
 
    /* Application main loop. */
    for (;;) {
        // Clear RS485 enable (optional, based on your RS485 setup)
 
 
    }
 
 
 
 
 
    return 0; // Should never reach here
}
 
 
 
void rxreceive(SerialDriver *sdp){
(void)sdp;
 
 
 
}
 
void txreceive(SerialDriver *sdp){
(void)sdp;
 
}

I could read the data packets from uart, 

This topic has been closed for replies.
Best answer by Erwan YVIN

Hello ,

There are several example in SPC5Studio Application Wizard

You can use :

Name:SPC5 Runtime-IO Component RLA
ID:com.st.spc5.components.runtime-io.spc5x_rla
Version:1.3.8.20221012161120
Description:Runtime IO support for SPC5.

                   Best Regards

                                     Erwan

2 replies

asfakmAuthor
Associate
January 21, 2025

sorry, I could not read the data packets

Erwan YVIN
Erwan YVINBest answer
ST Technical Moderator
January 27, 2025

Hello ,

There are several example in SPC5Studio Application Wizard

You can use :

Name:SPC5 Runtime-IO Component RLA
ID:com.st.spc5.components.runtime-io.spc5x_rla
Version:1.3.8.20221012161120
Description:Runtime IO support for SPC5.

                   Best Regards

                                     Erwan

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.