Mike Marynowski

GPIO write not working in Release mode

Discussion created by Mike Marynowski on Oct 26, 2011
Latest reply on Nov 4, 2011 by Mike Marynowski



The title pretty much says it all. My LCD refused to work when I ran my project in Release mode, so I started digging and found that the exact same code works fine in Debug but not in Release. The code basically just opens an 8-bit GPIO bus on PORT_AN using the MQX GPIO driver and writes all 1's to the port.


I setup user_config.h in the M52259DEMO libs for MQX 3.6 (enabled GPIODEV, disabled ADC, etc) and built build_m52259demo_libs project, so Debug and Release library should have the same features enabled.


CPU is MFC52254, running under a project ported from an M52259DEMO project. Project settings match everywhere in both Release and Debug modes, and CPU is selected as M52254 in all places.


The fopen("gpio:write", ...) function returns a valid result. Hooking up a probe in debug mode shows all PORT_AN lines at 3.3V (11111111) after the write call. In release mode, it goes to something like 01000010 after the write call.


Is there any other possible reason why my program fails to write values to PORT_AN only in Release mode?