Pages: [1]   Go Down
Author Topic: Dataflash issues with Due  (Read 842 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using 1.5.2 IDE with a Due.

Code won't compile:

Code:
#include <SPI.h>
#include <DataFlash.h>
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
 
}


I get these errors:
C:\Arduino\arduino-1.5.2\libraries\dataflash\DataFlash.cpp: In member function 'void DataFlash::setup(int8_t, int8_t, int8_t)':
C:\Arduino\arduino-1.5.2\libraries\dataflash\DataFlash.cpp:151: error: 'SPSR' was not declared in this scope
C:\Arduino\arduino-1.5.2\libraries\dataflash\DataFlash.cpp:151: error: 'SPI_2XCLOCK_MASK' was not declared in this scope
C:\Arduino\arduino-1.5.2\libraries\dataflash\DataFlash.cpp:152: error: 'SPCR' was not declared in this scope
C:\Arduino\arduino-1.5.2\libraries\dataflash\DataFlash.cpp: In member function 'void DataFlash::begin()':
C:\Arduino\arduino-1.5.2\libraries\dataflash\DataFlash.cpp:176: error: 'SPCR' was not declared in this scope
C:\Arduino\arduino-1.5.2\libraries\dataflash\DataFlash.cpp:177: error: 'SPSR' was not declared in this scope

Anyone successfully using this library with Due? Thanks for any help!
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 626
Posts: 34128
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Libary link?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

https://github.com/BlockoS/arduino-dataflash
« Last Edit: March 21, 2013, 12:26:09 pm by joshuaj » Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 626
Posts: 34128
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks.

It seems to use the normal SPI library and the problem with that is that it is talking directly to the hardware registers of the processor. On the Due those registers are simply not present in the same location with the same bit meanings.
To further complecate the matter the Due's SPI pins are not on the same pins as a normal Arduino but are on a pin header, the one just above the Arduino Logo.

So the whole thing needs a bit of a rewrite I am afraid.  That is the problem with libraries that talk direct to hardware, when the hardware changes the rug is pulled from underneath it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for looking at that Mike.

So I'm using the SPI library for other devices on the Due currently and that works. The 1.5.2 IDE takes into account weather you are using an AVR or SAM device and includes the proper library..  Dataflash includes SPI but the compiler does not find it so I #included it.. Seems like there's a linking problem but I don't have any expertise here..

Thanks!
Josh
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 626
Posts: 34128
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I get
Quote
ataFlash_test.cpp:4:24: error: test/Dummy.h: No such file or directory
When I compile the sector erase example with 1.5.1
And the same when I try it with 1.0.3 for a Uno. I just think it is a rubbish piece of code.
Logged

Pages: [1]   Go Up
Jump to: