Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

general problem with Arduino 2 Beta?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

general problem with Arduino 2 Beta?

by bastler59 on Sun Nov 28, 2021 3:45 pm

Hi,

is there a general problem, so feather boards with SAMD-controller and the board software will not work with Arduino 2?

Bye
Jürgen

bastler59
 
Posts: 18
Joined: Sun Nov 28, 2021 3:37 pm

Re: general problem with Arduino 2 Beta?

by mikeysklar on Tue Nov 30, 2021 6:04 pm

Jürgen,

The Arduino IDE 2.x is just in beta state so I would not expect things to work. If you can use the 1.8.13 release we can support you for now.

You are welcome to post errors you are coming across and we can point you to a github repo to open an issue.

mikeysklar
 
Posts: 6498
Joined: Mon Aug 01, 2016 8:10 pm

Re: general problem with Arduino 2 Beta?

by bastler59 on Wed Dec 01, 2021 10:54 am

Hi,

yes I know, that Adriuno 2.0 IDE is still beta. But I like the appearance and things like right click on an include-clause to open a header file etc.

So here is the long "novel" about my first experiences with this beta-IDE ...

I followed the instructions on your homepage https://learn.adafruit.com/adafruit-feather-m0-adalogger and
- installed Arduino AVR Board 1.8.4
- added the JSON link
- installed Arduino SAM Boards (32-bits ARM Cortex-M3) by Arduino 1.6.11
- and Arduino SAMD Boards (32 bits ARM Cortex-M0+) by Arduino 1.8.11
- and Adafruit SAMD Boards by Adafruit 1.7.4

Two times I got a poup "Allow dpinst-amd64.exe?" and clicked OK for yes.

Today my Adafruit Feather M0 Adalogger arrived. I repeat some tests I made during last week after installation of Arduino 2.0 IDE (at that time only up to compiling):

1. Of course no problem with the blink sketch. I let red LED on pin 13 flash long - short - short and green LED on pin 8 short - short -short.

2. The SDcard example from your "learn"-homepage doesn't work. Compiling simply ends with "error 13", a -verbose gives not really useful information. The last 3 lines:

Code: Select all | TOGGLE FULL SIZE
Using library SPI at version 1.0 in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.5\libraries\SPI
Using library Adafruit_ZeroDMA at version 1.1.0 in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.5\libraries\Adafruit_ZeroDMA
Compilation error: Error: 13 INTERNAL: exit status 1

Does binding library Adafruit_ZeroDMA comes from SPI-include?

A right click on <SPI.h> of the source code tells me "no definition", also simple parts like delay() seems to be unknown. Crazy, because in the blink sketch delay() works.

no-definition.jpg
no-definition.jpg (48.58 KiB) Viewed 111 times


That error was the reason, why I started this thread and hoped that people at Adafruit made checks of new IDE. May be someone can say something like "It's an absolute desaster".

3. By choosing Feather M0 board there are some examples for M0 Feather boards. I don't have digital pot, but the sketch DigitalPotControl.ino also uses SPI.h - sketch compiles with no error and right click open the header file.

4. Because there is no special SDcard example for M0 feather boards, I choose examples/custom libraries/SDFat/datalogger. Here the IDE can't find definition for "SdFAT.h". Nevertheless sketch was compiled und uploaded, but can't access SDcard. I used chipselect = 4, no questions about pinnumbers for MISO, MOSI, CLK ...

datalogger-nodef.jpg
datalogger-nodef.jpg (30.49 KiB) Viewed 111 times


Bey,
Jürgen

bastler59
 
Posts: 18
Joined: Sun Nov 28, 2021 3:37 pm

Re: general problem with Arduino 2 Beta?

by mikeysklar on Wed Dec 01, 2021 5:56 pm

Jurgen,

Thank you for sharing your Arduino IDE beta experience.

I can probably help you with the SD card compile.

Which example code were you running? This is a recent example:

https://learn.adafruit.com/adafruit-ada ... he-sd-card

Code: Select all | TOGGLE FULL SIZE
#include <SPI.h>
#include <SD.h>

// Set the pins used
#define cardSelect 4

File logfile;

// blink out an error code
void error(uint8_t errno) {
  while(1) {
    uint8_t i;
    for (i=0; i<errno; i++) {
      digitalWrite(13, HIGH);
      delay(100);
      digitalWrite(13, LOW);
      delay(100);
    }
    for (i=errno; i<10; i++) {
      delay(200);
    }
  }
}

// This line is not needed if you have Adafruit SAMD board package 1.6.2+
//   #define Serial SerialUSB

void setup() {
  // connect at 115200 so we can read the GPS fast enough and echo without dropping chars
  // also spit it out
  Serial.begin(115200);
  Serial.println("\r\nAnalog logger test");
  pinMode(13, OUTPUT);


  // see if the card is present and can be initialized:
  if (!SD.begin(cardSelect)) {
    Serial.println("Card init. failed!");
    error(2);
  }
  char filename[15];
  strcpy(filename, "/ANALOG00.TXT");
  for (uint8_t i = 0; i < 100; i++) {
    filename[7] = '0' + i/10;
    filename[8] = '0' + i%10;
    // create if does not exist, do not open existing, write, sync after write
    if (! SD.exists(filename)) {
      break;
    }
  }

  logfile = SD.open(filename, FILE_WRITE);
  if( ! logfile ) {
    Serial.print("Couldnt create ");
    Serial.println(filename);
    error(3);
  }
  Serial.print("Writing to ");
  Serial.println(filename);

  pinMode(13, OUTPUT);
  pinMode(8, OUTPUT);
  Serial.println("Ready!");
}

uint8_t i=0;
void loop() {
  digitalWrite(8, HIGH);
  logfile.print("A0 = "); logfile.println(analogRead(0));
  Serial.print("A0 = "); Serial.println(analogRead(0));
  digitalWrite(8, LOW);
 
  delay(100);
}

mikeysklar
 
Posts: 6498
Joined: Mon Aug 01, 2016 8:10 pm

Re: general problem with Arduino 2 Beta?

by User_UMjT7KxnxP8YN8 on Thu Dec 02, 2021 3:05 am

SdFAT is not the same as SD; it's a third-party library that (at least in the older version I use) is more feature-rich than the standard Arduino SD library. You'll need to install the SdFAT library before using.

User_UMjT7KxnxP8YN8
 
Posts: 284
Joined: Tue Jul 17, 2018 1:28 pm

Re: general problem with Arduino 2 Beta?

by bastler59 on Thu Dec 02, 2021 3:34 am

mikeysklar wrote:I can probably help you with the SD card compile.
Which example code were you running? This is a recent example:
https://learn.adafruit.com/adafruit-adalogger-featherwing/using-the-sd-card

Hi,

thanks. I solved the problem a little bit myself yesterday in the evening.

I have several microSD cards with 512MB. For logging data they are large enough. Windows 10 only tells me, they are FAT formatted. No problem to use them at my computer. Also an ESP32-board recognize them. But Arduino SdFat-library throws an "Invalid format, reformat SD". I tried a 16GB card and this one works.

With chkdsk M: I see, that clustersize is 8kB. Comparing with
https://support.microsoft.com/en-us/topic/default-cluster-size-for-ntfs-fat-and-exfat-9772e6f1-e31a-00d7-e18f-73169155af95
it looks correct.

Each new SD card or USB memory stick I test with H2Testw, a small program writing pattern on a free space and reading those pattern afterwards. So program can detect defects and also fake devices.

So in the moment I don't know, why Arduino don't accept these small SD cards.

Jürgen

bastler59
 
Posts: 18
Joined: Sun Nov 28, 2021 3:37 pm

Re: general problem with Arduino 2 Beta?

by bastler59 on Thu Dec 02, 2021 4:23 am

User_UMjT7KxnxP8YN8 wrote:SdFAT is not the same as SD; it's a third-party library that (at least in the older version I use) is more feature-rich than the standard Arduino SD library. You'll need to install the SdFAT library before using.

Thanks and yes I know.

The curious thing: there is no SD.h on my computer!

2018 I tried out Arduino UNO boards. From this period is also the SdFat-library from Bill Greiman ( I installed it by the library manager). Version 1.0.7 is really outdated now. exFAT was invented 2006, so a library from 2018 should know all formats and clustersizes.

But it leads me to another question: may be Arduino 2.0 IDE only knows for a right click on a header file the path to \AppData\Local\Arduinoxx\packages\...\hardware\...\libraries\ ? Sketches are stored at \documents\Arduino and there is also a folder for user installed libraries. That may be a reason, why I got the message "no definition for SdFat.h" and it is a smaler bug in the beta IDE. Of course compiler knows all pathes.

Where is SD library stored on your computer?

I uninstalled old Arduino IDE before I installed the 2.0 beta. So path on my computer starts with \AppData\Local\Arduino15\packages\. Inside I have a folder adafruit and another arduino. First one continues with \hardware\samd\1.7.5\libraries, arduino folder contains subfolders for different MCUs. I guess, somethere there should be a folder named SD inside a library folder.

After a short seach I find this information in forum.arduino.cc:
The classic Arduino IDE comes with a collection of generally useful libraries pre-installed, one of which is the SD library. For this reason, we are accustomed to having these libraries always available and you will find many instructions and tutorials (including official ones) that make this assumption. At the moment, Arduino IDE 2.x does not come with any libraries pre-installed, so you must install any library you need.

So that's the reason, why I don't have a SD-library.
It sounds like SD is like a wrapper over SdFat. May be using SdFat directly gives me more capabilities to handle a SD card?

Bye
Jürgen

bastler59
 
Posts: 18
Joined: Sun Nov 28, 2021 3:37 pm

Re: general problem with Arduino 2 Beta?

by bastler59 on Thu Dec 02, 2021 4:48 am

Addendum:

I looked around at forum.arduino.cc about Arduino 2.x beta IDE.

Keywords sometimes are red underlined. Normally it should shows you an error in your source code. In the beta IDE it may be a mistake of the IDE, it is marked as "imperfection" in a long issue list at Github.

In my first sketch from learn.adafruit... for the M0 Adalogger-board I used #include <SPI.h> and #include <SD.h> . In between I know, that the cryptic error 13 comes from missing SD.h. I also see in compiler messages such alternatives/resolve/candidates lines:

Alternatives for uTimerLib.h: []
ResolveLibrary(uTimerLib.h)
-> candidates: []


This is the Arduino IDE 2.x's more cryptic version of the "No such file or directory" error you might be familiar with from using the classic Arduino IDE.

bastler59
 
Posts: 18
Joined: Sun Nov 28, 2021 3:37 pm

Please be positive and constructive with your questions and comments.