Show Posts
Pages: [1] 2 3 ... 7
1  Products / Arduino Due / Re: Problems programming the Due on: July 21, 2014, 06:15:17 pm
Hmm... so this is interesting.

The directory your talking about "hardware/arduino/sam/variants/arduino_due_x" contains some linker scripts. I am not very familiar with these at all, however I know of a good tutorial that is dealing with the same topic we are discussing;

http://www.theresistornetwork.com/2013/09/arm-bare-metal-programming.html

It explains how linker scripts fit all of the proper object files into memory, wherever you specify. Hopefully this can shed some light on the subject.



Now, In regards to my toolchain, I removed the file "adc12_sam3u.c" I also attempted to build the project from install/due/sam/libsam/build_gcc. I get a similar error now, but it's interesting: I get the same error when I compile from here and when I compile from the example project. Only difference is that this one is more verbose.

(Note: There are also linker scripts in this directory)

Here is the error from the above directory:

 
Code:
$ make clean && make all
------------------------------------------------------------------------------------
--- Cleaning sam3s4c release and debug
------------------------------------------------------------------------------------
--- Cleaning __SAM3S4C__ files release_sam3s4c ../../../lib/libsam_sam3s4c_gcc_rel.a
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
--- Cleaning __SAM3S4C__ files debug_sam3s4c ../../../lib/libsam_sam3s4c_gcc_dbg.a
------------------------------------------------------------------------------------
--- Cleaning sam3u4e release and debug
------------------------------------------------------------------------------------
--- Cleaning __SAM3U4E__ files release_sam3u4e ../../../lib/libsam_sam3u4e_gcc_rel.a
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
--- Cleaning __SAM3U4E__ files debug_sam3u4e ../../../lib/libsam_sam3u4e_gcc_dbg.a
------------------------------------------------------------------------------------
--- Cleaning sam3x8e release and debug
------------------------------------------------------------------------------------
--- Cleaning __SAM3X8E__ files release_sam3x8e ../../../lib/libsam_sam3x8e_gcc_rel.a
make[1]: [clean] Error 1 (ignored)
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
--- Cleaning __SAM3X8E__ files debug_sam3x8e ../../../lib/libsam_sam3x8e_gcc_dbg.a
------------------------------------------------------------------------------------
--- Cleaning sam3x8h release and debug
------------------------------------------------------------------------------------
--- Cleaning __SAM3X8H__ files release_sam3x8h ../../../lib/libsam_sam3x8h_gcc_rel.a
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
--- Cleaning __SAM3X8H__ files debug_sam3x8h ../../../lib/libsam_sam3x8h_gcc_dbg.a
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
--- Making libsam_sam3s4c_gcc_dbg.a
---
------------------------------------------------------------------------------------
--- Preparing __SAM3S4C__ files debug_sam3s4c to ../../../lib
make[1]: [create_output] Error 1 (ignored)
make[1]: [create_output] Error 1 (ignored)
------------------------------------------------------------------------------------
../../../tools/g++_arm_none_eabi/bin/arm-none-eabi-gcc: 1: ../../../tools/g++_arm_none_eabi/bin/arm-none-eabi-gcc:ELF▒4N: not found
../../../tools/g++_arm_none_eabi/bin/arm-none-eabi-gcc: 2: ../../../tools/g++_arm_none_eabi/bin/arm-none-eabi-gcc: Syntax error: word unexpected (expecting ")")
make[1]: *** [debug_sam3s4c/adc.o] Error 2
make: *** [libsam_sam3s4c_gcc_dbg.a] Error 2

And here is the error from the example project:
Code:
$ make clean && make all
make: [clean] Error 1 (ignored)
"/media/workspace/install/due/tools/g++_arm_none_eabi/bin/arm-none-eabi-gcc" -c -Wall --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fdata-sections -nostdlib -std=c99 -Os  -I/media/workspace/install/due/include -I/media/workspace/install/due/sam -I/media/workspace/install/due/sam/libsam -I/media/workspace/install/due/sam/CMSIS/CMSIS/Include -I/media/workspace/install/due/sam/CMSIS/Device/ATMEL main.c -o release/main.o
/media/workspace/install/due/tools/g++_arm_none_eabi/bin/arm-none-eabi-gcc: 1: /media/workspace/install/due/tools/g++_arm_none_eabi/bin/arm-none-eabi-gcc:ELF▒4N: not found
/media/workspace/install/due/tools/g++_arm_none_eabi/bin/arm-none-eabi-gcc: 2: /media/workspace/install/due/tools/g++_arm_none_eabi/bin/arm-none-eabi-gcc: Syntax error: word unexpected (expecting ")")
make: *** [release/main.o] Error 2

Hope this helps, I'll keep digging and I'll post if I find anything.
2  Products / Arduino Due / Re: Problems programming the Due on: July 21, 2014, 02:39:27 pm
Hmmm, thats great info!

I was looking for the ide version too, unfortunately its not there. Neither is an email to contact him and find out. But that means the compiler is calling a variable that is never defined.

So where would I place the #define SAM3U_SERIES, in the main file? Or would I have to find the tool's code, change it and re compile it? Also what would I define it as; 1?

Its a shame you can't use the same toolchain for every version of the ide.

On a side note, I've been thinking about just downloading the gcc-arm-none-eabi toolchain and using that one with the environment he has set up. Maybe that will eliminate the uninitialized defines, any ideas?

3  Products / Arduino Due / Problems programming the Due on: July 21, 2014, 10:40:05 am
Hello,

I am trying to program the Arduino Due using a Raspberry Pi. I have the arduino due connected to the raspberry pi through the programming port. I don't want to use the Arduino IDE, I want to be able to upload *.c and *.h files using a Makefile.

I have managed to find a tutorial that explains just this(minus the raspberry pi part). Here is the link:

http://forum.arduino.cc/index.php?PHPSESSID=1otopdenjdk9kn1mtu8v7ehtn4&action=dlattach;topic=256235.0;attach=89378

There is a small problem with this, however... I have not managed to make the example project.
At the end of the "fiddling script" the project is attempted to be made, this ends up failing. (picture attached below) Pretty weird looking error if you ask me, Looks like it's looking for an ELF file.


There are a few small changes you have to make to the arduino folder to get this to work, you must rename "gcc-arm-none-eabi" to "g++_arm_none_eabi" Because this is what the fiddling script looks for. Also I had to change the usb port on the Makefile after I ran the fiddling script.

The Makefile ends up throwing a syntax error, but I have no clue where the error is found, The example main.c doesn't have any errors. I'm thinking maybe the script is relying on an older toolchain or something of the sort.

Either way, has anyone had this problem before?

If not, but you have managed to upload to your due using native c code please share your thoughts or your setup. I am not very interested in this particular setup, I just want to be able to program my Due, through the programming port, in the native ARM c.

Any help is greatly appreciated. Thanks in advanced!

Happy Coding! smiley
4  Using Arduino / Storage / Sd card reading once then stops on: July 20, 2011, 04:04:57 pm
Hi everyone. I'm having a problem reading from my sd card. I bought a breakout board from cutedigi for the sd card

http://www.cutedigi.com/product_info.php?products_id=4435

and i also bought the vs1053 breakout board from sparkfun for mp3 decoding

http://www.sparkfun.com/products/9943

I set up my arduino to have the same configuration as the mp3 shield that sparkfun has

http://www.sparkfun.com/products/10628

Escept for the sd card breakout board. That uses all 5v input so i did not pass the sd wires through the voltage regulator. I also used the code from the shield... basically what i am trying to do is take what i can do with the mp3 shield and integrate it into a smaller project.

Code:

http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Dev/Arduino/Shields/MP3_Player_Example.pde

The problem with that is that i can read from the sd card for the first bit of info that i need, after that the DREQ pin on the VS1053 goes high but it seems that i cannot read from the sd card again. Also when i try to reset it it doesn't let me initialize the card or the volume and the root doesn't open. I have to take the sd card out manually and put it back in while i reset the arduino, only then does it allow me to read more data, but it's still just the first part of the song. I've tried multiple sd cards and it doesn't work.

Do i have to cycle the power to the sd card? or am i missing the 10k pull-up resistors? whats the problem? can anyone please help?
Thanks
5  Development / Other Software Development / Re: DuinOS: Small and Simple OS based on FreeRTOS on: July 04, 2011, 02:58:14 am
Hey, i just started toying around with DuinOS. And i want to implement it into one of my projects...

I have an atmega328 with the optiboot boot loader (arduino uno) on a breadboard. I have that hooked up to an lcd and some buttons, ultimatley i want to hook it up to an mp3 decoder. I have a whole gui and a couple games built into one of the task loops, the other one is going to take care of talking to an sd card and sending the data to an mp3 decoder... The problem is when i try to load up the gui it doesn't come up.

Nothing happens... i think im getting a stack overflow but i am not sure... is there anyway to detect this? Or am i doing it wrong? I am leaving the loop empty and declaring a task loop that i start in the setup, should i start it with a stack and how big? thanks in advanced for the help.
6  Using Arduino / Networking, Protocols, and Devices / Re: SDfat and SPI library on: April 12, 2011, 02:45:25 pm
well i did it because i don't know how long the song would be and it's just a test run... i just want the song to play and i couldn't think of a better way to have the data stored without still having access to the sd card via spi. unless the file class doesn't keep the spi port open. but i wasn't to sure on it.
7  Using Arduino / Networking, Protocols, and Devices / SDfat and SPI library on: April 12, 2011, 07:56:00 am
I'm trying to use the sdfat library with the arduino spi library. I'm using the arduino uno and trying to use both as slaves. They both work seperatley, but when i try to combine them it doesn't work. Neither one of the spi slaves interacts and the whole thing just goes wrong, it doesn't even write anything to the slave.

heres the code:


Code:
#include <SPI.h>
#include <SdFat.h>

int CS_pin = 8;
int DCS_pin = 9;
int DREQ_pin = 7;
int XRST_pin = 6;
int MP3_CS_pin = 10;


SdFat sd;
SdFile myFile;
byte dat[10000];
int index = 0;

void setup()
{
  Serial.begin(9600);
  pinMode(MP3_CS_pin, OUTPUT);
  pinMode(CS_pin, OUTPUT);
  pinMode(DREQ_pin, INPUT);
  pinMode(DCS_pin, OUTPUT);
  pinMode(XRST_pin, OUTPUT);
 
 

}

void playSong(){
  for(int i = 0; i < index; i++){
    SPI.transfer(dat[i]);
  }
}

void loop()
{
  digitalWrite(MP3_CS_pin, HIGH);
  digitalWrite(CS_pin, HIGH);
  digitalWrite(DCS_pin, HIGH);
 
  delay(100);
 
  if (!sd.init(SPI_HALF_SPEED, MP3_CS_pin)) sd.initErrorHalt();
 
  // re-open the file for reading:
  if (!myFile.open("song1.mp3", O_READ)) {
    sd.errorHalt("error opening song1.mp3 for read");
  }
  Serial.println("song1.mp3:");
   
  int data;
  while ((data = myFile.read()) >= 0){
    Serial.write(data);
    dat[index++] = data;
  }
 
  myFile.close();
  digitalWrite(MP3_CS_pin, HIGH);
 
 SPI.begin();
 
 SPI.setBitOrder(MSBFIRST);
 SPI.setDataMode(SPI_MODE1);
 //max SDI clock freq = CLKI/7 and (datasheet) CLKI = 36.864, hence max clock = 5MHz
 //SPI clock arduino = 16MHz. 16/ 4 = 4MHz -- ok!
 SPI.setClockDivider(SPI_CLOCK_DIV4);
 
 digitalWrite(XRST_pin, LOW);
 delay(100);
 
 digitalWrite(CS_pin, HIGH);
 digitalWrite(DCS_pin, HIGH);
 digitalWrite(XRST_pin, HIGH);
 delay(5);

 // CHIP Write
 // sets sci_mode register, SM_SDINEW, SM_TESTS, SM_STREAM.  pg 25, 26
 byte aux;
 digitalWrite(CS_pin, LOW);
 delay(1);
 SPI.transfer(0x02);  //write command
 SPI.transfer(0x00); //SDI_MODE register
 //extract and send higher byte of data
 //0x0400
 aux = 0x08A0 >> 8;
 SPI.transfer(aux);
 //extract and send lower byte of data
 aux = 0x08A0 & 0b11111111;
 SPI.transfer(aux);
 //wait for the chip to finish executing command
 while (!DREQ_pin){};
 digitalWrite(CS_pin, HIGH);
 delay(1);

 // Start SINE test
 digitalWrite(CS_pin, HIGH);
 digitalWrite(DCS_pin, LOW);
 delay(1);
 
 playSong();

 delay(200);
 digitalWrite(DCS_pin, HIGH);
}

i've been at this for like 2 weeks now and im super frustrated >.<
please help.
8  Using Arduino / Storage / Re: An eaiser to use SD library on: April 11, 2011, 08:47:40 pm
no this is on the arduino uno. i think i might do the same thing u did.
9  Using Arduino / Storage / Re: An eaiser to use SD library on: April 11, 2011, 08:10:55 pm
I'm trying to use your library with the arduino spi library. sorry to bother you again but can you please help me out with the code?

Code:
#include <SPI.h>
#include <SdFat.h>

int CS_pin = 8;
int DCS_pin = 9;
int DREQ_pin = 7;
int XRST_pin = 6;
int MP3_CS_pin = 10;


SdFat sd;
SdFile myFile;
byte dat[10000];
int index = 0;

void setup()
{
  Serial.begin(9600);
  pinMode(MP3_CS_pin, OUTPUT);
  pinMode(CS_pin, OUTPUT);
  pinMode(DREQ_pin, INPUT);
  pinMode(DCS_pin, OUTPUT);
  pinMode(XRST_pin, OUTPUT);
 
 

}

void playSong(){
  for(int i = 0; i < index; i++){
    SPI.transfer(dat[i]);
  }
}

void loop()
{
  digitalWrite(MP3_CS_pin, HIGH);
  digitalWrite(CS_pin, HIGH);
  digitalWrite(DCS_pin, HIGH);
 
  delay(100);
 
  if (!sd.init(SPI_HALF_SPEED, MP3_CS_pin)) sd.initErrorHalt();
 
  // re-open the file for reading:
  if (!myFile.open("song1.mp3", O_READ)) {
    sd.errorHalt("error opening song1.mp3 for read");
  }
  Serial.println("song1.mp3:");
   
  int data;
  while ((data = myFile.read()) >= 0){
    Serial.write(data);
    dat[index++] = data;
  }
 
  myFile.close();
  digitalWrite(MP3_CS_pin, HIGH);
 
 SPI.begin();
 
 SPI.setBitOrder(MSBFIRST);
 SPI.setDataMode(SPI_MODE1);
 //max SDI clock freq = CLKI/7 and (datasheet) CLKI = 36.864, hence max clock = 5MHz
 //SPI clock arduino = 16MHz. 16/ 4 = 4MHz -- ok!
 SPI.setClockDivider(SPI_CLOCK_DIV4);
 
 digitalWrite(XRST_pin, LOW);
 delay(100);
 
 digitalWrite(CS_pin, HIGH);
 digitalWrite(DCS_pin, HIGH);
 digitalWrite(XRST_pin, HIGH);
 delay(5);

 // CHIP Write
 // sets sci_mode register, SM_SDINEW, SM_TESTS, SM_STREAM.  pg 25, 26
 byte aux;
 digitalWrite(CS_pin, LOW);
 delay(1);
 SPI.transfer(0x02);  //write command
 SPI.transfer(0x00); //SDI_MODE register
 //extract and send higher byte of data
 //0x0400
 aux = 0x08A0 >> 8;
 SPI.transfer(aux);
 //extract and send lower byte of data
 aux = 0x08A0 & 0b11111111;
 SPI.transfer(aux);
 //wait for the chip to finish executing command
 while (!DREQ_pin){};
 digitalWrite(CS_pin, HIGH);
 delay(1);

 // Start SINE test
 digitalWrite(CS_pin, HIGH);
 digitalWrite(DCS_pin, LOW);
 delay(1);
 
 playSong();

 delay(200);
 digitalWrite(DCS_pin, HIGH);
}

sorry to bother you so much but i've been at this for like 2 weeks now and im super frustrated >.<
10  Using Arduino / Storage / Re: Sd and SPI library? on: April 11, 2011, 07:44:41 pm
yeah it is, they haven't updated... so what i started doing was using the alternate cores:

http://www.avr-developers.com/corefiles/index.html

the libraries work with that but apparently the pins are a little off.
11  Using Arduino / Storage / Re: Sd and SPI library? on: April 11, 2011, 07:02:40 pm
what do you mean all the mods for a sanguino? i have the sanguino stuff on my arduino ide aswell but the libraries don't work with it! =/
12  Using Arduino / Storage / Re: Sd and SPI library? on: April 11, 2011, 05:45:27 pm
it doesn't work!... now that i notice... with the different arduino cores none of the pins work above thirteen on the atmega644p and miso mosi and sck still dont output a thing
13  Using Arduino / Storage / Re: Sd and SPI library? on: April 11, 2011, 09:32:58 am
okay, i get it. that seems simple enough... also i would like to ask if you know how i could change the output pins of the spi library for the arduino, because i'm using an atmega644p from the arduino alternate core software. the pins are:

ss            pin 4
mosi        pin 5
miso        pin 6
sck          pin 7

could you please help me try to figure this out? i know the sd libray works, but not the spi library.
14  Using Arduino / Storage / Re: Sd and SPI library? on: April 11, 2011, 08:25:02 am
that's awsome... i've used your sdfat library but i haven'y had time to figure all of it out. and so could i use your sdfat library with the spi library on the arduino ide with no problem?
15  Using Arduino / Networking, Protocols, and Devices / Re: atmega644p with spi on: April 11, 2011, 08:21:06 am
lol yeah i really have... nothing seems to be working =/ but i tried changing them and it doesn't change anything... should i do it in my program or in the actual spi.h or spi.cpp files?
Pages: [1] 2 3 ... 7