Make sure the peripheral driver .c files include the driver dispatch header, rather than the architecture specific header files.