Debugging of LPC1830(I2C)

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

Debugging of LPC1830(I2C)

979 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by shiggy on Fri Aug 16 20:54:54 MST 2013
Hi Everyone!

I am now debugging the I2C1 interface on the board of LPC1830_Xplorer board from NGX,
using the LPCXpresso v5.0.14 and v5.2.6.
Re1)
When I compilte the the attached program in Debug mode, "undefined reference to "check failed"
error happen.
But When I compilte the the attached program in Release mode, "undefined reference to "check failed"
error does not happen. And the program runs correctly.
Re2)The compile errors depend CHECK_PARAM(PARAM_I2Cx(I2Cx)).
So when the statement of CHECK_PARAM(PARAM_I2Cx(I2Cx)) was commentalized(or deleted),
there is no compile error. But the program does not run correctly.
(I2C1 function retturns error code).

I can not resolve this issues.

If I get comment for this question from any one, I am very happy.
And if there is a question for my contribution, please tell me.
Because I am a beginner of this forum.

Shiggy

Original Attachment has been moved to: AAA.zip

0 Kudos
Reply
4 Replies

920 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by shiggy on Sun Aug 18 06:55:25 MST 2013
Hi Everyone!

I have added the bellow statments at the end of main.c.
As a result, the compile error in debug mode was resolved.

But I can not know the reason of resolved.
--------------------------------------------------------------
#ifdef  DEBUG
void check_failed(uint8_t *file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

/* Infinite loop */
while(1);
}
#endif
-------------------------------------------------------------
Shiggy
0 Kudos
Reply

920 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by shiggy on Sat Aug 17 17:24:29 MST 2013
Hi Everyone!

I have considered the function of CHECK_PARAM(PARAM__I2Cx(I2Cx).

At compiler stage, the function must not be checked, and at execution stage,
it must be done, I think.

But my compiler(LPCXpresso) checks the function at compiler stage.
SO I think any direction which say to compiler("no check") is necessay.

If anyone give me reply or teach, I am very happy.
note) In release mode, the compile and execution is no probrem.

Shiggy


0 Kudos
Reply

920 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by shiggy on Sat Aug 17 15:54:05 MST 2013
Hi TheFallGully-san!

Thanks your important suggestion.
If you write your answer in easy English, I can understand your meanings of the answer, I think.
Sorry for my poor English and my debug techinique.

Shiggy
0 Kudos
Reply

920 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sat Aug 17 10:52:48 MST 2013
It is a function that you need to provide in debug mode. It is for you to trap and report errors. Suggest you read the function header.
0 Kudos
Reply