GPIO fatal issues in the LPCOpen 2.0 library for LPC11c24

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

GPIO fatal issues in the LPCOpen 2.0 library for LPC11c24

4,820 Views
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?

Labels (4)
0 Kudos
3 Replies

2,170 Views
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 Kudos

2,170 Views
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 Kudos

2,170 Views
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 Kudos