This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: Error (apparent) in the TivaWare docs

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C123GXL

Tool/software:

Today I downloaded the current Tivaware for the TM4C123GXL LaunchPad.  I ended up spending a lot of time trying to get the bool type configured so that I could include the "global" interrupt enable/disable Fn calls.  This is an excerpt from the DRL-UG manual (this text is also more-or-less present in the interrupt.c source comments):

IntMasterDisable
Disables the processor interrupt.
Prototype:
bool
IntMasterDisable(void)
Description:
This function prevents the processor from receiving interrupts. This function does not affect
the set of interrupts enabled in the interrupt controller; it just gates the single interrupt from the
controller to the processor.
Note:
Previously, this function had no return value. As such, it was possible to include interrupt.h
and call this function without having included hw_types.h. Now that the return is a bool, a
compiler error occurs in this case. The solution is to include hw_types.h before including
interrupt.h.
Returns:
Returns true if interrupts were already disabled when the function was called or false if they
were initially enabled.

At issue: hw_types.h does NOT have any typedefs present in the file, certainly not a definition for "bool".  I ended up placing one there.  I did find a version of hw_types in the RTOS section that DID have a typedef for BOOL (uppercase), but that syntax did not work when copied it to my working include file (perhaps it is a C++ or C# syntax? ... I'm just a droid, and not very knowledgeable about such things).

A minor issue, by most measures, but it still ate up a couple of hours of my time and my solution is more (rather than less) a hack than a proper solution.

Thatisall.

  • Hi,

      Can you please import and run the stock TivaWare example C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c123gxl\interrupts? Refer to the header files where hw_types.h is included and IntMasterDisable() is called. I have no problem compiling the project. Please give is a try. 

  • A fair ask, but... the issue has been overcome by events here.  Whilst trying to compile on my desktop, I ran into synch issues (TivaWare on that computer was much older) which highlighted the idea that it wasn't too efficient to include TivaWare for just ONE system function.  After some additional research, I found an in-line ASM solution:

    	// master interrupt disable
    	asm(
    		" CPSID I\n"
    		" ISB\n"
    		);
    			//
    			// ...interceding code...
    			//
    	//	master interrupt enable
    	asm(
    		" CPSIE I\n"
    		" ISB\n"
    		);

    This allowed the TivaWare to be excluded and seems to give the desired result.

    As to the original issue, I suppose I will tackle that somewhere down the line when I decide to use TivaWare more fully.

    Cheers