Show Posts
Pages: [1] 2 3 4
1  Development / Other Software Development / Re: Simulator for Arduino on: December 20, 2011, 10:59:22 am
A good simulator would certainly be welcomed and I think I would even pay for it. However, I find a bit strange that you have a paid version already while still not having a full featured version. I am happy to test for you, but not if it takes me 30s each time I load my sketch (since the simulator crashes it took me 5 mn startup time in total to create this report)...

Anyhow, these are my findings so far:
- no support for projects that consists of more than one sketch (as does mine, so testing stops for now)
- this peace of code gave a 'Problem',...)
- no support for #define? Error: #define LCD_L11 "SOME STRING"
- no support for continued comment? Error: ** some text (*)
- after a number of errors: stack overflow
- immediately followed by a crash ('unhandled win32 exception [26700]'

Good luck, will try to test again if relevant (PM me if needed)


(*) Taken from theconstruct
** some text
** some other text
2  Using Arduino / Programming Questions / Re: Debug memory issue (serial won't help) on: November 02, 2011, 09:01:52 am
OK, thank you all for your help. I still have a problem with the sketch poking in the wrong places, but this wasn't it... I was a bit blinded by the fact that in this setup it looked practically impossible that the unit receives corrupted data. However... that impossiblity turned out to be a possibility. Pretty simple even: just start the sketch on the wrong moment, while data is received.

I'll be looking for a slim DFA example to implement (@gardner: after I googled the abbreviation I knew what they were, but am stumbling a bit implementing this on an arduino (and I am reluctant to use the library for this)).

In any case: if someone has pointers for the original question.... I am still interested.

3  Using Arduino / Programming Questions / Re: Debug memory issue (serial won't help) on: October 31, 2011, 04:38:18 pm
sscanf(b, "%4s %*5d%5ld.%3d %d", d, &t, &mt, &s);
This statement does not look right to me. There are supposedly 4 values in your input string, and 5 format specifiers, but only 4 variables to write to.

The %*5d%5ld part, in particular, looks strange.

Thanks for your input. The sscanf part isn't my favourite either, but as far as I know it is correct (I'll get to gardner's response later). Please bear in mind that I only gave this part as an example for my real problem: it seems somthing is corrupting the program memory. If I changes other parts of the code (ie. add debug statements) my builtin webserver stops working - just to give another example.

Just for record a short explanation to the use of the placeholders in the sscanf function:
%4s = scan 4 characters into a string (char*) => d
%*5d = scan 5 decimals and ignore those (this is the meaning of the *)
%5ld = scan 5 decimals into a long => t
%3d = scan 3 decimals into an int => mt
%d => scan a decimal into an int => s

Quote from: gardner
One thing that's missing is to check the value returned from sscanf().  This should be the number of matched items -- I think 5 in the normal case here.  The way the logic is written now could result in bogus values passed to processLoop(), if the string coming into sscanf() is not exactly right.

You're right, this is a bit dirty. The reason for this is that I wanted to hit two flies in one go (which is a Dutch proverb): process any activity on the line, even if it is wronly formatted. processLoop can handle bogus values. As far as I can see this would not cause a memory poking problem.

Personally, I would not simply read 22 characters into b[], but instead use a DFA to look for the '\n' and match the pattern as you read it.  The parser here could get out of sync with the input data pretty easily and would not recover.  If the sender wrote "\r\n" or threw in the odd OOB character on the stream, the receiver wouldn't have a hope.

I'd be happy to change this, but for now I already stop at 'DFA' :-( which does not ring a bell. And given that the available memory is limited I'd be reluctant to add a lot of code. Any pointes would be appreciated, because you're absolutely right on the 'out-of-sync' issue.

4  Using Arduino / Programming Questions / Re: sketch fails to run on: October 28, 2011, 09:07:02 am
Here you'll find information about how to read the free memory of your device: . It might be this, but it can also be something else (I recognize the problem). So please post your sketch, it might help.

5  Using Arduino / Programming Questions / Debug memory issue (serial won't help) on: October 28, 2011, 08:58:42 am
After a long time away I had to change our Arduino program and came across a problem I experienced earlier but never solved: mysterious program behaviour. Simplifying the code pretty a lot, this is part of the sketch:
  char b[22]; char d[5]; int s; unsigned long t; int mt;
  while (C.available() > 20) {
    // read event (dddd tttttttttt.ttt s\n) and process it
    for (int i=0; i<22; i++) { b[i]; }
    b[21] = 0; sscanf(b, "%4s %*5d%5ld.%3d %d", d, &t, &mt, &s); t *=1000; t+=mt;
    if (strcmp(d, "0000") != 0 && s < 2)
      if (processLoop(det_id, det_st, sec)) break;     

In this code 'C' is a client socket and what happens is that the while loop is entered. I know this because in another part of the code 'lastAlive' is checked and as a result the LCD is changed (or not). 'processLoop' however is never called. Now you might say... well that means that 'd' gets the value '0000' but that certainly is not the case.

Now I am looking for a way to debug this. The standard response then would be to add debug statements to either give serial output or use the LCD for this. And I'd agree... However... when I add such a statement the problem disappears... As soon as I add something to the code I see output AND processLoop is called. Sometimes unfortunately other parts of the sketch then stop working or change behaviour.

This mystery rings a bell from the old days... if program code no longer does what it should do based on the code, chances are that the program itself is poking in program memory in stead of data memory. I had a sift through the code, but I cannot really find such an error. Under normal circumstances I would turn to something like efence, but I have not found such a thing for the Arduino platform.
I did a Google for this issue and found posts about Valgrind (no avr support), emulino (seems no longer alive), emulare (I couldn't get it to work), VirtualBoard (seemed to support Java only) and winAVR (which does not like the Arduino code that much and certainly has no knowledge of the libraries).

So I turn to you. Has anyone found a solution for debugging Arduino software for memory leaks and boundary errors? It would really save my day.

6  Forum 2005-2010 (read only) / Forum / Re: not getting notificiation emails on: November 27, 2009, 04:59:33 am
Yep, had the same impression. And it really is helpful this feature.
7  Forum 2005-2010 (read only) / Forum / Re: Dutch subforum on: December 11, 2009, 06:28:44 am
As I wrote in another post: I am "against" language-based subfora because of the reason Yot mentions. And not only do some wonderful solutions get hidden, but you are also limiting yourself to a far less large group of people.

If one continues with the language subfora its only use should be for people who cannot write english to find someone that can... And in all honesty: are there really Dutch people who cannot write their questions in English?

8  Forum 2005-2010 (read only) / Forum / Fora, subfora, etc. on: December 06, 2009, 09:57:27 am
Last time I wanted to post something I found that in the current division in subfora there perhaps is room for improvement.

The current software section, for example, combines two or even three subjects:
 - the IDE
 - the programming language
 - own programming, tips, libraries, etc.

The hardware section is not only about hardware, but also about software ("how to do this and this with the Ethernet shield").

The foreign-language fora are something I am always very much opposed against (though I am Dutch) because it does not fit the idea having a large community. IMHO it would be better to use the foreign-language fora for people that know nothing about English giving them the opportunity to find an interpreter for them. It is a real pity if a wonderful solution to a problem stays "hidden" is a Portugese, Dutch or Croatian forum.

However, the main thing is that of the Hardware and Software part. I'd suggest

Hardware - hardware issues, problems, bugs, fry stories, etc...
  > Arduino main boards (Duemillanova, Mega, ...)
  > Arduino clone boards (...)
  > Shields
     > ...perhaps subfora for popular shields...

Programming language - issues creating your own software
  > Syntax, semantics, etc...
  > Libraries
  > Bugs in current language

  > How to
  > bugs

Well, something like that.

9  Forum 2005-2010 (read only) / Forum / Re: emergency thread on: November 28, 2009, 05:55:28 pm
I'd second the idea, but would think of an 'emergency sub forum' in stead of one thread, because it will contains several topics at the same time. And I think this forum should be moderated in wome way since a lot of people feel that their problem is an emergency...
10  Forum 2005-2010 (read only) / Forum / Re: Add "Arduino" to dictionary on: November 28, 2009, 05:57:15 pm
@Jeroen: yes, I know, but I wanted to support your suggestion that the spell checker was Firefox' not the forum... I see now that the OP probably already knew it...
11  Forum 2005-2010 (read only) / Forum / Re: Add "Arduino" to dictionary on: November 27, 2009, 05:02:05 am
I am 100% certain that it's Firefox that does this. I am Dutch and all my english text is undercurled (yeah... hence the spelling errors ;-) ). Maar type ik dit in het Nederlands dan is er niets onder"streept" (But if I type this in Dutch then nothing is under"lined").
12  Forum 2005-2010 (read only) / Forum / Improvement opp.: new posts since last visit on: November 22, 2009, 10:47:04 am
From other forums I got kind of used to the possibility to list all posts that were new since the last visit to the forum. Not only will it reduce the need for notifications per email but it also makes it more simple to find new interesting topics.
13  Forum 2005-2010 (read only) / Forum / Improvement opportunity: speed of forum/website on: November 22, 2009, 10:44:51 am
I feel that I have to wait rather often for pages to open. This is both the website as the forum. Could it be that Arduino gets too popular in respect to server performance?
14  Forum 2005-2010 (read only) / Troubleshooting / Re: IDE 0017 slow (WinXP/WinVista) on: November 12, 2009, 05:23:07 pm
I did read about this Bluetooth thing somewhere. I have tried the speed issue on two systems. One of those is a laptop (the Vista one) which has a switched-off BT device. The other one (a PC) also has a BT device which is enabled. I can try to remove that one, but removing an internal BT device from a laptop is a bit harder... should switching it of not do the trick (because it doesn't...)

15  Forum 2005-2010 (read only) / Troubleshooting / IDE 0017 slow (WinXP/WinVista) on: November 11, 2009, 07:45:08 am

I am just starting with the Arduino and experience a very slow IDE. I've tried this both under Windows XP as under Vista. I already disabled the bundled Java distribution, but alas... It takes 'ages' for the IDE to open, the Tools menu takes 12s to show and actions like verifying and uploading do not seem that quick either.

Is this the normal behaviour? If not: do you have any pointers to solve this? If it is normal: any experience on using the alternatives?

Kind regards,


PS: I have tried the IDE under Linux (CentOS) but this gave me RXTX error messages. I have not yet dived into this...
Pages: [1] 2 3 4