chipKIT® Development Platform

Inspired by Arduino™

Problem with the DSPI library on WIFire board

Created Mon, 28 Jul 2014 16:36:27 +0000 by orges.furxhi


orges.furxhi

Mon, 28 Jul 2014 16:36:27 +0000

Hi,

I am trying to use the DSPI library with the WiFire board and the mpide-0023-windows-20140605-test version of the MPIDE as instructed on the MPIDE download page.

The example codes (PmodJSTKDspi and PmodJSTKDspiInt) do not compile and give the following error messages.

Has anyone else had the same problem? Is there a solution?

Thank you

Orges

Error messages:

C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:119:1: error: prototype for 'DSPI::DSPI(int, int, ppsFunctionType, ppsFunctionType)' does not match any in class 'DSPI' C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI/DSPI.h:86:12: error: candidates are: DSPI::DSPI(const DSPI&) C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI/DSPI.h:124:4: error: DSPI::DSPI() C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp: In member function 'void DSPI::begin(uint8_t)': C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:231:12: error: 'pinMISO' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:231:21: error: 'ppsMISO' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:235:12: error: 'pinMOSI' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:235:21: error: 'ppsMOSI' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp: In constructor 'DSPI0::DSPI0()': C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:916:21: error: '_SPI2_BASE_ADDRESS' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:917:8: error: '_SPI_2_VECTOR' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:921:7: error: '_SPI2_ERR_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:921:23: error: '_SPI2_RX_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:921:38: error: '_SPI2_TX_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp: In constructor 'DSPI1::DSPI1()': C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:995:88: error: no matching function for call to 'DSPI::DSPI(int, int, ppsFunctionType, ppsFunctionType)' C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI/DSPI.h:124:4: note: candidates are: DSPI::DSPI() C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI/DSPI.h:86:12: note: DSPI::DSPI(const DSPI&) C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1001:21: error: '_SPI1_BASE_ADDRESS' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1002:8: error: '_SPI_1_VECTOR' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1006:7: error: '_SPI1_ERR_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1006:23: error: '_SPI1_RX_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1006:38: error: '_SPI1_TX_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp: In constructor 'DSPI2::DSPI2()': C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1081:88: error: no matching function for call to 'DSPI::DSPI(int, int, ppsFunctionType, ppsFunctionType)' C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI/DSPI.h:124:4: note: candidates are: DSPI::DSPI() C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI/DSPI.h:86:12: note: DSPI::DSPI(const DSPI&) C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1087:21: error: '_SPI3_BASE_ADDRESS' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1088:8: error: '_SPI_3_VECTOR' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1092:7: error: '_SPI3_ERR_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1092:23: error: '_SPI3_RX_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1092:38: error: '_SPI3_TX_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp: In constructor 'DSPI3::DSPI3()': C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1166:88: error: no matching function for call to 'DSPI::DSPI(int, int, ppsFunctionType, ppsFunctionType)' C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI/DSPI.h:124:4: note: candidates are: DSPI::DSPI() C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI/DSPI.h:86:12: note: DSPI::DSPI(const DSPI&) C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1172:21: error: '_SPI4_BASE_ADDRESS' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1173:8: error: '_SPI_4_VECTOR' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1177:7: error: '_SPI4_ERR_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1177:23: error: '_SPI4_RX_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1177:38: error: '_SPI4_TX_IRQ' was not declared in this scope C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp: At global scope: C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1254:100: error: Vector number must be an integer between 0 and 255 C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1284:100: error: Vector number must be an integer between 0 and 255 C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1314:100: error: Vector number must be an integer between 0 and 255 C:\MPIDE-chipkit\mpide-0023-windows-20140605-test.\hardware\pic32\libraries\DSPI\DSPI.cpp:1344:100: error: Vector number must be an integer between 0 and 255


sLowe

Mon, 28 Jul 2014 21:33:12 +0000

Hey Orges,

looks like when Microchip put out the Mz microcontroller they changed the irq and vector names. The DSPI and SPI library had not accounted for this name change which caused all those errors you saw.

Below I have attached 3 files that replace the DSPI library items and a board_defs.h. With the 3 attachment limit, I will post another three files to replace the SPI library items and a system defs file.

I got PmodJstkDspi to compile with these files in place.

Thanks,

Sam Lowe


sLowe

Mon, 28 Jul 2014 21:35:39 +0000

Here are the second three files to replace


KeithV

Tue, 29 Jul 2014 00:11:49 +0000

Yes, I know about this problem and was working on it today. The problem is that the MZ pic32xxx.h header files do not define the same constants as the MX ones do; and when I updated the core I did not catch these issues.

Attached is a zip file

you need to put

SPI.cpp and SPI.h in ..../hardware\pic32\libraries\SPI DSPI.cpp and DSPI.h in ..../hardware\pic32\libraries\DSPI

and

Board_Defs.h in ..../hardware\pic32\variants\WiFire

and system_defs.h in ..../hardware\pic32\cores\pic32

I am not positive I have fixed everything, but give it a go and let me know.


orges.furxhi

Tue, 29 Jul 2014 01:42:01 +0000

Kevin,

Thank you for the quick turn around. I replaced the filed you provided and everything compiles as expected.

Sam, For some reason your post did not show until later tonight, after I had made the changes that Kevin suggested.

I do not have the board with me at the moment, but I'll upload the code on the board tomorrow and test further.

Thanks again,

Orges


orges.furxhi

Tue, 29 Jul 2014 18:57:09 +0000

Tried it on the board and it works as expected.

thanks again,

Orges