Montréal, Qc
Offline
Full Member
Karma: 0
Posts: 185
Practice safe hex!
|
 |
« on: September 11, 2007, 12:38:03 pm » |
Hello there, I would like to add the Procyoon AVRLib to my IDE. I tried putting the whole thing in lib/targets/ardunio, I tried in the libraries and I tried just putting the files I wanted in my sketch's directory. But to no avail. I'm sure it's something stupid I'm missing. Any pointers?
|
|
|
|
|
Logged
|
"Pilots believe in a clean living... they never drink wisky from a dirty glass."
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #1 on: September 11, 2007, 01:19:41 pm » |
It should be possible in any of those ways, I think. What happens when you try it?
|
|
|
|
|
Logged
|
|
|
|
|
Montréal, Qc
Offline
Full Member
Karma: 0
Posts: 185
Practice safe hex!
|
 |
« Reply #2 on: September 11, 2007, 03:04:21 pm » |
So I've gotten all the net stuff (and what it relies on) to compile using the "in sketch" method. However only using the Makefile. The IDE seems to try to compile the .cpp's as C instead of c++ (at least it's pretty much the same error I get when I replicate this in the Makefile). Still, it's not perfect, serial seems to be broken, doesn't send/receive anything. Even though I took care of removing all the uart stuff and replacing it by the Serial object). The timer classes are probably going to be an issue. So right now the biggest problem is avoiding wiring and avrlib to conflict; and I only have a small part of avrlib. Any pointers there?
|
|
|
|
« Last Edit: September 11, 2007, 03:05:05 pm by xSmurf »
|
Logged
|
"Pilots believe in a clean living... they never drink wisky from a dirty glass."
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #3 on: September 11, 2007, 04:11:28 pm » |
What errors do you get when you try to compile things in the IDE? Or are you happy using the Makefile?
When you say that serial's broken, what code are you running?
|
|
|
|
|
Logged
|
|
|
|
|
Montréal, Qc
Offline
Full Member
Karma: 0
Posts: 185
Practice safe hex!
|
 |
« Reply #4 on: September 11, 2007, 07:15:21 pm » |
The Makefile is fine for now, that's what I use normally. Right now I only wished I knew why the program makes the µC crash. As for serial I'm using Wiring's library. EDIT: Here's the code. As you can see in the setup there are a few Serial sends which never appears (sometimes just a few char return). Also atm the LED never ends up flashing. Like if the setup failed or the uC crashed when setting up Serial
|
|
|
|
« Last Edit: September 11, 2007, 07:56:05 pm by xSmurf »
|
Logged
|
"Pilots believe in a clean living... they never drink wisky from a dirty glass."
|
|
|
|
Montréal, Qc
Offline
Full Member
Karma: 0
Posts: 185
Practice safe hex!
|
 |
« Reply #5 on: September 11, 2007, 07:30:17 pm » |
Also, didn't anyone work on an ENC28J60 drivers for the Arduino? If so, is it available anywhere? Maybe it could help?
|
|
|
|
|
Logged
|
"Pilots believe in a clean living... they never drink wisky from a dirty glass."
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #6 on: September 11, 2007, 08:18:32 pm » |
My first guess is that you're running out of RAM because of all the strings you've got in the code. Can you try commenting out everything but setup() and loop() and trying it again?
|
|
|
|
|
Logged
|
|
|
|
|
Montréal, Qc
Offline
Full Member
Karma: 0
Posts: 185
Practice safe hex!
|
 |
« Reply #7 on: September 12, 2007, 12:37:43 am » |
Well that helped a lot! I moved all of the strings to inline progmem with PSTR. Very neat, albeit it seems a little unreliable... stuff like this happen: printString(PSTR("Uptime: ")); delay(2); Serial.print(millis()); delay(2); printString(PSTR("ms")); delay(2);
Show as : : 1848ask :
and some just don't print. printString looks like such void printString(const char *data) { char ch;
for (;;) { ch = pgm_read_byte( data++ ); if ( !ch ) return; Serial.print(ch); } }
I've tried delaying by 8xNOPs (1/2µS) to no avail. But hey, at least there is progress hehe 
|
|
|
|
|
Logged
|
"Pilots believe in a clean living... they never drink wisky from a dirty glass."
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #8 on: September 12, 2007, 08:44:33 am » |
Weird. Does the serial communication work reliably with the same hardware but different sketches?
|
|
|
|
|
Logged
|
|
|
|
|
Montréal, Qc
Offline
Full Member
Karma: 0
Posts: 185
Practice safe hex!
|
 |
« Reply #9 on: September 12, 2007, 03:26:35 pm » |
As far as I can tell, yes it is. There's some really... really... weird stuff. In my regDump function, none of the douzen serial strings are sent... I'll dig deeper I guess :/
|
|
|
|
|
Logged
|
"Pilots believe in a clean living... they never drink wisky from a dirty glass."
|
|
|
|
Montréal, Qc
Offline
Full Member
Karma: 0
Posts: 185
Practice safe hex!
|
 |
« Reply #10 on: September 12, 2007, 04:59:07 pm » |
GOT IT! I had two functions, one for print and one for println... well the first, called printString, was conflicting with wiring's printString. GCC never complained because wiring.h was not included in the files with the strings functions! FEW :o
Totally out of subject, but is there a way to know the ram specs? Such as how much is free, etc. The mega168 doesn't have JTAG (not that I have the cable), debugWire seems quiet complicated (no 2$ parallel hack) and simulavr doesn't support the mega168 as far as I could see and test. The only option I can see is AVRStudio. But running VMWare all the time seems like a bad idea, not to mention having to replicate the environment under two totally different platforms. And I've seen reviews saying it didn't run under Wine. What does that leave us with for debugging? :/
|
|
|
|
« Last Edit: September 12, 2007, 05:04:29 pm by xSmurf »
|
Logged
|
"Pilots believe in a clean living... they never drink wisky from a dirty glass."
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #11 on: September 12, 2007, 06:39:37 pm » |
I'm not sure. I think someone posted a sketch with a function that would calculate how much RAM you had free (by trying to allocate more and more memory until it failed, I think). If you find a good approach, that would be awesome.
|
|
|
|
|
Logged
|
|
|
|
|
Montréal, Qc
Offline
Full Member
Karma: 0
Posts: 185
Practice safe hex!
|
 |
« Reply #12 on: September 12, 2007, 06:46:14 pm » |
That's exactly the approach I was going to take. It would be sufficient for basic debugging at least. I wrote this but it didn't seem to work: char b[2048] = "a"; unsigned int i = 0; Serial.println(); for (i = 1; 1; i++) { Serial.print(i); Serial.print(" "); delay(100); b[i] = 255; }
I looked a little for the sketch and didn't find anything, was it posted on the forum?
|
|
|
|
« Last Edit: September 12, 2007, 06:46:37 pm by xSmurf »
|
Logged
|
"Pilots believe in a clean living... they never drink wisky from a dirty glass."
|
|
|
|
|