Hi,
I have a proto used to update registers of a sensors via XMC, I have attached the proto.
When I try to decode the message on the XMC side, it is successful however it then crashes due to memory issues, this only occurs when the pb_decode function returns true. (I am assuming memory is not being freed after the function?)
Note the message I am sending to XMC is:
Reques t{writeRequest{ Reg Config settings}}}
below is the function for decoding the message
void decode_message(uint8_t* message, size_t message_size){
//Create stream that reads from UART buffer
pb_istream_t stream = pb_istream_from_buffer(message, message_size);
//----Check Request
if(pb_decode(&stream, au_com_coolon_mars_wirepas_endpoints_protobufs_Bgt60ltr11aipRequest_fields, &Request)){ //Success
else{
//FAIL
}
}
where au_com_coolon_mars_wirepas_endpoints_protobufs_Bgt60ltr11aipRequest Request = au_com_coolon_mars_wirepas_endpoints_protobufs_Bgt60ltr11aipRequest_init_default;
I have tried enabled PB_ENABLE_MALLOC and it doesn't fix it. Do you have any suggestions?