Show Posts
Pages: [1]
1  Using Arduino / General Electronics / Embedded PC Won't Boot With Arduino? on: February 13, 2011, 11:28:44 am
Hello,

I'm building a solution that uses an Arm-based embedded Linux PC (a Technologic TS-7553) with an Arduino (currently using a Duemilanove).

The Arduino is powered by the USB port. If the Arduino is plugged into the USB when power is applied to the PC, the PC will not boot.

While searching the forums, I found information regarding when the Arduino was powered separately, but I haven't found any people having problems booting with the Arduino powered by USB. I tried a powered USB hub, which didn't seem to make any difference.

I'm thinking this sounds like it may be a problem with the PC, and I also have a query into the manufacturer. But I'm wondering if anyone here may have some guidance. I'm much more a programmer than an electronics expert, so any guidance is appreciated!

Neal
2  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Memory leak in WString / TextString Library? on: June 22, 2010, 06:37:23 pm
Many thanks for this thread. It has helped a very frustrating problem!


But once I place the destructor in my code (or download the new zip...same thing), it doesn't function the same any more. Here's the relevant code:
Code:
void somefunction()
{
  char* timestamp = isoTimestamp();
  
  Serial.println(timestamp);
}


// iso8601 timestamp of current time
char* isoTimestamp(){
  Serial.println("in isoTimestamp");
  time_t t = now();

  Serial.println("Allocating String(20)");
  String str = String(20);

  Serial.println("Formatting timestamp");
  str.append(year(t));
  str.append("-");
  if(month(t) < 10) str.append("0");
  str.append(month(t));
  str.append("-");
  if(day(t) < 10) str.append("0");
  str.append(day(t));
  str.append("T");
  if(hour(t) < 10) str.append("0");
  str.append(hour(t));
  str.append(":");
  if(minute(t) < 10) str.append("0");
  str.append(minute(t));
  str.append(":");
  if(second(t) < 10) str.append("0");
  str.append(second(t));
  str.append("Z");

  Serial.print("isoTimestamp: ");
  Serial.println(str);
  
  char* outputChars = str.getChars();

  Serial.print("char isoTimestamp: ");
  Serial.println(outputChars);

  return str;
}

The above prints:
in isoTimestamp
Allocating String(20)
Formatting timestamp
isoTimestamp: 2010-06-22T23:33:23Z
char isoTimestamp: 2010-06-22T23:33:23Z
+?10-06-22T23:33:23Z

Note the two first bytes in the returned char* are wrong/odd (it isn't really a '?', but it was interpreted as a newline in the forum post). This occurs whether I "return str;" or "return str.toChars();"

I'm still pretty new to Arduino, and haven't messed with C-based stuff (aka pointers) since college long ago, so hopefully this is just a newbie mistake. But it worked fine before adding the String destructor. Well, other than the memory leak, anyway! Can someone help?

Thanks in advance.
Pages: [1]