Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
nDonnelly
Level 3
Level 3
10 questions asked 25 sign-ins 10 replies posted

Hi,

My XMC is getting stuck at he default handler with the debugger console showing the issue at 

VADC0_G1_1_IRQHandler () at ../Startup/startup_XMC1300.S:306 306 b .

I dont belive this issue actaully has anythign to do with the ADC as it is operating as expected and the issue only arrise when trying to decode a protobuf message. 

I can provide more detail on my code but first I wanted to know what a common cause for XMC is to get stuck in default handler in startup_XMC1300.S

0 Likes
1 Solution
sujatapatil
Moderator
Moderator
Moderator
250 replies posted 50 solutions authored 10 likes received

Hi @nDonnelly ,

Pb_decode parse stream data and store in variables which passed to decode function ? or to some other location?

In both case please check you are trying to access memory beyond it is allocated .

Please dump MSP register's contents in memory window , i guess 5th or 6th word will give you address which caused this issue. try to map it to disassembly window if it is an instruction or for data map address to lst file ( in debug folder with <project_name.lst) .

If you need help , i can setup quick webex session . Please share your email id in that case.

Thanks

Sujata 

View solution in original post

0 Likes
3 Replies
sujatapatil
Moderator
Moderator
Moderator
250 replies posted 50 solutions authored 10 likes received

Hi @nDonnelly ,

It is software/firmware code which caused this exception and it is not ADC related or specific to XMC . You share your project , i will help you to find cause for this exception. Also confirm XMC board which you are using.

Thanks

Sujata 

0 Likes

Hi Sujata, 

It is quite a large project, the spefic function that is causing the crash is 

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)){
 
//CRASHES HERE
/*
//-------Write Registers
if(Request.which_request == 1){
//requestID = 1;
//decode_reg();
//send_response(requestID, errorID);
}
 
//------Read Registers
if(Request.which_request == 2){
requestID = 2;
read_registers();
send_response(requestID, errorID);
}
 
//-----Factory Reset
if(Request.which_request == 3){
requestID = 3;
reset_registers();
//SET FIRST RUN = 1 TO RESET SLOW AND FAST DATA
send_response(requestID, errorID);
}*/
 
errorID = 1; //SUCCESS
}
else{
errorID = 4; //DECODE ERROR
}
}
 
When the pb_decode function returns true it then jumps to the default handler. If you still require the entire project, please provide an email to discuss. I am using the xmc1302
0 Likes
sujatapatil
Moderator
Moderator
Moderator
250 replies posted 50 solutions authored 10 likes received

Hi @nDonnelly ,

Pb_decode parse stream data and store in variables which passed to decode function ? or to some other location?

In both case please check you are trying to access memory beyond it is allocated .

Please dump MSP register's contents in memory window , i guess 5th or 6th word will give you address which caused this issue. try to map it to disassembly window if it is an instruction or for data map address to lst file ( in debug folder with <project_name.lst) .

If you need help , i can setup quick webex session . Please share your email id in that case.

Thanks

Sujata 

0 Likes