avandalen / SAM15x15

SAM15x15 board / Arduino Zero package which describes all SAMD21G pins
https://www.avdweb.nl/arduino/samd21/samd21-variant
MIT License
6 stars 6 forks source link

Error #include "sam.h" #3

Closed boseji closed 4 years ago

boseji commented 4 years ago

Hello,

I am developing my own SAMD21 board. Inspired by your work, I wanted to make a custom package. To test my ATSAMD21G18A chip board, I tried to download the package as instructed. https://www.avdweb.nl/arduino/samd21/sam-15x15-installation

My board works with Arduino Zero and I am able test out the following program there:

void setup() {  
  pinMode(LED_BUILTIN, OUTPUT);
  SerialUSB.begin(115200);
  while(!SerialUSB);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  SerialUSB.println(analogRead(0));
  digitalWrite(LED_BUILTIN, LOW);
}

However when I select the SAM 15X15 from the boards menu I get the following error.

Here is the Error Log

/home/user/.arduino15/packages/SAM15x15/hardware/samd/25.12.17/cores/arduino/Arduino.h:48:10: fatal error: sam.h: No such file or directory
 #include "sam.h"
          ^~~~~~~
compilation terminated.
exit status 1
Error compiling for board SAM 15x15.

Not sure whats the problem. I am using the Arduino IDE version 1.8.9.

Please guide me to solve this problem. Thanks,

Regards, @boseji

avandalen commented 4 years ago

I tried again a new installation of the sam15x15 package here with the newest arduiono version, it still works

maybe you have forgotten something?

https://www.avdweb.nl/arduino/samd21/sam-15x15-installation From: Abhijit Bose Sent: Friday, January 24, 2020 3:37 AM To: avandalen/SAM15x15 Cc: Subscribed Subject: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Hello,

I am developing my own SAMD21 board. Inspired by your work, I wanted to make a custom package. To test my ATSAMD21G18A chip board, I tried to download the package as instructed. https://www.avdweb.nl/arduino/samd21/sam-15x15-installation

My board works with Arduino Zero and I am able test out the following program there:

void setup() {
pinMode(LED_BUILTIN, OUTPUT); SerialUSB.begin(115200); while(!SerialUSB); }

void loop() { digitalWrite(LED_BUILTIN, HIGH); SerialUSB.println(analogRead(0)); digitalWrite(LED_BUILTIN, LOW); }However when I select the SAM 15X15 from the boards menu I get the following error.

Here is the Error Log

/home/user/.arduino15/packages/SAM15x15/hardware/samd/25.12.17/cores/arduino/Arduino.h:48:10: fatal error: sam.h: No such file or directory

include "sam.h"

      ^~~~~~~

compilation terminated. exit status 1 Error compiling for board SAM 15x15. Not sure whats the problem. I am using the Arduino IDE version 1.8.9.

Please guide me to solve this problem. Thanks,

Regards, @boseji

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

boseji commented 4 years ago

Thanks, I am doing this on Arch linux may be some compatibility issue. I will check one time in Windows to be sure.

boseji commented 4 years ago

Hello,

I have now tested on Windows 10 with Arduino IDE v1.8.11.

Here is the error repeated:

C:\arduino-1.8.11\arduino-builder -dump-prefs -logger=machine -hardware C:\arduino-1.8.11\hardware -hardware C:\Users\usr\AppData\Local\Arduino15\packages -tools C:\arduino-1.8.11\tools-builder -tools C:\arduino-1.8.11\hardware\tools\avr -tools C:\Users\usr\AppData\Local\Arduino15\packages -built-in-libraries C:\arduino-1.8.11\libraries -libraries C:\Users\usr\Documents\Arduino\libraries -fqbn=SAM15x15:samd:SAM15x15 -ide-version=10811 -build-path C:\tmp\arduino_build_368285 -warnings=all -build-cache C:\tmp\arduino_cache_48449 -prefs=build.warn_data_percentage=75 -verbose C:\arduino-1.8.11\examples\01.Basics\Blink\Blink.ino
C:\arduino-1.8.11\arduino-builder -compile -logger=machine -hardware C:\arduino-1.8.11\hardware -hardware C:\Users\usr\AppData\Local\Arduino15\packages -tools C:\arduino-1.8.11\tools-builder -tools C:\arduino-1.8.11\hardware\tools\avr -tools C:\Users\usr\AppData\Local\Arduino15\packages -built-in-libraries C:\arduino-1.8.11\libraries -libraries C:\Users\usr\Documents\Arduino\libraries -fqbn=SAM15x15:samd:SAM15x15 -ide-version=10811 -build-path C:\tmp\arduino_build_368285 -warnings=all -build-cache C:\tmp\arduino_cache_48449 -prefs=build.warn_data_percentage=75 -verbose C:\arduino-1.8.11\examples\01.Basics\Blink\Blink.ino
Using board 'SAM15x15' from platform in folder: C:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17
Using core 'arduino' from platform in folder: C:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17
Detecting libraries used...
"C:\\Users\\usr\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10811 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" "-IC:\\Users\\usr\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\CMSIS\\4.5.0/CMSIS/Include/" "-IC:\\Users\\usr\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\CMSIS\\4.5.0/Device/ATMEL/" "-IC:\\Users\\usr\\AppData\\Local\\Arduino15\\packages\\SAM15x15\\hardware\\samd\\25.12.17\\cores\\arduino" "-IC:\\Users\\usr\\AppData\\Local\\Arduino15\\packages\\SAM15x15\\hardware\\samd\\25.12.17\\variants\\arduino_zero" "C:\\tmp\\arduino_build_368285\\sketch\\Blink.ino.cpp" -o nul
Alternatives for sam.h: []
ResolveLibrary(sam.h)In file included from C:\tmp\arduino_build_368285\sketch\Blink.ino.cpp:1:0:

  -> candidates: []
C:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17\cores\arduino/Arduino.h:48:10: fatal error: sam.h: No such file or directory

 #include "sam.h"

          ^~~~~~~

compilation terminated.

exit status 1
Error compiling for board SAM 15x15.

This time I used the blinky sketch.

Please look into this.

Regards, @boseji

avandalen commented 4 years ago

can you try first, just with the arduino zero installation?

From: Abhijit Bose Sent: Wednesday, January 29, 2020 4:19 AM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Hello,

I have now tested on Windows 10 with Arduino IDE v1.8.11.

Here is the error repeated:

C:\arduino-1.8.11\arduino-builder -dump-prefs -logger=machine -hardware C:\arduino-1.8.11\hardware -hardware C:\Users\usr\AppData\Local\Arduino15\packages -tools C:\arduino-1.8.11\tools-builder -tools C:\arduino-1.8.11\hardware\tools\avr -tools C:\Users\usr\AppData\Local\Arduino15\packages -built-in-libraries C:\arduino-1.8.11\libraries -libraries C:\Users\usr\Documents\Arduino\libraries -fqbn=SAM15x15:samd:SAM15x15 -ide-version=10811 -build-path C:\tmp\arduino_build_368285 -warnings=all -build-cache C:\tmp\arduino_cache_48449 -prefs=build.warn_data_percentage=75 -verbose C:\arduino-1.8.11\examples\01.Basics\Blink\Blink.ino C:\arduino-1.8.11\arduino-builder -compile -logger=machine -hardware C:\arduino-1.8.11\hardware -hardware C:\Users\usr\AppData\Local\Arduino15\packages -tools C:\arduino-1.8.11\tools-builder -tools C:\arduino-1.8.11\hardware\tools\avr -tools C:\Users\usr\AppData\Local\Arduino15\packages -built-in-libraries C:\arduino-1.8.11\libraries -libraries C:\Users\usr\Documents\Arduino\libraries -fqbn=SAM15x15:samd:SAM15x15 -ide-version=10811 -build-path C:\tmp\arduino_build_368285 -warnings=all -build-cache C:\tmp\arduino_cache_48449 -prefs=build.warn_data_percentage=75 -verbose C:\arduino-1.8.11\examples\01.Basics\Blink\Blink.ino Using board 'SAM15x15' from platform in folder: C:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17 Using core 'arduino' from platform in folder: C:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17 Detecting libraries used... "C:\Users\usr\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10811 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -DSAMD21G18A -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" "-IC:\Users\usr\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\usr\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/Device/ATMEL/" "-IC:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17\cores\arduino" "-IC:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17\variants\arduino_zero" "C:\tmp\arduino_build_368285\sketch\Blink.ino.cpp" -o nul Alternatives for sam.h: [] ResolveLibrary(sam.h)In file included from C:\tmp\arduino_build_368285\sketch\Blink.ino.cpp:1:0:

-> candidates: [] C:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17\cores\arduino/Arduino.h:48:10: fatal error: sam.h: No such file or directory

include "sam.h"

      ^~~~~~~

compilation terminated.

exit status 1 Error compiling for board SAM 15x15. This time I used the blinky sketch.

Please look into this.

Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

avandalen commented 4 years ago

Dear Abhijit,

I changed the article: Can you try the Mattairtech SAMD21 package installation: https://www.avdweb.nl/arduino/samd21/sam-15x15-installation

Can you tell me the result?

From: Abhijit Bose Sent: Wednesday, January 29, 2020 4:19 AM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Hello,

I have now tested on Windows 10 with Arduino IDE v1.8.11.

Here is the error repeated:

C:\arduino-1.8.11\arduino-builder -dump-prefs -logger=machine -hardware C:\arduino-1.8.11\hardware -hardware C:\Users\usr\AppData\Local\Arduino15\packages -tools C:\arduino-1.8.11\tools-builder -tools C:\arduino-1.8.11\hardware\tools\avr -tools C:\Users\usr\AppData\Local\Arduino15\packages -built-in-libraries C:\arduino-1.8.11\libraries -libraries C:\Users\usr\Documents\Arduino\libraries -fqbn=SAM15x15:samd:SAM15x15 -ide-version=10811 -build-path C:\tmp\arduino_build_368285 -warnings=all -build-cache C:\tmp\arduino_cache_48449 -prefs=build.warn_data_percentage=75 -verbose C:\arduino-1.8.11\examples\01.Basics\Blink\Blink.ino C:\arduino-1.8.11\arduino-builder -compile -logger=machine -hardware C:\arduino-1.8.11\hardware -hardware C:\Users\usr\AppData\Local\Arduino15\packages -tools C:\arduino-1.8.11\tools-builder -tools C:\arduino-1.8.11\hardware\tools\avr -tools C:\Users\usr\AppData\Local\Arduino15\packages -built-in-libraries C:\arduino-1.8.11\libraries -libraries C:\Users\usr\Documents\Arduino\libraries -fqbn=SAM15x15:samd:SAM15x15 -ide-version=10811 -build-path C:\tmp\arduino_build_368285 -warnings=all -build-cache C:\tmp\arduino_cache_48449 -prefs=build.warn_data_percentage=75 -verbose C:\arduino-1.8.11\examples\01.Basics\Blink\Blink.ino Using board 'SAM15x15' from platform in folder: C:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17 Using core 'arduino' from platform in folder: C:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17 Detecting libraries used... "C:\Users\usr\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10811 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -DSAMD21G18A -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" "-IC:\Users\usr\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\usr\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/Device/ATMEL/" "-IC:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17\cores\arduino" "-IC:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17\variants\arduino_zero" "C:\tmp\arduino_build_368285\sketch\Blink.ino.cpp" -o nul Alternatives for sam.h: [] ResolveLibrary(sam.h)In file included from C:\tmp\arduino_build_368285\sketch\Blink.ino.cpp:1:0:

-> candidates: [] C:\Users\usr\AppData\Local\Arduino15\packages\SAM15x15\hardware\samd\25.12.17\cores\arduino/Arduino.h:48:10: fatal error: sam.h: No such file or directory

include "sam.h"

      ^~~~~~~

compilation terminated.

exit status 1 Error compiling for board SAM 15x15. This time I used the blinky sketch.

Please look into this.

Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

boseji commented 4 years ago

Hello,

For the standard Arduino Zero (Programming Port) there is no problem. I had the board so tested the programming also. It works fine.

I have tried the Mattair Tech version. It works flawless both in linux and windows. https://www.mattairtech.com/software/arduino/package_MattairTech_index.json

Thank you for your guidance.

I will inherit the design of the package from MattairTech. However I like your 15x15 board better. Its simpler and easy to understand. I have also built a few SAMD21G18A boards on my end. Will try to test out and prepare a simpler package. Till then,

Thanks and Wish you all the Success,

Regards, @boseji

avandalen commented 4 years ago

Thank you for your help I dont understand why my package didnt work, but anyway the MattairTech package works fine. I will try the MattairTech package myself too. In the future, I want to change the SAM15x15 board and use the SAMD51 which is much faster. I can use the MattairTech also I hope.

It is easier to use just the MattairTech package , why do you need another package?

From: Abhijit Bose Sent: Wednesday, January 29, 2020 4:40 PM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Hello,

For the standard Arduino Zero (Programming Port) there is no problem. I had the board so tested the programming also. It works fine.

I have tried the Mattair Tech version. It works flawless both in linux and windows. https://www.mattairtech.com/software/arduino/package_MattairTech_index.json

Thank you for your guidance.

I will inherit the design of the package from MattairTech. However I like your 15x15 board better. Its simpler and easy to understand. I have also built a few SAMD21G18A boards on my end. Will try to test out and prepare a simpler package. Till then,

Thanks and Wish you all the Success,

Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

boseji commented 4 years ago

Hi,

I would like to have the arrangement you had in the 15x15 board I/O definition. Firstly the Array like callable port configuration. Second like in STM32 Arduino port and pins named. Hence I need to create my on variant. Might not be a full fledged unit like MattairTech. But more like something that can be added to the existing SAMD installation.

Regards, @boseji

avandalen commented 4 years ago

I will look at it tomorrow..

From: Abhijit Bose Sent: Thursday, January 30, 2020 4:45 PM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Hi,

I would like to have the arrangement you had in the 15x15 board I/O definition. Firstly the Array like callable port configuration. Second like in STM32 Arduino port and pins named. Hence I need to create my on variant. Might not be a full fledged unit like MattairTech. But more like something that can be added to the existing SAMD installation.

Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

avandalen commented 4 years ago

Hi Abhijit,

I dont think you need a separate package.

See here: https://www.avdweb.nl/arduino/samd21/sam-15x15-installation It is no longer necessary to install the SAM15x15 package because the Arduino Zero package has been extended to 34 I / O pins.

Can you help me with the pin order? I think that all de pin all pin functions still work (PWM, interrups etc. etc) but I have no time to check this.

Kind regards

Albert

From: Abhijit Bose Sent: Thursday, January 30, 2020 4:45 PM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Hi,

I would like to have the arrangement you had in the 15x15 board I/O definition. Firstly the Array like callable port configuration. Second like in STM32 Arduino port and pins named. Hence I need to create my on variant. Might not be a full fledged unit like MattairTech. But more like something that can be added to the existing SAMD installation.

Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

boseji commented 4 years ago

Hello,

Sure will do that. I am also looking into a Arduino M0 variant its different from Arduino Zero. It has more pins but different configuration.

In case of 15X15 one needs to configure all pins except USB and Oscillator. Also I am trying make sense of how the attributes in the array work.

I will share my findings.

Regards, @boseji

boseji commented 4 years ago

Hello,

Its going to take a bit longer. The new system requires us to properly manage the tagging of Analog IN/OUT pins. Additionally there is interesting piece with PWM signal. I am mapping your 15X15 linearly. Like the one for 34 IO pins. Possibly as we find time I can try to have various size variants. This also means that your I/O diagram might need small change. I will try to keep all the pin block as aligned as possible. Due to in between GNDA and VDDA pins its becoming difficult. Aligning analog pins would help to remove the Hack in Wanalog.h. Lets see. My board though is now fully functional, thanks to your help.

Keep you posted on updates.

Regards, @boseji

avandalen commented 4 years ago

I don't quite understand it, can't we just use the Arduino Uno package and then include this: (wrong values) static const int d[]={ 14, 27, 15, 16, 17, 18, 8, 9, 4, 3, 1, 0, 23, 24, 22, 28, 2, 5, 11, 13, 10, 12, 6, 7, 20, 21, 29, 30, 26, 31, 32, 33, 19, 25 }; static const int pinCount = 34;

boseji commented 4 years ago

Hi,

Let me explain you the new variant model. This model is also followed by MattairTech and Adafruit boards.

Variants have 3 major parts:

  1. Global Pin config definition
  2. Peripheral Definitions - SPI, I2C etc.
  3. Board specific definitions

Among the above three our variant definition partially complies to all the above. This this is just an upgrade. But due to change in the wiring framework (for Arduino SAMD specific) things have become complicated.

Here are few of my observations:

  1. Digital pins need to have default and alternate configurations for alternate uses. Example USB, I2C etc.
  2. Analog pins should always be defined in sequence
  3. SPI and I2C definitions need to be always in COM mode with the respective SERCOM
  4. In case of Analog Output, there needs to be 2 separate definitions
  5. PWM pins need to carefully set timer and channel outputs. In case alternates are used the same needs to correctly defined.

Keeping in mind all this we need to first fix the varient definition of 15X15 board. Then update the d[] array to correct pin configurations even alternate ones. If we don't do this some times the arduino firmware crashes. Even though you fine there is no apparent compilation errors. This had baffled my board for nearly two months. Before I started to look out for forums and boards.

We will fix this slowly and accurately to have full compatibility to Arduino SAMD core v1.8.4

Hope that this explains why this would take some more time. The definitions from MattairTech are very advanced. Possibly also have a look at : https://github.com/adafruit/ArduinoCore-samd I have taken some parts of both to make my boards work.

Regards, @boseji

avandalen commented 4 years ago

can't we simply use the MattairTech package instead of the SAM15x15 package? That saves time and we don't have to worry about anything.

Note that the following text is on my website: My SAM15x15 was one of the first SAMD21 boards that uses all pins. At that time, there was no complete SAMD21 package available, so I made the SAM15x15 package myself as an extension to the Zero package. But now, it is no longer necessary to install the SAM15x15 package because the Arduino Zero package has been extended to 34 I/O pins.

From: Abhijit Bose Sent: Wednesday, February 12, 2020 5:41 AM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Hi,

Let me explain you the new variant model. This model is also followed by MattairTech and Adafruit boards.

Variants have 3 major parts:

1.. Global Pin config definition 2.. Peripheral Definitions - SPI, I2C etc. 3.. Board specific definitions Among the above three our variant definition partially complies to all the above. This this is just an upgrade. But due to change in the wiring framework (for Arduino SAMD specific) things have become complicated.

Here are few of my observations:

1.. Digital pins need to have default and alternate configurations for alternate uses. Example USB, I2C etc. 2.. Analog pins should always be defined in sequence 3.. SPI and I2C definitions need to be always in COM mode with the respective SERCOM 4.. In case of Analog Output, there needs to be 2 separate definitions 5.. PWM pins need to carefully set timer and channel outputs. In case alternates are used the same needs to correctly defined. Keeping in mind all this we need to first fix the varient definition of 15X15 board. Then update the d[] array to correct pin configurations even alternate ones. If we don't do this some times the arduino firmware crashes. Even though you fine there is no apparent compilation errors. This had baffled my board for nearly two months. Before I started to look out for forums and boards.

We will fix this slowly and accurately to have full compatibility to Arduino SAMD core v1.8.4

Hope that this explains why this would take some more time. The definitions from MattairTech are very advanced. Possibly also have a look at : https://github.com/adafruit/ArduinoCore-samd I have taken some parts of both to make my boards work.

Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

boseji commented 4 years ago

Hi,

You are right in assuming about the Arduino Zero and Arduino Zero-M boards. That was my mistake too. The important distinction here is the pin arrangement and property allocation. To give you an example lets look at Analog Output and Analog Input spec. Here is a snippet from the wiring_analog.c:

void analogWrite(uint32_t pin, uint32_t value)
{
  PinDescription pinDesc = g_APinDescription[pin];
  uint32_t attr = pinDesc.ulPinAttribute;

  if ((attr & PIN_ATTR_ANALOG) == PIN_ATTR_ANALOG)
  {
    // DAC handling code

    if ((pinDesc.ulADCChannelNumber != ADC_Channel0) && (pinDesc.ulADCChannelNumber != DAC_Channel0)) { // Only 1 DAC on AIN0 / PA02
      return;
    }

    value = mapResolution(value, _writeResolution, 10);

    syncDAC();
    DAC->DATA.reg = value & 0x3FF;  // DAC on 10 bits.
    syncDAC();
    DAC->CTRLA.bit.ENABLE = 0x01;     // Enable DAC
    syncDAC();
    return;
  }

  if ((attr & PIN_ATTR_PWM) == PIN_ATTR_PWM)
  {
    value = mapResolution(value, _writeResolution, 16);
...

You can see that based on particular PIN_ATTR the actual function of pin is selected. If all analog pins are defined with this then it would cause crash.

Now lets look at another selectivity in Analog Read Specifically at pinPeripheral function invocation.

PA02 is both Analog Input and Analog output. Then configuration for this must be different. By design when the pin is connected to ADC it can't be configured as DAC out. This is determined by the PinDescription

So you are right to say that all 34 pins have been defined.

However if we carefully look at Initialization code used: https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/wiring.c#L85 If we don't have the correct configuration in sequence for NUM_DIGITAL_PINS would not work correctly. Means pins would be in arbitrary state. Hence the need to separate configurations.

Like the SAM 15x15 board, my board has all pins exposed. So, I had to defined 44 pins even though actually there are only 40 pins. In my case I have removed the USB pins and Crystal pins. However they are defined at the end of the end of PinDescription.

Here is how the arrangement looks like:

/**
 * # mcu-jugaad SAMD21G V1 Board:
 * 
 *  Actual Board Pin Out -
 *              
 *          S       P  O                                            O  P      S
 *          E       I  P  P            +----------+             P   P  I      E
 *          R       N  E  W M          |          |           M W   E  N      R
 *          C          R  M O          |          |           O M   R         C
 *          O       N  -    D          |          |           D     -  N      O
 *          M       A  A  S E          |  USB-A   |           E S   A  A      M
 *                  M  L  U S     +--------------------+      S U   L  M
 *                  E  T  P       |     SerialUSB      |        P   T  E
 *                         PWR  1 |RAW   (Serial)   VCC| 40 PWR
 *                                |                    |
 *                         PWR  2 |VCC             PA23| 39 I2C ~ DIO SCL  SER3
 *                                |                    |                  (I2C)
 *                         RST  3 |NRST            PA22| 38 I2C ~ DIO SDA  SER3
 *                                |                    |                  (I2C)
 *          SER5   TX DIO  SER  4 |PB22            PA21| 37 PWM ~ DIO
 *          (Serial0)             |                    |
 *          SER5   RX DIO  SER  5 |PB23            PA20| 36 PWM ~ DIO
 *          (Serial0)             |                    |
 *                         DIO  6 |PA27            PA19| 35 SPI ~ DIO MISO SER1
 *                                |                    |                 (SPI1)
 *                         DIO  7 |PA28            PA18| 34 SPI ~ DIO SS   SER1
 *                                |                    |                 (SPI1)
 *                         DIO  8 |PA30(SWCLK)     PA17| 33 SPI ~ DIO SCK  SER1
 *                                |                    |                 (SPI1)
 *                         DIO  9 |PA31(SWDIO)     PA16| 32 SPI ~ DIO MOSI SER1
 *                                |                    |                 (SPI1)
 *          AN10      DIO   AN 10 |PB02            PA15| 31 SPI ~ DIO MISO SER2
 *                                |                    |                  (SPI)
 *          AN11      DIO   AN 11 |PB03            PA14| 30 SPI ~ DIO SS   SER2
 *                                |                    |                  (SPI)
 *           AN0      DIO   AN 12 |PA02            PA13| 29 SPI ~ DIO SCK  SER2
 *                         DAC    |                    |                  (SPI) 
 *         AN1/VREFA  DIO   AN 13 |PA03            PA12| 28 SPI ~ DIO MOSI SER2
 *                         AREF   |                    |                  (SPI)
 *           AN2      DIO ~ AN 14 |PB08            PB11| 27 SER ~ DIO RX   SER4
 *                                |                    |               (Serial1)
 *           AN3      DIO ~ AN 15 |PB09            PB10| 26 SER ~ DIO TX   SER4
 *                                |                    |               (Serial1)
 *           AN4      DIO ~ AN 16 |PA04       (Led)PA11| 25 PWM ~ DIO      AN19
 *                                |                    | I2S_FS
 *           AN5      DIO ~ AN 17 |PA05       (Btn)PA10| 24 PWM ~ DIO      AN18
 *                                |                    | I2S_SCK
 *           AN6      DIO ~ AN 18 |PA06            PA09| 23 PWM ~ DIO      AN17
 *                                |                    | I2S_MCK
 *           AN7      DIO ~ AN 19 |PA07       (NMI)PA08| 22 PWM ~ DIO      AN16
 *                        I2S_SD  |                    | 
 *                         PWR 20 |GND              GND| 21 PWR
 *                                |                    |
 *                                +--------------------+
 * 
 * ## NO USB HOST Possible
 * ## Default Analog Referece AVDD / 2 = 1.65V (Internal)
 * ## Analog Input Scaled DIV/2 so 3.3V Max Input Possible
 * ## Discontinuous Channels A10 - A13
 * ## Analog Channels - A0-A9 In Order 
 */

Now we look at Mattairtech Xeno_mini (Since that's the only one with SAMD21G18A) https://github.com/mattairtech/ArduinoCore-samd/blob/master/variants/Xeno_Mini/variant.cpp Just remove the alternate chip configs. They have exactly 35 pins. Since they use custom attribute configuration. Additionally there is PIO_MULTI so the complete pinPeripheral function is different than the original Arduino SAMD architecture.

This means as the Arduino SAMD develops independent of MattairTech. Its only if MattairTech upgrades those changes we would get our boards working with framework compatibility. This is something I wish to avoid. Since we are now dependent on single point. Its best to be in the stream where updates are insured. Its kind of my own opinion. You can take a call with this understanding.

My approach to solving this problem is to keep a diff. Means we keep a patch type file. When the new Arduino SAMD core is released - we can copy this patch. That would incorporate our board into the framework. This approach might not be agreeable to you. I can understand.

I have taken this approach since I can always merge branch changes in Git. I keep the remote in git called theirs. This is the Original: https://github.com/arduino/ArduinoCore-samd/tree/master/cores/arduino In my own repo I keep my Patch file. When I need to add my board, this is what I plan to do:

  1. Pull all their branch
  2. Merge with origin:master
  3. Merge my origin:patch branch to origin:master That way I get conflicts or some places where git needs my help. Apart from that I get a fresh copy of the Original Arduino SAMD with my board integrated. Add this to the arduino15 or use the hardware directory of Arduino. And we have workable solution.

This is my process. Its inherited from Sparkfun and Adafruit repositories. At least that's what I assume they might have done.

Let me know your views on this.

Regards, @boseji

avandalen commented 4 years ago

Hi

Im going to find out a simple solution for the SAM15x15

kind regards

albert

From: Abhijit Bose Sent: Wednesday, February 12, 2020 11:25 AM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Hi,

You are right in assuming about the Arduino Zero and Arduino Zero-M boards. That was my mistake too. The important distinction here is the pin arrangement and property allocation. To give you an example lets look at Analog Output and Analog Input spec. Here is a snippet from the wiring_analog.c:

void analogWrite(uint32_t pin, uint32_t value) { PinDescription pinDesc = g_APinDescription[pin]; uint32_t attr = pinDesc.ulPinAttribute;

if ((attr & PIN_ATTR_ANALOG) == PIN_ATTR_ANALOG) { // DAC handling code

if ((pinDesc.ulADCChannelNumber != ADC_Channel0) && (pinDesc.ulADCChannelNumber != DAC_Channel0)) { // Only 1 DAC on AIN0 / PA02
  return;
}

value = mapResolution(value, _writeResolution, 10);

syncDAC();
DAC->DATA.reg = value & 0x3FF;  // DAC on 10 bits.
syncDAC();
DAC->CTRLA.bit.ENABLE = 0x01;     // Enable DAC
syncDAC();
return;

}

if ((attr & PIN_ATTR_PWM) == PIN_ATTR_PWM) { value = mapResolution(value, _writeResolution, 16); ...You can see that based on particular PIN_ATTR the actual function of pin is selected. If all analog pins are defined with this then it would cause crash.

Now lets look at another selectivity in Analog Read Specifically at pinPeripheral function invocation.

PA02 is both Analog Input and Analog output. Then configuration for this must be different. By design when the pin is connected to ADC it can't be configured as DAC out. This is determined by the PinDescription

So you are right to say that all 34 pins have been defined.

However if we carefully look at Initialization code used: https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/wiring.c#L85 If we don't have the correct configuration in sequence for NUM_DIGITAL_PINS would not work correctly. Means pins would be in arbitrary state. Hence the need to separate configurations.

Like the SAM 15x15 board, my board has all pins exposed. So, I had to defined 44 pins even though actually there are only 40 pins. In my case I have removed the USB pins and Crystal pins. However they are defined at the end of the end of PinDescription.

Here is how the arrangement looks like:

/**

This means as the Arduino SAMD develops independent of MattairTech. Its only if MattairTech upgrades those changes we would get our boards working with framework compatibility. This is something I wish to avoid. Since we are now dependent on single point. Its best to be in the stream where updates are insured. Its kind of my own opinion. You can take a call with this understanding.

My approach to solving this problem is to keep a diff. Means we keep a patch type file. When the new Arduino SAMD core is released - we can copy this patch. That would incorporate our board into the framework. This approach might not be agreeable to you. I can understand.

I have taken this approach since I can always merge branch changes in Git. I keep the remote in git called theirs. This is the Original: https://github.com/arduino/ArduinoCore-samd/tree/master/cores/arduino In my own repo I keep my Patch file. When I need to add my board, this is what I plan to do:

1.. Pull all their branch 2.. Merge with origin:master 3.. Merge my origin:patch branch to origin:master That way I get conflicts or some places where git needs my help. Apart from that I get a fresh copy of the Original Arduino SAMD with my board integrated. Add this to the arduino15 or use the hardware directory of Arduino. And we have workable solution. This is my process. Its inherited from Sparkfun and Adafruit repositories. At least that's what I assume they might have done.

Let me know your views on this.

Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

boseji commented 4 years ago

Sure, I look forward to your solution.

Warm Regards, @boseji

avandalen commented 4 years ago

Hi

I have done a clear instalatlion of Arduino on my Windows10 PC, the SAM15x15 installation procedure still works fine.

I have tried packages for the SAMD21G18 from others but without success

Arduino Zero: no I/O on pin 37, 38

MattairTech Xeno Mini: 2, 3 etc. doesn’t work, I don’t understand this

Now Im using the sam15x15 package again.

I received the error message: "fatal error: sam.h: No such file or directory" after I also installed also other packages. The solution is: Select Tools> Boards "..."> Boards Manager ... remove the package "Arduino SAMD Boards (32-bit ARM Cortex-M0 +)", and install it again.

From: Abhijit Bose Sent: Wednesday, February 12, 2020 11:25 AM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Hi,

You are right in assuming about the Arduino Zero and Arduino Zero-M boards. That was my mistake too. The important distinction here is the pin arrangement and property allocation. To give you an example lets look at Analog Output and Analog Input spec. Here is a snippet from the wiring_analog.c:

void analogWrite(uint32_t pin, uint32_t value) { PinDescription pinDesc = g_APinDescription[pin]; uint32_t attr = pinDesc.ulPinAttribute;

if ((attr & PIN_ATTR_ANALOG) == PIN_ATTR_ANALOG) { // DAC handling code

if ((pinDesc.ulADCChannelNumber != ADC_Channel0) && (pinDesc.ulADCChannelNumber != DAC_Channel0)) { // Only 1 DAC on AIN0 / PA02
  return;
}

value = mapResolution(value, _writeResolution, 10);

syncDAC();
DAC->DATA.reg = value & 0x3FF;  // DAC on 10 bits.
syncDAC();
DAC->CTRLA.bit.ENABLE = 0x01;     // Enable DAC
syncDAC();
return;

}

if ((attr & PIN_ATTR_PWM) == PIN_ATTR_PWM) { value = mapResolution(value, _writeResolution, 16); ...You can see that based on particular PIN_ATTR the actual function of pin is selected. If all analog pins are defined with this then it would cause crash.

Now lets look at another selectivity in Analog Read Specifically at pinPeripheral function invocation.

PA02 is both Analog Input and Analog output. Then configuration for this must be different. By design when the pin is connected to ADC it can't be configured as DAC out. This is determined by the PinDescription

So you are right to say that all 34 pins have been defined.

However if we carefully look at Initialization code used: https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/wiring.c#L85 If we don't have the correct configuration in sequence for NUM_DIGITAL_PINS would not work correctly. Means pins would be in arbitrary state. Hence the need to separate configurations.

Like the SAM 15x15 board, my board has all pins exposed. So, I had to defined 44 pins even though actually there are only 40 pins. In my case I have removed the USB pins and Crystal pins. However they are defined at the end of the end of PinDescription.

Here is how the arrangement looks like:

/**

This means as the Arduino SAMD develops independent of MattairTech. Its only if MattairTech upgrades those changes we would get our boards working with framework compatibility. This is something I wish to avoid. Since we are now dependent on single point. Its best to be in the stream where updates are insured. Its kind of my own opinion. You can take a call with this understanding.

My approach to solving this problem is to keep a diff. Means we keep a patch type file. When the new Arduino SAMD core is released - we can copy this patch. That would incorporate our board into the framework. This approach might not be agreeable to you. I can understand.

I have taken this approach since I can always merge branch changes in Git. I keep the remote in git called theirs. This is the Original: https://github.com/arduino/ArduinoCore-samd/tree/master/cores/arduino In my own repo I keep my Patch file. When I need to add my board, this is what I plan to do:

1.. Pull all their branch 2.. Merge with origin:master 3.. Merge my origin:patch branch to origin:master That way I get conflicts or some places where git needs my help. Apart from that I get a fresh copy of the Original Arduino SAMD with my board integrated. Add this to the arduino15 or use the hardware directory of Arduino. And we have workable solution. This is my process. Its inherited from Sparkfun and Adafruit repositories. At least that's what I assume they might have done.

Let me know your views on this.

Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

avandalen commented 4 years ago

Hi

Do you have any news about your work at the package?

Kind regards,

Albert

boseji commented 4 years ago

Hi,

I have worked on the patch like file. It works with standard Arduino installation having Samd support installed.

However with the changes to https://github.com/arduino/ArduinoCore-samd/ have disabled them in latest version.

I plan to test out the patch system if it works with the latest 1.8.6 and upload it to my repository. Here is the directory patch for your inspection. samd.zip This needs to be placed in the arduino15 directory tree where SAMD package is installed.

Let me know your feedback.

Stay safe and take care,

Warm Regards, @boseji

avandalen commented 4 years ago

Dear Abhijit, Is it possible to integrate your work in https://github.com/arduino/ArduinoCore-samd? What do you think of that? Then no patch is needed anymore (I think) I want to upgrade my SAM15x15 PCB with the SAMD21 to the SAMD51, which is a faster processor. That is also interesting for you. Could you make a package for the ATSAMD21G18? I am also willing to pay for that. Stay healthy,

I am busy making a revolutionary new face mask for Corona

Albert

boseji commented 4 years ago

Dear Albert,

Great, nice to know about your efforts on Corona. My Ender-3pro is currently out of commission due to nozzle and calibration issues.

Yes I can integrate the package and publish the same. It takes some time to complete my physical test suit. I would need your inputs to create a similar thing for SAM15X15. Though I don't have a SAM15x15 or anyway to get one - I can send you the test suit to check at your side also.

Good idea to upgrade the SAM15X15 package also. Since lot of changed in v1.8.6 of SAMD core and new version of Arduino. I am still fixing my own patch implementation.

Sure, I would love some sponsoring of the Open-source contribution. In this time of need, it would great help.

Here are options for contributing:

The way I can contribute is - in form of a pull request to this repo. Then we have 2 separate code bases to keep updating whenever Arduino SAMD releases. This is bit cumbersome. OR We can create a common location for code base where both your board and mine can be supported. Most probably future boards can also be supported - your SAMD51.

Let me know your thoughts.

Kind Regards, @boseji

avandalen commented 4 years ago

Dear Abhijit

I come back soon..

albert

From: Abhijit Bose Sent: Wednesday, May 6, 2020 3:34 PM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Dear Albert,

Great, nice to know about your efforts on Corona. My Ender-3pro is currently out of commission due to nozzle and calibration issues.

Yes I can integrate the package and publish the same. It takes some time to complete my physical test suit. I would need your inputs to create a similar thing for SAM15X15. Though I don't have a SAM15x15 or anyway to get one - I can send you the test suit to check at your side also.

Good idea to upgrade the SAM15X15 package also. Since lot of changed in v1.8.6 of SAMD core and new version of Arduino. I am still fixing my own patch implementation.

Sure, I would love some sponsoring of the Open-source contribution. In this time of need, it would great help.

Here are options for contributing:

The way I can contribute is - in form of a pull request to this repo. Then we have 2 separate code bases to keep updating whenever Arduino SAMD releases. This is bit cumbersome. OR We can create a common location for code base where both your board and mine can be supported. Most probably future boards can also be supported - your SAMD51.

Let me know your thoughts.

Kind Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

avandalen commented 4 years ago

Dear Abhijit

What do you think of expanding the arduino zero package on GitHub here? https://github.com/arduino/ArduinoCore-samd When this is not possible I prefer a common location. If you want I can sent you a SAM15x15 with the D21 and D51. I can also give you the PCBs for this: https://www.avdweb.nl/arduino/samd21/test-fixture have a nice day Albert From: Abhijit Bose Sent: Wednesday, May 6, 2020 3:34 PM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Dear Albert,

Great, nice to know about your efforts on Corona. My Ender-3pro is currently out of commission due to nozzle and calibration issues.

Yes I can integrate the package and publish the same. It takes some time to complete my physical test suit. I would need your inputs to create a similar thing for SAM15X15. Though I don't have a SAM15x15 or anyway to get one - I can send you the test suit to check at your side also.

Good idea to upgrade the SAM15X15 package also. Since lot of changed in v1.8.6 of SAMD core and new version of Arduino. I am still fixing my own patch implementation.

Sure, I would love some sponsoring of the Open-source contribution. In this time of need, it would great help.

Here are options for contributing:

The way I can contribute is - in form of a pull request to this repo. Then we have 2 separate code bases to keep updating whenever Arduino SAMD releases. This is bit cumbersome. OR We can create a common location for code base where both your board and mine can be supported. Most probably future boards can also be supported - your SAMD51.

Let me know your thoughts.

Kind Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

boseji commented 4 years ago

Dear Albert,

Thanks for the update.

Arduino Org owns the https://github.com/arduino/ArduinoCore-samd repository.

They don't Allow others to push variants into the SAMD.

This is the reason other folks have created their own repository:

I personally like the Sparkfun's approach. It works best since we can host both json file as well as the package. In the same place as the code.

Your Test fixture is great. Though due to COVID lockdown we might not be able to get the things here. My suggestion is if you can try out the implementation on your end. I can test to some extent using my board. Hope this can work at the moment. Once lockdown is lifted we can get one set of your boards. In future I can support your boards better.

I can use the following Image: https://www.avdweb.nl/Article_files/Arduino/SAM-D21/SAM15x15/Pins.jpg For your board. If you can share the TX/RX pins it would complete the picture.

a) First step would be to pull out the variant from your original work. Then update with respect to the latest changes. From SAMD core.

b) Create a package that can be tested at your end and same on my side. I can iteratively fix bugs and create a stable package that can be tested in your test jig.

c) After completing our testing, we can begin actual deployment. I would provide a pull request to your https://github.com/avandalen/SAM15x15 Repository. That way your original users would not face any issues in upgrading to the latest version. Later we can decide where to keep the common code.

Hope this would help us get to a workable solution fast. I will begin the patching today.

Let me know your thoughts on this.

Kind Regards, @boseji

avandalen commented 4 years ago

Dear Abijit

Maybe I dont need my own package for the SAM15x15 (with the ATSAMD51G19A-MUT )

There are several SAMD51 boards on the market. To keep it simple, I want to use the installation package of one of these boards, instead of creating my own package. For instance, the Adafruit ItsyBitsy M4 Express uses all pins of the SAMD51. Maybe I can simply use that package. But I don’t know if all the pins are implemented in the package well. What do you think?

You can maybe use that approach also for your processor.

Where do you live?

Kind regards,

Albert

From: Abhijit Bose Sent: Sunday, May 10, 2020 4:03 PM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Dear Albert,

Thanks for the update.

Arduino Org owns the https://github.com/arduino/ArduinoCore-samd repository.

They don't Allow others to push variants into the SAMD.

This is the reason other folks have created their own repository:

a.. https://github.com/adafruit/ArduinoCore-samd b.. https://github.com/sparkfun/Arduino_Boards I personally like the Sparkfun's approach. It works best since we can host both json file as well as the package. In the same place as the code.

Your Test fixture is great. Though due to COVID lockdown we might not be able to get the things here. My suggestion is if you can try out the implementation on your end. I can test to some extent using my board. Hope this can work at the moment. Once lockdown is lifted we can get one set of your boards. In future I can support your boards better.

I can use the following Image: https://www.avdweb.nl/Article_files/Arduino/SAM-D21/SAM15x15/Pins.jpg For your board. If you can share the TX/RX pins it would complete the picture.

a) First step would be to pull out the variant from your original work. Then update with respect to the latest changes. From SAMD core.

b) Create a package that can be tested at your end and same on my side. I can iteratively fix bugs and create a stable package that can be tested in your test jig.

c) After completing our testing, we can begin actual deployment. I would provide a pull request to your https://github.com/avandalen/SAM15x15 Repository. That way your original users would not face any issues in upgrading to the latest version. Later we can decide where to keep the common code.

Hope this would help us get to a workable solution fast. I will begin the patching today.

Let me know your thoughts on this.

Kind Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

avandalen commented 4 years ago

From: Abhijit Bose Sent: Sunday, May 10, 2020 4:03 PM To: avandalen/SAM15x15 Cc: Albert van Dalen ; Comment Subject: Re: [avandalen/SAM15x15] Error #include "sam.h" (#3)

Dear Albert,

Thanks for the update.

Arduino Org owns the https://github.com/arduino/ArduinoCore-samd repository.

They don't Allow others to push variants into the SAMD.

This is the reason other folks have created their own repository:

a.. https://github.com/adafruit/ArduinoCore-samd b.. https://github.com/sparkfun/Arduino_Boards I personally like the Sparkfun's approach. It works best since we can host both json file as well as the package. In the same place as the code.

Your Test fixture is great. Though due to COVID lockdown we might not be able to get the things here. My suggestion is if you can try out the implementation on your end. I can test to some extent using my board. Hope this can work at the moment. Once lockdown is lifted we can get one set of your boards. In future I can support your boards better.

I can use the following Image: https://www.avdweb.nl/Article_files/Arduino/SAM-D21/SAM15x15/Pins.jpg For your board. If you can share the TX/RX pins it would complete the picture.

a) First step would be to pull out the variant from your original work. Then update with respect to the latest changes. From SAMD core.

b) Create a package that can be tested at your end and same on my side. I can iteratively fix bugs and create a stable package that can be tested in your test jig.

c) After completing our testing, we can begin actual deployment. I would provide a pull request to your https://github.com/avandalen/SAM15x15 Repository. That way your original users would not face any issues in upgrading to the latest version. Later we can decide where to keep the common code.

Hope this would help us get to a workable solution fast. I will begin the patching today.

Let me know your thoughts on this.

Kind Regards, @boseji

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

avandalen commented 4 years ago

Dear Abhijit,

I would like to have an installation package for the ATSAMD51G19A so that all pins can be used with their full functionality via the Arduino. If you want to do this for me, I want to thank you with a compensation of 250 euros. For testing you can use the Adafruit ItsyBitsy M4 Express , but note that pin39 PA27 is not connected on the PCB.

Kind regards,

Albert

boseji commented 4 years ago

Dear Albert,

Thanks for the kind offer. I am happy to accept it.

Looking forward to implement the same and future releases.

I am currently working on my patch version. Have already forked this repository.

I will creating 2 more folders in the repo:

  1. To Store the Patching pieces
  2. To host the cloned version of the Arduino release.

To begin I will first integrate the SAM15X15 board. Once you are able to use the package built.

Then I begin the next steps.

Currently testing out my work at my older repo: https://github.com/boseji/jugaad_boards This contains my ARC core which I wrote several years earlier.

Will be adding some thing similar to fork as well : https://github.com/boseji/SAM15x15

Keep you posted.

Kind Regards, @boseji

boseji commented 4 years ago

Dear Albert,

The first version of my board is working. https://github.com/boseji/jugaad_boards

There is some problem with the platform.txt and boards.txt in your repo. I am first planning to fix that.

I tired to do a nightly build for your repo. But could not get the scripts quite right. It was not working yet: https://github.com/boseji/SAM15x15/tree/nightly

I suspect that there is some naming issue as well.

Will look into this. Please check if you are able to use my board with the URI: https://raw.githubusercontent.com/boseji/jugaad_boards/master/bm/package_boseji_jugaad_boards_index.json

I would try to replicate the same for your repository also.

Kind Regards, @boseji

avandalen commented 4 years ago

You are now add as a collaborator here:

https://github.com/avandalen/SAM15x15

maybe you can work here instead of using a separate fork?

boseji commented 4 years ago

Great. That would be helpful. However I want to finish the integration of Github Actions for build. This would help you for future build. Once done I will add the release actions. This would help you to get the complete automated file generation.

After the initial success with the build system I will generate a pull request. That would merge all my work into your repository.

avandalen commented 4 years ago

Hi Abhijit

Will look into this. Please check if you are able to use my board with the URI: https://raw.githubusercontent.com/boseji/jugaad_boards/master/bm/package_boseji_jugaad_boards_index.json

yes i could use you board in my arduino IDE.

It cost the arduino IDE a lot of time to integrate.. (it is big I suppose)

do you have a linkedin account?

thanks

Albert

avandalen commented 4 years ago

Dear Abijit

Do you have a board to test the SAMD51?

Albert

boseji commented 4 years ago

I don't have a SAMD51 board.

No problem It only take a big excel sheet to fix all I/O allocators.

Once done it would behave very similar to your SAM15X15.

boseji commented 4 years ago

Good News the latest nightly Patch build is now Working ! for SAM15X15 on Arduino IDE.

Here is what I want you to do:

  1. Install the latest board using the follow URL: https://github.com/boseji/SAM15x15/raw/nightly/package_SAM15X15_index.json This is the Nightly version from my side.

  2. Test it with your actual SAM15X15 hardware. I am sure this one should work.

This would help us to understand if the new build process is correct. Also if my porting of your older board package is correct. I have tested out the build using my latest Arduino IDE 1.8.12 on Linux. It should also work on windows, albeit slower.

One more interesting FACT, this would work even if ArduinoCore-SAMD is not Installed.

Once you confirm things are alright with the hardware - I will begin merging to master. Then provide a pull request to merge the development.

avandalen commented 4 years ago

Can you get a SAMD51 board?

I will ask you if you can test your package on a SAMD51 board, I cant do this, I have no time. It is important that we are sure that all pins functionality (I/O, ADC, PWM etc) work well. The new SAM15x15 board with the SAMD51 is a little different from the SAMD21 version: D29 dont excist anymore. The SAMD51 pin41 is not an I/O pin anymore. I will soon add the schematic on my website.

avandalen commented 4 years ago

You can add your new package for the SAM15x15 (D51 version) in a separate repository on my github account.

boseji commented 4 years ago

Implementation Completed