Hello,
I am working for the first time on Artekit AK-SDFS-UART and I am trying to gather some data through UART from a Renesas chip (RL78-G13).
(Note: I tried the module on Arduino Uno board and it worked perfectly.)
On Renesas chip the problem is that, if I send raw data the things work (the transmitted message is good and the answer is received); otherwise, if I use the Artekit libraries the things do not work (the tx message is not good).
As raw data I tried to send the following commands
static char UartMsgOpen[16] = {0x41, 0x4b, 0x01, 0x0b, 0x08, 0x00, 0x5c, 0x6c, 0x6f, 0x67, 0x2e, 0x74, 0x78, 0x74, 0x35, 0xac};
static char UartMsgCloseAll[8] = {0x41, 0x4b, 0x10, 0x00, 0x00, 0x00, 0x80, 0xc9};
static char UartMsgWrite[11] = {0x41, 0x4b, 0x05, 0x01, 0x03, 0x00, 0x30, 0x0d, 0x0a, 0xe3, 0x54};
static char UartMsgFlush[8] = {0x41, 0x4b, 0x06, 0x01, 0x00, 0x00, 0x8e, 0xc2};
For each command I receive an answer from Artekit module; I inspected the answers through oscilloscope and, in addition, data are correctly written on micro SD.
Here below, an example of message “Close All” is shown (in green the Tx channel and in yellow the Rx channel)
The Renesas API with which I sent the Close all message is the following
HAL_UART_RL78_Send(&debug_uart_com, (uint8_t *)&UartMsgCloseAll, 8);
where the first input is an handle to UART port, the second is the message and the third the size.
Instead, if I use Artekit libraries, the sent message seems to be “corrupted” and the number of bytes lower (3 bytes instead of 8). See pic below
In order to use the Artekit libraries I used the Renesas API “HAL_UART_RL78_Send” inside my_tx_function, as shown below
void my_tx_function(unsigned char* data, unsigned long data_len)
{
HAL_UART_RL78_Send(&debug_uart_com, (uint8_t *)&data, data_len);
}
I inserted a breakpoint inside my_tx_function when the “close all” message is sent. Here below the value of inputs:
data → “AK\020” (that correspond to message 0x41 0x4B 0x10)
data_len = 6
I suppose that the other 3 bytes are zero and that the CRC is computed inside libraries.
Here below the prototype of Renesas function
MD_STATUS HAL_UART_RL78_Send(Uart_com_t *uart_com_p,
uint8_t * const tx_buf,
uint16_t tx_num)
From my analysis I guess that all the inputs of my_tx_function are correct.
So, could you help me to find out the reason why the tx message is not correctly transmitted ?
Thank you.
Best Regards,
David