2

I'm working with MircoBlaze_mcs core and implement simple GIO file from the tutorial but it gives error ( "xiomodule.h" No such file or directory )when I synthesize the project .

I find it in the API documentation in the SDK Project Explorer, under /BSP Documentation/iomodule_v1_00_a .

this is the tested code :

#include <stdio.h>
#include "platform.h"
#include "xparameters.h" // add
#include "xiomodule.h" // add
void print(char *str);
int main()
{
    init_platform();
    u32 data;
    XIOModule gpi;
    XIOModule gpo;
    print("Reading switches and writing to LED port\n\r");
    data = XIOModule_Initialize(&gpi, XPAR_IOMODULE_0_DEVICE_ID);
    data = XIOModule_Start(&gpi);
    data = XIOModule_Initialize(&gpo, XPAR_IOMODULE_0_DEVICE_ID);
    data = XIOModule_Start(&gpo);
    while (1)
    {
        data = XIOModule_DiscreteRead(&gpi, 1); // read switches (channel 1)
        XIOModule_DiscreteWrite(&gpo, 1, data); // turn on LEDs (channel 1)
    }
    cleanup_platform();

    return 0;
}
WedaPashi
  • 1,670
  • 17
  • 29
sepeee
  • 61
  • 1
  • 7

1 Answers1

1

The error means that either you don't have the header file in your project directory, or to be precise its not there in PATH section of compiler settings. If you are reusing some project then you shouldn't get this error usually, but if yes, you can work-around a fetching a compatible copy of one such xiomodule.h from some source repositories as Git. Example, see if this file on GitHub helps you.

But, to be honest, using the missing header from other sources may end up in different issues, because someone else might have modified it as per his/her usage. The best generic example of such an issue is a buffer size, or a count, or any such thing that can be a macro.

WedaPashi
  • 1,670
  • 17
  • 29