#error freertos.h must be included before timer.h

Are you using one of our official port? Can you show me the code so that I can try to understand?