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.

emac - Ethernet Controller header has a bug and Hibernate header gives warnings



I'm not sure if this has been brought to TI's software team's attention yet, but the ethernet controller header file has a definite bug in the latest TivaWare, version 2.0.1.11577

I get a compiler error due to tEMACWakeUpFrameFilter not being properly defined. Here's a code snippet:

#if defined(ccs) ||             \
    defined(codered) ||         \
    defined(gcc) ||             \
    defined(rvmdk) ||           \
    defined(__ARMCC_VERSION) || \
    defined(sourcerygxx)
__attribute__ ((packed)) tEMACWakeUpFrameFilter;
#else
tEMACWakeUpFrameFilter;    // Problem here!
#endif

Anyway, the hibernate header file also gives warnings about that these functions are not visible outside of function:

extern void HibernateCalendarSet(struct tm *psTime);
extern int HibernateCalendarGet(struct tm *psTime);
extern void HibernateCalendarMatchSet(uint32_t ui32Index, struct tm *psTime);
extern void HibernateCalendarMatchGet(uint32_t ui32Index, struct tm *psTime);

Hope this helps.

  • Can you post the warnings that you are seeing?

    What tools are you using to build with these files that is causing the warnings?

  • The warnings are shown above. I'm using Code Composer Studio Version: 5.5.0.00077

  • Can you give me the full include list of files from TivaWare to get this to happen?

    I don't need the actual headers just the list of header includes.

  • These were all of the included headers. I basically included all of the hardware headers and driver headers that TivaWare offers.

    //
    // Compiler Definitions
    //
    #include <stdint.h>
    #include <stdbool.h>
    #include <stddef.h>
    
    //
    // Hardware Definitions
    //
    #include "inc/hw_adc.h"
    #include "inc/hw_aes.h"      
    #include "inc/hw_can.h"
    #include "inc/hw_ccm.h"
    #include "inc/hw_comp.h"     
    #include "inc/hw_des.h"      
    #include "inc/hw_eeprom.h"   
    #include "inc/hw_emac.h"     
    #include "inc/hw_epi.h"      
    #include "inc/hw_flash.h"
    #include "inc/hw_gpio.h"
    #include "inc/hw_hibernate.h"
    #include "inc/hw_i2c.h"
    #include "inc/hw_ints.h"
    #include "inc/hw_lcd.h"      
    #include "inc/hw_memmap.h"
    #include "inc/hw_nvic.h"
    #include "inc/hw_pwm.h"
    #include "inc/hw_qei.h"
    #include "inc/hw_shamd5.h"   
    #include "inc/hw_ssi.h"
    #include "inc/hw_sysctl.h"
    #include "inc/hw_sysexc.h"
    #include "inc/hw_timer.h"
    #include "inc/hw_types.h"
    #include "inc/hw_uart.h"
    #include "inc/hw_udma.h"
    #include "inc/hw_usb.h"
    #include "inc/hw_watchdog.h"
    
    //
    // Drivers
    //
    #include "driverlib/adc.h"
    #include "driverlib/aes.h"      
    #include "driverlib/can.h"
    #include "driverlib/comp.h"  
    #include "driverlib/debug.h"    
    #include "driverlib/des.h"      
    #include "driverlib/eeprom.h"   
    #include "driverlib/epi.h"      
    #include "driverlib/flash.h"
    #include "driverlib/fpu.h"
    #include "driverlib/gpio.h"
    #include "driverlib/hibernate.h"
    #include "driverlib/i2c.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/lcd.h"      
    #include "driverlib/mpu.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/pwm.h"
    #include "driverlib/qei.h"
    #include "driverlib/rom.h"
    #include "driverlib/rom_map.h"
    #include "driverlib/shamd5.h"   
    #include "driverlib/ssi.h"
    #include "driverlib/sw_crc.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/sysexc.h"
    #include "driverlib/timer.h"
    #include "driverlib/uart.h"
    #include "driverlib/udma.h"
    #include "driverlib/usb.h"
    #include "driverlib/watchdog.h"

  • Thanks, that is quite a list of includes.  I can still reproduce the issue by just including driverlib/hibernate.h.

     I think you just need to add:

    #include <time.h>

    This is because we stopped using our own "struct tm" definition and started using the standard C definition for struct tm.

  • On the first problem with the tEMACWakeUpFrameFilter definition, if you define "ccs" in your build environment (using -D if that applies to CCS), you should find that the problem disappears. The conditional code around that structure is toolchain specific and we use one of 6 labels consistently throughout the source to include or exclude this kind of thing. If you don't define exactly one of these labels or if you define the wrong label for your toolchain, you will definitely see compile-timer errors or unexpected behavior.