What is the difference between the Arduino zero board and Arduino M0 pro board?

Hello i know there are some difference between the Arduino zero which is from the Arduino.cc and the Arduino M0 pro which is from the arduino.org board. But I only just recently found out that both are together which I'm happy about it. But I'm still wondering what are the main differences not only in programming but in hardware? Both use the same Chip as far as i can see maybe I'm wrong but i have a Zero board here that says ATSAMD21G18 on it and it uses the board manger Zero Programming port. And the M0 prof says on the chip ATSAMD21G18 and i have to Select on the manger board as a M0 pro programming port.

So what is the real difference?

M0 was developed by Arduino.org and has a different (larger) bootloader. it uses different tools for flashing. in platform.txt you can see avrdude configured for the M0

Thank you.

"pin 2" and "pin 4" are swapped WRT which chip pin they connect to:

// Arduino zero
const PinDescription g_APinDescription[]=
{
 { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 },
 { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 },
/****  PIN 2 ****/ { PORTA, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 },
 { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 },
/**** Pin 4 ****/{ PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI },
const PinDescription g_APinDescription[]=
{
 { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 },
 { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 },
/**** PIN 2 ****/ { PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NONE },
 { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 },
/**** Pin 4 ****/ { PORTA, 14, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_14 },
 { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 },

Hello West so really from what you post only the Programming chip is different and Digital pin 2 and 4 are reversed but everything else is the same. Okay that makes things a lot easier. But the other part you posted

[color=#222222]// Arduino zero[/color][color=#222222][/color]
[color=#222222]const PinDescription g_APinDescription[]=[/color][color=#222222][/color]
[color=#222222]{[/color][color=#222222][/color]
[color=#222222] { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 },[/color][color=#222222][/color]
[color=#222222] { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 },[/color][color=#222222][/color]
[color=#222222]/****  PIN 2 ****/ { PORTA, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 },[/color][color=#222222][/color]
[color=#222222] { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 },[/color][color=#222222][/color]
[color=#222222]/**** Pin 4 ****/{ PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI },[/color]
[color=#222222]
[/color]
[color=#222222]

and

[color=#222222][/color]
[color=#222222]const PinDescription g_APinDescription[]=[/color][color=#222222][/color]
[color=#222222]{[/color][color=#222222][/color]
[color=#222222] { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 },[/color][color=#222222][/color]
[color=#222222] { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 },[/color][color=#222222][/color]
[color=#222222]/**** PIN 2 ****/ { PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NONE },[/color][color=#222222][/color]
[color=#222222] { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 },[/color][color=#222222][/color]
[color=#222222]/**** Pin 4 ****/ { PORTA, 14, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_14 },[/color][color=#222222][/color]
[color=#222222] { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 },[/color]

I’m not understanding this part. Can you please explain what this is please?

Can you please explain what this is please?

PinDescription g_APinDescription[]

The g_APinDescription array is off in …/variants//variant.cpp is essentially the “master translation table” for converting an Arduino “pin number” into all the other info that the Arduino core code might need to get that pin to do anything - where the control registers for that pin are located in memory, whether it can do PWM, whether it can do analog (and which ADC “channel” it’s on), and so on.
Usually there are some functions defined elsewhere (variant.h) that make it a little easier to get to the data (digitalPinToBitMask(), for example. There probably should be more of these.)

If you want to know which pins go where, or whether some pin supports some function, or how two boards are different, the variant directory (and usually variant.cpp) is the place to look. (Unfortunately, they’re not usually formatted identically, so “compare” can be a bit tricky.)