analogdevicesinc / msdk

Software Development Kit for Analog Device's MAX-series microcontrollers
Apache License 2.0
60 stars 75 forks source link

MAX32570 tft_ssd2119 driver mxc_spi_pins_t not found #900

Closed AEmreEser closed 5 months ago

AEmreEser commented 5 months ago

I was using the march release of the MSDK until recently. I used the following repositories to fetch component repositories for the max32570 MN ev kit:

When I updated the components a day ago, I encountered an error:

C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c: In function 'tft_spi_init': C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:511:5: error: unknown type name 'mxc_spi_pins_t'; did you mean 'mxc_spi_regs_t'? 511 | mxc_spi_pins_t tft_pins; | ^~~~~~ | mxc_spi_regs_t C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:513:13: error: request for member 'clock' in something not a structure or union 513 | tft_pins.clock = true; | ^ C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:514:13: error: request for member 'ss0' in something not a structure or union 514 | tft_pins.ss0 = (ssel == 0); ///< Slave select pin 0 | ^ C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:515:13: error: request for member 'ss1' in something not a structure or union 515 | tft_pins.ss1 = (ssel == 1); ///< Slave select pin 1 | ^ C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:516:13: error: request for member 'ss2' in something not a structure or union 516 | tft_pins.ss2 = (ssel == 2); ///< Slave select pin 2 | ^ C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:517:13: error: request for member 'miso' in something not a structure or union 517 | tft_pins.miso = true; ///< miso pin | ^ C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:518:13: error: request for member 'mosi' in something not a structure or union 518 | tft_pins.mosi = true; ///< mosi pin | ^ C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:519:13: error: request for member 'sdio2' in something not a structure or union 519 | tft_pins.sdio2 = false; ///< SDIO2 pin | ^ C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:520:13: error: request for member 'sdio3' in something not a structure or union 520 | tft_pins.sdio3 = false; ///< SDIO3 pin | ^ C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:522:5: error: too many arguments to function 'MXC_SPI_Init' 522 | MXC_SPI_Init((mxc_spi_regs_t )spi, master, quadMode, numSlaves, ssPol, tft_spi_freq, tft_pins); | ^~~~ In file included from C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.h:32, from C:\MaximSDK/Libraries/MiscDrivers/Display/tft_ssd2119.c:31: C:/MaximSDK/Libraries/PeriphDrivers/Include/MAX32570/spi.h:182:5: note: declared here 182 | int MXC_SPI_Init(mxc_spi_regs_t spi, int masterMode, int quadModeUsed, int numSlaves, | ^~~~ make: *** [/C/MaximSDK/Libraries/CMSIS/Device/Maxim/GCC/gcc.mk:388: /c/Users/eeser/eclipse-workspace/max32570-ucl-validation/build/tft_ssd2119.o] Error 1 "make all" terminated with exit code 2. Build might be incomplete.

I did go through the display driver files and looked for a mxc_spi_pins_t struct typedef and could not find any. This seems like where the problem is rooted.

What I did try so far:

What I would like to get your help on:

Jake-Carter commented 5 months ago

Thanks @AEmreEser, we just fixed the build error (https://github.com/Analog-Devices-MSDK/msdk/commit/f9c0dd1cbe0980c937a0a0185fe596b7236c9829).

There was a typo in the TFT driver file. It should have been checking for #if defined(OLD_SPI_API) instead of #if defined(OLD_SPI_API_FUNCTIONS).

AEmreEser commented 5 months ago

Hey @Jake-Carter, thanks a bunch for the fix!

I wanted to share a quick update about the openOCD target config files. I noticed that when you unzip 1.2.0-35Tools.7z found here, the folder hierarchy doesn't seem to contain any .cfg files.

Jake-Carter commented 5 months ago

You're right, thanks for reporting it @AEmreEser. I've just opened https://github.com/Analog-Devices-MSDK/Packages/issues/6 to track that issue.

In the meantime, here is the file for the MAX32570:
max32570-cfg.zip

AEmreEser commented 5 months ago

Hi @Jake-Carter , you're welcome and thank you for your help!