First you can remove the const of the global variable by converting the option below in your toolchain.ini file.

global_variable_nonconstant = 1

However, it is impossible to compile the test code that is generated by default when the test is executed, so an error occurs in the converting stage.

If you modify the test code into a compilable form and run the test, you can build normally.

void Rte_MemCpy(void *destination, void *source, unsigned long num);

typedef unsigned char CanMsgData[8];
typedef unsigned char uint8;
CanMsgData data;
const CanMsgData Rte_C_CanMsgData_0 = {
  0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U
};

void Rte_MemCpy(void *destination, void *source, unsigned long num)
{
}
void main(void)
{
 Rte_MemCpy(data, Rte_C_CanMsgData_0, sizeof(CanMsgData));
}

In the code above, the test code generated by default is as follows.

/*Input*/
Rte_C_CanMsgData_0[0] = CS_UINT_INPUT(unsigned char,"Rte_C_CanMsgData_0[0]");
data[0] = CS_UINT_INPUT(unsigned char,"data[0]");

Since the Rte_C_CanMsgData_0 is declared as a const global variable, an error occurs.
error: expression must be a modifiable lvalue

Change the test information of the global variable into user code and modify it in a compilable form as follows.

unsigned char * Rte_C_CanMsgData_Temp = (unsigned char *)Rte_C_CanMsgData_0;
// If it points to an address, const cannot be determined at compile time, so it is judged to be a code that compiles normally in conversion and operates normally
// When checking const at runtime, the const is already removed due to the global_variable_nonconstant option, so a runtime error does not occur.
Rte_C_CanMsgData_Temp[0] = CS_INT_INPUT(unsigned char, "Rte_C_CanMsgData_Temp[0]");
Rte_C_CanMsgData_Temp[1] = CS_INT_INPUT(unsigned char, "Rte_C_CanMsgData_Temp[1]");
Rte_C_CanMsgData_Temp[2] = CS_INT_INPUT(unsigned char, "Rte_C_CanMsgData_Temp[2]");
Rte_C_CanMsgData_Temp[3] = CS_INT_INPUT(unsigned char, "Rte_C_CanMsgData_Temp[3]");
Rte_C_CanMsgData_Temp[4] = CS_INT_INPUT(unsigned char, "Rte_C_CanMsgData_Temp[4]");

Need more help with this?
Don’t hesitate to contact us here.

Thanks for your feedback.