MPC560P CodeCode program running away

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC560P CodeCode program running away

Jump to solution
860 Views
xudb
Contributor II

Hi everybody:

    My product is experiencing a problem: My code has a struct,like "typedef struct {

INT32U canid; 

INT8U rxCode;
INT8U IDE; //
INT8U RTR; //
INT8U DLC; // 

INT8U Data[8]; //
//INT8U res; //

}CAN_MSG_T; And I have define a can rx buf and tx buf to recv / trans the data from can int, when THIS struct has "INT8U res" ,the code run OK, but, when NOT, it will RUN AWAY, I dont know why ,does anybody Encounter similar problems?? How CAN I DEBUG IT to fix it? I USED codewarrior is too old to debug any question, I JUST only PRINT LOG TO UART to watch current mcu stat.

 

0 Kudos
Reply
1 Solution
838 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

hard to suggest anything, you need to debug your application and find a place where code goes away.

You can find some example within https://www.nxp.com/docs/en/application-note/AN2865.pdf or e.g. https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-TRK-MPC5604P-Initialization-of-SBC-chip-... 

BR, Petr

View solution in original post

0 Kudos
Reply
2 Replies
839 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

hard to suggest anything, you need to debug your application and find a place where code goes away.

You can find some example within https://www.nxp.com/docs/en/application-note/AN2865.pdf or e.g. https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-TRK-MPC5604P-Initialization-of-SBC-chip-... 

BR, Petr

0 Kudos
Reply
820 Views
xudb
Contributor II

Hi PetrS:

     Thanks for your Help, My problem has been solved, it was caused by the MB headers start address  in the flexray cfg hw struct val, is in internal_ram range which is in lcf file , I change the lcf and the addr, and it dont appear again. Finally ,thanks very much again!

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1876859%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMPC560P%20CodeCode%20program%20running%20away%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1876859%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EHi%20everybody%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20My%20product%20is%20experiencing%20a%20problem%3A%20My%20code%20has%20a%20struct%2Clike%20%22typedef%20struct%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EINT32U%20canid%3B%26nbsp%3B%3C%2FP%3E%3CP%3EINT8U%20rxCode%3B%3CBR%20%2F%3EINT8U%20IDE%3B%20%2F%2F%3CBR%20%2F%3EINT8U%20RTR%3B%20%2F%2F%3CBR%20%2F%3EINT8U%20DLC%3B%20%2F%2F%26nbsp%3B%3C%2FP%3E%3CP%3EINT8U%20Data%5B8%5D%3B%20%2F%2F%3CBR%20%2F%3E%2F%2FINT8U%20res%3B%20%2F%2F%3C%2FP%3E%3CP%3E%7DCAN_MSG_T%3B%20And%20I%20have%20define%20a%20can%20rx%20buf%20and%20tx%20buf%20to%20recv%20%2F%20trans%20the%20data%20from%20can%20int%2C%20when%20THIS%20struct%20has%20%22INT8U%20res%22%20%2Cthe%20code%20run%20OK%2C%20but%2C%20when%20NOT%2C%20it%20will%20RUN%20AWAY%2C%20I%20dont%20know%20why%20%2Cdoes%20anybody%26nbsp%3B%3CSPAN%3EEncounter%20similar%20problems%3F%3F%20How%20CAN%20I%20DEBUG%20IT%20to%20fix%20it%3F%20I%20USED%20codewarrior%20is%20too%20old%20to%20debug%20any%20question%2C%20I%20JUST%20only%20PRINT%20LOG%20TO%20UART%20to%20watch%20current%20mcu%20stat.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1880180%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20MPC560P%20CodeCode%20program%20running%20away%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1880180%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20PetrS%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BThanks%20for%20your%20Help%2C%20%3CSPAN%3EMy%20problem%20has%20been%20solved%2C%26nbsp%3Bit%20was%20caused%20by%20the%20MB%20headers%20start%20address%26nbsp%3B%20in%20the%20flexray%20cfg%20hw%20struct%20val%2C%20is%20in%20internal_ram%20range%20which%20is%20in%20lcf%20file%20%2C%20I%20change%20the%20lcf%20and%20the%20addr%2C%20and%20it%20dont%20appear%20again.%20Finally%20%2Cthanks%20very%20much%20again!%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1878949%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20MPC560P%20CodeCode%20program%20running%20away%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1878949%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Ehard%20to%20suggest%20anything%2C%20you%20need%20to%20debug%20your%20application%20and%20find%20a%20place%20where%20code%20goes%20away.%3C%2FP%3E%0A%3CP%3EYou%20can%20find%20some%20example%20within%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN2865.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN2865.pdf%3C%2FA%3E%26nbsp%3Bor%20e.g.%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMPC5xxx-Knowledge-Base%2FExample-TRK-MPC5604P-Initialization-of-SBC-chip-MC33905-and%2Fta-p%2F1100198%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMPC5xxx-Knowledge-Base%2FExample-TRK-MPC5604P-Initialization-of-SBC-chip-MC33905-and%2Fta-p%2F1100198%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E