Arduino M0 Pro

Ok... I use to mess about with Arduino boards a few years back, and needed a new one for a project so I just ordered myself an Arduino M0 Pro from RS uk. Says it was formerly a Zero board. Sweet! I always go with a big supplier to avoid fakes etc.

I now surprisingly find out the theres a split in Arduino posse, and this board isnt from the Arduino.cc people, its from Arduino.org =/

Will the Arduino.cc 1.6.5 IDE work ok with this board? I've installed the one from Arduino.org(1.7.x) and its very slow on my machine compared to the orignal 1.6.5

Cheers

Personally, I have found it easier to use v1.6.5 and this Forum. IMHO, the v1.7.6 maintainers are not as knowledgeable with software as the v1.6.5 team. In other words, they are best to stay with manufacturing.

I changed my M0_Pro to use v1.6.5 by

  1. editing "boards.txt" from C:\Users\David Prentice\AppData\Roaming\Arduino15\packages\arduino\hardware\samd\1.6.0 directory
  2. editing "variants/arduino_zero/variant.cpp"
  3. installing the v1.6.5 Bootloader.

boards.txt: append these lines

arduino_m0_pro_edbg.name=Arduino M0 Pro (Programming Port)
arduino_m0_pro_edbg.vid.0=0x03eb
arduino_m0_pro_edbg.pid.0=0x2157
arduino_m0_pro_edbg.upload.tool=openocd
arduino_m0_pro_edbg.upload.protocol=sam-ba
arduino_m0_pro_edbg.upload.maximum_size=262144
arduino_m0_pro_edbg.upload.use_1200bps_touch=false
arduino_m0_pro_edbg.upload.wait_for_upload_port=false
arduino_m0_pro_edbg.upload.native_usb=false
arduino_m0_pro_edbg.build.mcu=cortex-m0plus
arduino_m0_pro_edbg.build.f_cpu=48000000L
arduino_m0_pro_edbg.build.usb_product="Arduino M0 Pro"
arduino_m0_pro_edbg.build.usb_manufacturer="Arduino LLC"
arduino_m0_pro_edbg.build.board=SAMD_M0_PRO
arduino_m0_pro_edbg.build.core=arduino
arduino_m0_pro_edbg.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
arduino_m0_pro_edbg.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
arduino_m0_pro_edbg.build.openocdscript=openocd_scripts/arduino_zero.cfg
arduino_m0_pro_edbg.build.variant=arduino_zero
arduino_m0_pro_edbg.build.variant_system_lib=
arduino_m0_pro_edbg.build.vid=0x2341
arduino_m0_pro_edbg.build.pid=0x804d
arduino_m0_pro_edbg.bootloader.tool=openocd
arduino_m0_pro_edbg.bootloader.file=zero/samd21_sam_ba.bin

arduino_m0_pro_native.name=Arduino M0 Pro (Native USB Port)
arduino_m0_pro_native.vid.0=0x2341
arduino_m0_pro_native.pid.0=0x804d
arduino_m0_pro_native.vid.1=0x2341
arduino_m0_pro_native.pid.1=0x004d
arduino_m0_pro_native.upload.tool=bossac
arduino_m0_pro_native.upload.protocol=sam-ba
arduino_m0_pro_native.upload.maximum_size=262144
arduino_m0_pro_native.upload.use_1200bps_touch=true
arduino_m0_pro_native.upload.wait_for_upload_port=true
arduino_m0_pro_native.upload.native_usb=true
arduino_m0_pro_native.build.mcu=cortex-m0plus
arduino_m0_pro_native.build.f_cpu=48000000L
arduino_m0_pro_native.build.usb_product="Arduino M0 Pro"
arduino_m0_pro_native.build.usb_manufacturer="Arduino LLC"
arduino_m0_pro_native.build.board=SAMD_M0_PRO
arduino_m0_pro_native.build.core=arduino
arduino_m0_pro_native.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
arduino_m0_pro_native.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
arduino_m0_pro_native.build.openocdscript=openocd_scripts/arduino_zero.cfg
arduino_m0_pro_native.build.variant=arduino_zero
arduino_m0_pro_native.build.variant_system_lib=
arduino_m0_pro_native.build.vid=0x2341
arduino_m0_pro_native.build.pid=0x804d

variant.cpp: edit the g_APinDescription[] table

...
#if defined(ARDUINO_SAMD_M0_PRO)
  { PORTA,  8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // TCC0/WO[0]
  { PORTA,  9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // TCC0/WO[1]
  { PORTA, 14, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_14 }, // TC3/WO[0]
#else
  { 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 }, // TCC0/WO[1]
  { PORTA,  8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI },  // TCC0/WO[0]
#endif
...

Originally, I was going to provide a different "variant/arduino_m0_pro" directory and specific v1.7.6 bootloader. However the only differences are down to the D4 and D2 pin swap. It would be a nightmare to maintain different variant directories.

In an ideal world, the warring Italians would kiss and make up.

David.

Hint. You can reach the "hidden" Packages directory by clicking on the "preferences.txt" from File->Preferences in the IDE

Thank You! I'll give that try.

If I had known about the split in Arduino I probably would of gone with an Xplained board and stuck with Atmel Studio. Its not fair for the customers on both sides!

I take it editing variant.cpp will sort out the D4 and D2 swap over?

Thank you again!

Yes, that should sort out the pin difference.

If only v1.6.5 people officially added the M0 Pro to the IDE, all the third party library authors would start supporting the SAMD boards.

The alternative is MBED with Freescale or ST.

David.

Cool!

I have a few LPCXpresso boards kicking around.... might revert back to them!

Regarding the Arduino wars, the least they could do would be to keep a unified IDE for their consumers for ALL products. The worst thing for customers on both sides was to fork the IDE.

Babies throwing toys out pram me thinks