Fco. Javier Rodriguez G

GPIO fatal issues in the LPCOpen 2.0 library for LPC11c24

Discussion created by Fco. Javier Rodriguez G on Jan 12, 2018
Latest reply on Jan 15, 2018 by Kerry Zhou

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?

Outcomes