Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED]SPI library compile error
14-09-2015, 01:59 PM, (This post was last modified: 22-09-2015, 09:33 AM by gtcbreizh.)
#1
[SOLVED]SPI library compile error
Hello fellow enthusiasts,

I have been trying to get a SPI peripheral to work with pinguino however i am running into compile errors even with the example projects.
I am using pic18f2550, with the 4.14 bootloader. IDE 11.0-beta3 and Windows7x64 (tried to remove and reinstall the IDE already).
When i try to compile for example 'DigitalPotControl.pde' (unmodified) i get the following error in stdout:
Code:
Processor: 18f2550
sdcc: Calling preprocessor...
sdcc: Generating code...
C:/pinguino-11/p8/include/pinguino/core/spi.c:455: error 20: Undefined identifier 'SSP1BUF'
C:/pinguino-11/p8/include/pinguino/core/spi.c:456: error 26: '_SSP1IF' not a structure/union member
C:/pinguino-11/p8/include/pinguino/core/spi.c:458: error 20: Undefined identifier 'SSP1BUF'
C:/pinguino-11/p8/include/pinguino/core/spi.c:463: error 26: '_SSP1IF' not a structure/union member
C:/pinguino-11/p8/include/pinguino/core/spi.c:494: error 26: '_SSP1IF' not a structure/union member
C:/pinguino-11/p8/include/pinguino/core/spi.c:496: error 20: Undefined identifier 'SSP1BUF'
C:/pinguino-11/p8/include/pinguino/core/spi.c:497: error 20: Undefined identifier 'SSP1BUF'
C:/pinguino-11/p8/include/pinguino/core/spi.c:498: error 26: '_SSP1IF' not a structure/union member
I have tried to go in manually and use both hard and software SPI but i cannot seem to fix the issue.

The original idea was to use a nokia 5110 LCD (example PCD8544/helloworld.pde) and that too gives the same errors.

So first of all. This is a bug report, but maybe i'm doing something wrong and somebody might be able to help me. If there is any more info that you need please let me know.

Thanks in advance!
Reply
19-09-2015, 09:49 AM,
#2
RE: SPI library compile error
PIC18F2550 has only SSPBUF register. SSP1BUF is available for other devices. Check the documentation:
http://ww1.microchip.com/downloads/en/de...39632c.pdf
You should try renaming the registers.
Reply
21-09-2015, 02:55 PM, (This post was last modified: 21-09-2015, 02:58 PM by steeef.)
#3
RE: SPI library compile error
Thanks B4lfiz4r,

I changed some occurrences in SPI.c to what you suggested and now compiling doesn't give those errors any more. You know of some way to report this issue to the developer so that this issue can be addressed in future releases?

Sadly, a different problem arrises when truing to compile which is the following:
Code:
warning: Relocation of section ".idata" failed, relocating to a shared memory location.
error: Linker script has no definition that matches the type of section ".idata".
Processor: 18f2550
sdcc: Calling linker...
+ C:\PINGUI~1\COMPIL~1\p8\bin\gplink.exe -I"C:\pinguino-11\compilers\p8\bin\..\share\sdcc\lib\pic16" -I"C:\pinguino-11\compilers\p8\bin\..\share\sdcc\non-free\lib\pic16"  -sC:\pinguino-11\p8\lkr\boot4.18f2550.lkr -m  -w -r -o "C:\pinguino-11\user\source\main.hex"  "C:\pinguino-11\user\source\main.o"   "libio18f2550.lib" "libdev18f2550.lib" "libc18f.lib" "libm18f.lib" "libsdcc.lib" "libdev18f2550.lib" "libsdcc.lib"
+ C:\PINGUI~1\COMPIL~1\p8\bin\gplink.exe -I"C:\pinguino-11\compilers\p8\bin\..\share\sdcc\lib\pic16" -I"C:\pinguino-11\compilers\p8\bin\..\share\sdcc\non-free\lib\pic16"  -sC:\pinguino-11\p8\lkr\boot4.18f2550.lkr -m  -w -r -o "C:\pinguino-11\user\source\main.hex"  "C:\pinguino-11\user\source\main.o"   "libio18f2550.lib" "libdev18f2550.lib" "libc18f.lib" "libm18f.lib" "libsdcc.lib" "libdev18f2550.lib" "libsdcc.lib"  returned errorcode 1
/dvpt/pinguino/git-copy/pinguino-compilers/sources/sdcc/src/pic16/main.c:701 setting interrupt vector addresses 0xc00

Any suggestions or pointers on how i might solve this?
Thanks again!
Reply
21-09-2015, 04:47 PM,
#4
RE: SPI library compile error
Hey.
I have installed latest pinguino IDE ( pinguino-11.2015.02.02-setup.exe ) and renamed the SSP1 to SSP in spi.c, and the DigitalPotControl.pde is compiling fine.

Code:
[OUT] Compiling: C:\pinguino-11\user\examples.Communication\SPI\DigitalPotControl.pde
[OUT] Board: Pinguino 2550
[OUT] Proc: 18f2550
[OUT] Arch: 8
[OUT] Bootloader: v4
[DEBUG] Starting 'verify' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'preprocess' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'get_regobject_libinstructions' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'get_regobject_libinstructions': 0.00 s
[DEBUG] Ending 'get_regobject_libinstructions'
[DEBUG] Starting 'replace_word' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'replace_word': 0.02 s
[DEBUG] Ending 'replace_word'
[DEBUG] Time spent for 'preprocess': 0.06 s
[DEBUG] Ending 'preprocess'
[DEBUG] Starting 'compile' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'compile': 1.25 s
[DEBUG] Ending 'compile'
[DEBUG] Starting 'link' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'link': 1.55 s
[DEBUG] Ending 'link'
[DEBUG] Time spent for 'verify': 2.86 s
[DEBUG] Ending 'verify'
[OUT] compilation done
[OUT] Code size: 4604 / 29696 bytes (15% used)
[OUT] 2.860 seconds process time
>>>
stdout:
Code:
Processor: 18f2550
sdcc: Calling linker...
+ C:\PINGUI~1\COMPIL~1\p8\bin\gplink.exe -I"C:\pinguino-11\compilers\p8\bin\..\share\sdcc\lib\pic16" -I"C:\pinguino-11\compilers\p8\bin\..\share\sdcc\non-free\lib\pic16"  -sC:\pinguino-11\p8\lkr\boot4.18f2550.lkr -m  -w -r -o "C:\pinguino-11\user\source\main.hex"  "C:\pinguino-11\user\source\main.o"   "libio18f2550.lib" "libdev18f2550.lib" "libc18f.lib" "libm18f.lib" "libsdcc.lib" "libdev18f2550.lib" "libsdcc.lib"
/dvpt/pinguino/git-copy/pinguino-compilers/sources/sdcc/src/pic16/main.c:701 setting interrupt vector addresses 0xc00

I am unable to reproduce the linker error you're having.
Reply
21-09-2015, 05:03 PM, (This post was last modified: 21-09-2015, 05:26 PM by gtcbreizh.)
#5
RE: SPI library compile error
Hi,
Would you try the attached spi.c ?
I try it selecting a pinguino2550. The compilation of DigitalPotControl.pde is OK

NB : Sometimes ago when Régis modified deeply spi.c he absolutely forgot the 18f2550 and 18f4550

Bye
André


Attached Files
.c   spi.c (Size: 16.29 KB / Downloads: 5)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)