I am trying to run the MQX 4.1 SPI demo project on my tower system using the k60f120m board. I went into my user_config.h file and enabled SPI0,SPI1, and SPI2 by setting them to 1. Also at the bottom of that file there are a few tabs (bsp, MQX, rtcs...user_config.h). I went to the bsp tab and changed bsp_enable_spix from false to true for each of the SPI options. The program compiles without error, but there is a warning message. It was an error, but after my changes it is now a warning. The flagged code is below.
#elif BSP_SPI_MEMORY_CHANNEL == 2
#if ! BSPCFG_ENABLE_SPI2
#error This application requires BSPCFG_ENABLE_SPI2 defined non-zero in user_config.h. Please recompile kernel with this option.
I also went into the k60f120m.h files and set where it defined the SPI connections to 1 from 0s. As shown below.
** Enable SPI2 device
** MGCT: <option type="bool"/>
The program compiles and runs, but an error message saying Error opening SPI driver appears. The code which throws the error message is below.
spifd = fopen (TEST_CHANNEL, NULL);
if (NULL == spifd)
printf ("Error opening SPI driver!\n");