Re:Problem with GPIO and SYSCTL lib files
Hi,
The "undefined reference to __error__" problem you are seeing most likely indicates that you have a mismatch between debug and release versions of the DriverLib library you are linking and your application code. Alternatively, you may be using the ASSERT() macro without having defined the __error__() function in your application.
In a debug build (when you define label DEBUG either in your IDE or using "-DDEBUG" passed to your compiler), error checking code is included in DriverLib via the macro ASSERT(). This macro generates a call to function __error__ if the assert fails and it is expected that the application code will include this function. Typically, all it does is enter a while(1) to stop execution and allow you to debug the problem but you can also add other code there to dump status or provide other useful information.
To get rid of the problem, you have a couple of choiced. First, you can rebuild DriverLib without DEBUG defined then link this version to your application code (assuming you don't use ASSERT() anywhere in the app). The other option, if you want to use the debug features, is to add a function to your application along the lines of the following:
#ifdef DEBUG void __error__(char *pcFilename, unsigned long ulLine) { // // Something horrible happened! You need to look // at file "pcFilename" at line "ulLine" to see // what error is being reported. // while(1) { } } #endif
I hope this helps!
login or register to reply
|