Arduino core doesn't appear to be working

Using a simple analog read sketch (below) and opening up the serial monitor i cannot get any output on /dev/ttyACM0 which i would normally expect (as per the wiki)

As you can see it’s compiling and appears to be flashing ok, my settings are “cortex M0” as the board, Port is /dev/ttyACM0 - both as per the wiki.

Board info in arduino IDE:
BN: Seeeduino Cortex M0+
VID: 0x2886
PID: 0x8027
SN: 0ED0409450515233312E314AFF0C1907

CODE:

/*
  AnalogReadSerial

  Reads an analog input on pin 0, prints the result to the Serial Monitor.
  Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/AnalogReadSerial
*/

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(115200);
  Serial1.begin(115200);

  Serial.println("WELCOME TO THE THUNDERDOME!");
  Serial1.println("WELCOME TO THE THUNDERDOME!");
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
  Serial1.println(sensorValue);
  delay(1);        // delay in between reads for stability
}

Compile/Upload Results

<command-line>:0:18: warning: missing whitespace after the macro name [enabled by default]
Sketch uses 10712 bytes (4%) of program storage space. Maximum is 262144 bytes.
Atmel SMART device 0x10010005 found
Device       : ATSAMD21G18A
Chip ID      : 10010005
Version      : v2.0 [Arduino:XYZ] Oct 12 2018 18:20:29
Address      : 8192
Pages        : 3968
Page Size    : 64 bytes
Total Size   : 248KB
Planes       : 1
Lock Regions : 16
Locked       : none
Security     : false
Boot Flash   : true
BOD          : true
BOR          : true
Arduino      : FAST_CHIP_ERASE
Arduino      : FAST_MULTI_PAGE_WRITE
Arduino      : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.807 seconds

Write 10984 bytes to flash (172 pages)

[===========                   ] 37% (64/172 pages)
[======================        ] 74% (128/172 pages)
[==============================] 100% (172/172 pages)
done in 0.066 seconds

Verify 10984 bytes of flash with checksum.
Verify successful
done in 0.008 seconds
CPU reset.

ok. so the CORE is working. Serial1 is the serial pins on the 28 pin header, but there is nothing coming out of the USB side as for the serial monitor. this is not how it is supposed to work. so unless I am doing something wrong, then there is an issue with the arduino side of thngs.

See my other post here:

I’d love to be able to test this on the board I ordered. However I’ve not received it yet, and it’s been two weeks. Maybe this week yet?

How long did it take to get your board? Also, have you worked with the 40-pin header yet? Just wondering how well that works…

Thanks.

Tom

I have the same problem in the Arduino IDE. Serial Monitor is not working. Did someone escalated to support?

@bsfstreef Are you using the SerialUSB? Serial does not print.

@tcbetka I havenmt really had chance other than the serial ports, but limited issue i have it works. As far as how long, probably about 2 weeks max

@Baozhu what do you mean “serialUSB” you shouldnt need to. the arduino libraries and the example programs (for example) all refer to the “USB” port serial device as “Serial” then any additional ones as Serial1/2/3 etc.

So what device do we need to use to access the Serial port that the system programs with - as per normal in the arduino IDE?

There are no example programs that I can find which show this functionality, and to be honest, you should be following the practices and standards of the “real” arduino devices if you want to maintain compatibility with existing code and practices.

It’s not a deal breaker for me, but I would just like to know for reference so that when i am writing code, i’m not relying on jumper pins between serial ports etc and can program the device “the arduino way”

I just received my board today (yay!!!), so I’ll have to get it going tonight. What OS are you using @wx4cb? By the way, 73 de kf9ql.

i have ubuntu 19 on there right now with an SSD that has win 10 pro on it as that’s what I have a license for and just DB between them but my main is linux

Well, I finally managed to get the board up & running in Windows. I need to order an M.2 SSD drive so I can install Ubuntu 18.04 on that too. I’m going to just leave Windows alone, in case I need it later.

That said, I am having the same issue as you guys are–the Arduino serial port seems to be dumb as a post. I even tried SerialUSB class name, instead of the “Serial” class in the default Arduino libraries. My guess is that due to the hardware on this board, Seeed Studios had to re-write that class to match their hardware, which is why they’ve renamed it? Anyway, that class IS being found in the library, because I’m able to compile and upload the code after I’ve renamed the calls to the Serial object. But I still don’t get any output over the Arduino’s serial port console–and I even tried to wire RX on the 4 pin header to TX on the 28-pin header, and also the same with TX (4-pin header) to RX on the 28-pin header. Nothing. I didn’t try RX/RX and TX/TX though, so I will tomorrow. I’ve seen silly things like that done on hardware coming out of China already, lol.

The other thing I’m going to try tomorrow is to put my Saleae logic analyzer on the UART pins and see if there’s any traffic going in either direction–I’ll try it using both the Serial and SerialUSB class (object) name. Did you guys try that at all?

TB

1 Like

So how do I use then the serialmonitor of the Arduino IDE?

I would think it shouldn’t take anything special. I mean, assuming the SAMD chip is being programmed over a serial port like the Arduino chips are, then the connection should already be made. Just open the serial terminal inside the Arduino IDE, and I’d think we should see serial data. But that doesn’t appear to be the case.

So I want to dig up the pin-out diagram for the SAMD chip today, and maybe see if I can’t probe the bus with a logic analyzer to see if there’s data going in either direction. By virtue of the fact that there are UART pins on that 4-pin header next to the SAMD’s 28-pin header, it would almost suggest that we could tie them together and get data that way. Otherwise, what’s the use for that 4-pin header?

TB

1 Like

@tcbetka that’s my point, it should already be there, they’re obviously not doing it the correct way to keep in compliance with the arduino. There’s nothing to say they should have to, but at least give documentation. and that is what i’m gathering from all this product in general. the lack of documentation is amazing.

i was able to get NOTHING out of the 4 pin header irrespective of what “serial” i tried. i haven’t tried SerialUSB, but if that’s what you’re supposed to use, then great but at least show us how to use it in the monitor. at this point i’m half tempted to dump the arduino IDE and just compile natively but that’s too much work lol.

Like i said before, i was able to get it out of the “Serial1” which appears tied to the rx/rx on the 28 pin header.

Have you determined any sort of use for the 4-pin header then? Seems like it’s there so that you can maybe use it to communicate with the serial port on either the 28- or the 40-pin headers. Have you found any other documentation on that at all?

@tcbetka there is ZERO documentation on it at all that’s what annoys me. i havent had chance to dig deeper yet, hoping to this weekend

@wx4cb, are you in Florida, by chance? Is that your HAM call?

@tcbetka you are correct on both counts, central florida

1 Like

Figured as much. KF9QL here, in Wisconsin.

I spent an hour or two down in my electronics lab this morning, working with the board and my Saleae logic analyzer. Here are some thoughts…

  1. SerialUSB.println() does work with the serial monitor, as you can see here:

I noted that “Spud!” didn’t appear on either the 4-pin header Tx/Rx pins, or the Tx/Rx pins of the 28-pin header.

  1. No matter what I send over the serial monitor’s output, I get this on the Tx line of the 4-pin header:

It appears to just be an asynchronous clock signal, but it never changes with any sort of data sent from the serial monitor’s output field. Otherwise both the Tx and Rx lines on the 28-pin header are logic level low during this time–which makes sense, given that I think it’s mapped to the Serial1 port (see below).

  1. Interestingly enough, I did get some activity on the Tx line of the 28-pin header, when I used the Serial1 object (Serial1.println()) and tried to send the string “hello world” across. But it was filled with framing errors and I never got the full string, like can be seen here:

I watched for 10-15 seconds, and never once got a full “hello world” string without errors. But it does appear that pins 1 & 3 on the 28-pin header is indeed mapped to Serial1 in the API. I find this a bit strange though, seeing how they’re using SerialUSB for the programming port.

  1. Most concerning is that the entire IDE seems to lock up if I try to send characters across the serial monitor output more than 3-4 times. When I was trying to send characters across so that I could detect them on either bus (4-pin or 28-pin), the serial monitor would hang after I tried to send more than 3 or 4 times. It would just lock up, and I’d have to force-kill the entire IDE with the Task Manager in Win10 because there is no option to just kill the serial monitor. Most disconcerting. Then, when I’d open the IDE again, it defaults to the Arduino Yun board (might be the first one in the list?), completing forgetting about the SAMD21 I was trying to work with. At least it seemed to reset the board though, because sometimes when I would restart the IDE the SAMD would be COM3…and other times it would be COM4. I never did have to jumper the Tx/Rx pins on the 4-pin header to reset the port.

So my “formal” opinion (for what it’s worth) is that there is indeed something funky about the implementation of the Arduino core on this x86 Odyssey product. But that seems very strange–because there are pictures in the product demo video of the board connected to a TON of different sensors and other peripherals. Surely someone has tested the terminal function in the serial monitor?!?

At first I thought the problem might be the serialEvent method that is included in the Arduino demo sketch, as this is essentially a method called automatically by the Arduino core library after each loop() iteration. But even removing that code from the project doesn’t make a difference–the IDE still locks up.

I did find the pin-out and schematic diagrams for the Arduino Zero board, and want to go through those to see how they’ve mapped the SerialUSB port to the chip. But I doubt that there’s a way to evaluate the traffic on that bus, given that things are wired together on the Odyssey board itself. So @wx4cb is definitely correct in that we need more documentation for this product.

TB

@tcbetka

The framing errors are strange. Try testing it with minicom on the 40 pin header (/dev/ttyS4) see if you get consistant output. So what I would doi is tie tx/rx on each one to the respective pin on each header (28/40 pin) and see if you have any issues.

There is a program call realterm on sourceforge that might help you in that as it does show crc and framing errors etc and also the state of the lines.

it’s weird how there is just a clock signal on the 4 pin header… i’m wondering if it’s not i2c and just silkscreened wrong what is the frequency of the “clock” ?

as far as the pictures, that’s it, they may be “just pictures” i know the ttyS4 port works fine as i’ve used that to connect to devices.

@wx4cb…well, the i2c clock would have no signal until the master pulled the SDA line low, and then you’d see the clock get pulled low as well and do its thing. You shouldn’t see a clock going all the time like in my trials this morning. So although the board might not be silk-screened correctly, from my experience working with i2c I don’t think this is a mislabeled i2c bus. That said, to your other points, I ordered an NVME SSD drive this morning, and it will be here Monday. So I’ll get it installed on the x86 and then install Ubuntu on it. Then I can play around with some Linux tools like minicom. But I’ll check out the realterm application you mentioned. I’ve used it in the past, but not for several years. I also need to research framing errors a bit as well because I’m not used to doing much with a UART, other than basic stuff on the Teensy and RPi units…which just always seems to work.

The other thing I’m going to try with Serial1 is to connect a GPS unit I’ve used in other projects, and try to read data from it over Serial1. That will at least give me activity on the Rx line, and I can also echo it back on the Serial1 Tx line as well as use the logic analyzer. So I should definitely be able to detect errors on one or the other line (or both). I have a couple of sketches using that GPS, that I’ve run on a Teensy 3.2 device–which should give me a good starting point. I just need to dig around on gitlab to see if I can find them again.

While this sort of testing can be educational in that sense, it seems like an awful lot of work for something that should “just work.” LOL…

TB

1 Like