GPIO fatal issues in the LPCOpen 2.0 library for LPC11c24

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

GPIO fatal issues in the LPCOpen 2.0 library for LPC11c24

5,175件の閲覧回数
fjrg76
Contributor IV

Hi,

I found a really shocking misbehavior while developing a project for the LPC1114 chip under LPCXpresso IDE using such a library. In short: a calling to the function Chip_GPIO_SetPinDirOutput() always calls Chip_GPIO_SetPinDirInput(), WTH!!. Then I tried the more general function Chip_GPIO_SetPinDIR(), which in turn did what was expected.

More about the project:

  • LPCXpresso v8.2.2, Linux Mint Cinnamon 18.3
  • The project is under C++, no optimization at all, maximum debugging (-g3), -std=gnu++11, newLibNano -nohost
  • LPCOpen library settings: optimized for size, no debug information, -std=C11

I captured some pics so you see the issue closer:

  • -28.png, L127: Calls the constructor.
  • -13.png, Constructor's body. Whenever _dir is true, Chip_GPIO_SetPinDirOutput() should be called.
  • -51.png, L167: Weirdly the function Chip_GPIO_SetPinDirInput() is invoked, so the pin is always set as input regardless the user's wishes.

As far as I now, LPCopen 2.0 release library is the last (and old one) for this chip. Any ideas?

ラベル(4)
0 件の賞賛
返信
3 返答(返信)

2,525件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Customer,

    I have check our LPCOpen 2.0 library for lpc11c24,  I didn't find this definition:

pastedImage_1.png

My code is download from this link:

LPCOpen Software for LPC11XX|NXP 

I don't know where you find it, or you write it by yourself?

I think you can debug this function, check _dir, when you intput :  Pin::output, check ouput value, and the _dir value if you want to use Chip_GPIO_SetPinDIROutput function, _dir should be 0. Check your output, is it 0?

I think the problem may caused by this Pin::Pin function, or the value of your output.

Please check it again on your side.

Any updated information, please let me know.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

2,525件の閲覧回数
fjrg76
Contributor IV

The code in C++ is mine. What is important here is that the library function Chip_GPIO_SetPinDirOutput()  always calls Chip_GPIO_SetPinDirInput(). I'm using the library you've mentioned.

0 件の賞賛
返信

2,525件の閲覧回数
converse
Senior Contributor V

So, are you saying that in your Pin:Pin method always calls SetPinDirOutput, regardless of the stat of _dir? Or are you saying that the LPCOpen function calls the wrong thin?

if it is your code, can you provide an example of how you invoke the method!

0 件の賞賛
返信