Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Grand Central M4 bootloader issues
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Grand Central M4 bootloader issues

by kaleun96 on Mon May 04, 2020 3:46 am

As detailed in this thread, my bootloader issues continue and I've received no solutions from Adafruit, or even some good things to try other than swapping the USB cables.

If there is no solution, I would like a refund or a replacement unit. I bought it through Mandu.fi and ever since I bought the M4, I've been relying on my Arduino Due since it's a waste of my time to be double-tapping the reset button every time I want to upload a sketch.

I have no idea if these tips should apply to the Grand Central but even if they do I don't think they account for my issue as I get this error when the sketch has no issues, I've tried multiple cables that have no issues on other boards, and I'm having to double-tap reset every sketch load rather than "every now and then".

kaleun96
 
Posts: 17
Joined: Fri Mar 13, 2020 12:55 pm

Re: Grand Central M4 bootloader issues

by dastels on Mon May 04, 2020 10:38 am

Have a look at https://blog.adafruit.com/2020/04/13/uf2-bootloader-news-downloads-in-circuitpython-org-new-version-for-samd51-m4-boards/ if you haven't. The updated bootloader may help with your issue.

Dave

dastels
 
Posts: 3472
Joined: Tue Oct 20, 2015 3:22 pm

Re: Grand Central M4 bootloader issues

by kaleun96 on Mon May 04, 2020 10:57 am

Thanks Dave, that sounds a bit more promising. I'll give it a go tonight and let you know if it helps.

kaleun96
 
Posts: 17
Joined: Fri Mar 13, 2020 12:55 pm

Re: Grand Central M4 bootloader issues

by kaleun96 on Mon May 04, 2020 12:54 pm

Ok I've updated to the new bootloader. Using a ~300 line sketch, I'm not encountering any issues in the Arduino IDE or Atom+Platformio. However, when I use my actual project files (a dozen or more .cpp and .h files with many more font and icon files etc), I'm consistently encountering the issue on every 2nd upload like before. It often fails at around the same point, 25-40% during the writing phase.

This seems to indicate there's something about the sketch the Grand Central may not like. I've heard some say it could be printing to serial but in this case both the sketches tested have prints to serial. The first sketch that had no problems probably even has more prints to serial than my multi-file sketch.

There's going to be more code than you will have the patience to read through but if you're interested it can be found here.

kaleun96
 
Posts: 17
Joined: Fri Mar 13, 2020 12:55 pm

Re: Grand Central M4 bootloader issues

by dastels on Mon May 04, 2020 4:24 pm

It sounds like you are having problems during upload... i.e. what the actual code is or does is irrelevant at that point... it's just uploaded binary data.

I'll read through your previous thread.

Dave

dastels
 
Posts: 3472
Joined: Tue Oct 20, 2015 3:22 pm

Re: Grand Central M4 bootloader issues

by dastels on Mon May 04, 2020 4:44 pm

I'm trying to get it building in pio (so I can test uploading) but am running into issues finding gfxButton.h for the Grandcentral env. A lib search for the header returns no results.

dastels
 
Posts: 3472
Joined: Tue Oct 20, 2015 3:22 pm

Re: Grand Central M4 bootloader issues

by kaleun96 on Mon May 04, 2020 4:53 pm

Hey Dave,

Sorry gfxButton is my own library and I copied it to the project (but added to git ignore) while iterating on it in conjunction with this project. You can download it from my GitHub here. I think that's the latest version, if not I'll update it tomorrow.

Let me know if you run into any issues with the MCUFRIEND_kbv library. I was using the latest version on GitHub of that while working with the author to add support for the Grand Central, can't recall if that was released so I may have also been using the GH copy instead.

kaleun96
 
Posts: 17
Joined: Fri Mar 13, 2020 12:55 pm

Re: Grand Central M4 bootloader issues

by dastels on Tue May 05, 2020 2:51 pm

OK.. I'm further.. now Aperture.h

dastels
 
Posts: 3472
Joined: Tue Oct 20, 2015 3:22 pm

Re: Grand Central M4 bootloader issues

by kaleun96 on Tue May 05, 2020 3:13 pm

dastels wrote:OK.. I'm further.. now Aperture.h

Sorry for the hassle, that's probably the "Aperture_Icon.h" file in the src directory of the gfxButton lib. You can delete that src/main.cpp file, only the library .h and .cpp file are used and the main.cpp sketch may even refer to some outdated methods.

I've been meaning to clean the lib up but still had some work to do on it. I'm sure there's also lots of terrible code in both the library and project files, rest assured I don't do this for a living!

kaleun96
 
Posts: 17
Joined: Fri Mar 13, 2020 12:55 pm

Re: Grand Central M4 bootloader issues

by dastels on Tue May 05, 2020 3:21 pm

That did it... now it wants Wire.h. Which lib though?

Code: Select all | TOGGLE FULL SIZE
>:platformio lib search "header:Wire.h"
Found 11 libraries:

MySensors
=========
#ID: 548
Home Automation Framework. Create your own wireless sensor mesh using nRF24L01+, RFM69 and RFM95 radios running on AVR, ESP32, ESP8266, NRF5x, SAMD, STM32F1 and Teensyduino. Over-the-air updates and MySensors support by 20+ home automation controllers.

Keywords: framework, rf, sensor
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR, Atmel megaAVR, Atmel SAM, Espressif 32, Espressif 8266, GigaDevice GD32V, Infineon XMC, Intel ARC32, Kendryte K210, Microchip PIC32, Nordic nRF51, Nordic nRF52, ST STM32, ST STM8, Teensy, TI MSP430
Authors: MySensors

ssd1306
=======
#ID: 1904
Display driver for VGA, SSD1306, SSD1325/SSD1327, SSD1331, SSD1351, ILI9163/ST7735, ILI9341, PCD8544.

Keywords: display
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR, Atmel megaAVR, Atmel SAM, Espressif 32, Espressif 8266, GigaDevice GD32V, Infineon XMC, Intel ARC32, Kendryte K210, Microchip PIC32, Nordic nRF51, Nordic nRF52, ST STM32, ST STM8, Teensy, TI MSP430
Authors: Alexey Dynda

ODROID-GO
=========
#ID: 5688
A library for ODROID-GO development kit

Keywords: esp32, odroid
Compatible frameworks: Arduino
Compatible platforms: Espressif 32
Authors: Seungchul Lee

MakeBlockDrive
==============
#ID: 1166
Use to drive all devices provided by Makeblock company.

Keywords: device, control
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR, Atmel SAM, Espressif 32, Espressif 8266, Infineon XMC, Intel ARC32, Kendryte K210, Microchip PIC32, Nordic nRF51, Nordic nRF52, ST STM32, ST STM8, Teensy, TI MSP430
Authors: Mark Yan, Makeblock

I2C_Driver
==========
#ID: 2257
I2C libraries for the implementation of I2C communication in nRF51 based on I2C redbearlabs libraries

Keywords: i2c_driver
Compatible frameworks: mbed
Compatible platforms: Atmel SAM, Freescale Kinetis, Maxim Integrated MAX32, Nordic nRF51, Nordic nRF52, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, WIZNet W7500
Authors: CESAR CAZAL

lcdgfx
======
#ID: 6681
VGA, SSD1306, SSD1331, SSD1325/SSD1327, SSD1351, IL9163/ST7735, ILI9341 PCD8544 spi/i2c OLED/LED Display driver.

Keywords: display
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR, Atmel megaAVR, Atmel SAM, Espressif 32, Espressif 8266, GigaDevice GD32V, Infineon XMC, Intel ARC32, Kendryte K210, Microchip PIC32, Nordic nRF51, Nordic nRF52, ST STM32, ST STM8, Teensy, TI MSP430
Authors: Alexey Dynda

WireNoFreeze
============
#ID: 6653
Fork of the official Arduino Wire library with anti-freeze à la WSWire added

Keywords: communication
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR
Authors: Arduino, Yann Büchau

ATmegaxxM1-C1
=============
#ID: 5694
Arduino IDE support files ATmegaxxM1 and ATmegaxxC1 AVR chips.

Keywords: other
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR
Authors: Al Thomason

Grove I2C Motor Driver
======================
#ID: 5689
Arduino library to control Grove I2C Motor Driver.

Keywords: sensors
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR, Atmel SAM, Espressif 32, Espressif 8266, Intel ARC32, Microchip PIC32, Nordic nRF51, Nordic nRF52, ST STM32, Teensy, TI MSP430
Authors: Seeed Studio

databot
=======
#ID: 6444
Official databot library supporting databot, based on Arduino

Keywords: sensors
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR
Authors: aRbotics, LLC

Show next libraries? [y/N]: y
utils_asukiaaa
==============
#ID: 7286
Utility functions for Arduino.

Keywords: sensors
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR, Atmel megaAVR, Atmel SAM, Espressif 32, Espressif 8266, GigaDevice GD32V, Infineon XMC, Intel ARC32, Kendryte K210, Microchip PIC32, Nordic nRF51, Nordic nRF52, ST STM32, ST STM8, Teensy, TI MSP430
Authors: Asuki Kono


dastels
 
Posts: 3472
Joined: Tue Oct 20, 2015 3:22 pm

Re: Grand Central M4 bootloader issues

by kaleun96 on Sun May 17, 2020 2:10 pm

Hey sorry not sure how | didn't see your reply, I was just going to message you now to see if you had any luck.

I don't specify Wire.h anywhere in my project files from what I can see, maybe it's a library dependency? If so, I assume it's the Wire library:
https://www.arduino.cc/en/reference/wire

kaleun96
 
Posts: 17
Joined: Fri Mar 13, 2020 12:55 pm

Re: Grand Central M4 bootloader issues

by tomjennings on Sat Jul 04, 2020 5:52 pm

I too am having issues uploading, involving reset state or something in the bootloader. I updated to the latest bootloader yesterday. MacOS 10.15.5, Arduino 1.8.13.

I've reduced the behavior down to the following rules:

* If I double-click (sic) the reset switch, subsequent sketch upload works every time.

* If I do not double-click the reset switch, it uploads "about" 1/3rd the time, errors out "no device on port" 1/3rd the time, or hangs uploading with the "thermometer" progress meter half way-ish, hangs, times out.

* If the program running in the board is outputting a lot of text to the USB serial port - and I run 115200 bits/sec so a lot is a lot -- the likelihood of failure goes up as text volume goes up.

* If the Neopixel is GREEN it uploads OK.

* After successful upload, I get Mac OS system error "Disk Not Ejected Properly" for GCM4BOOT, every time. It seems to have no effect though, so this is just FYI, I don't care.



I'm hoping that long-term, I won't have to press reset for normal upload. In debugging I often hang the machine, reset is fine. But eventually this board will be embedded in a sealed box under the instrument panel of a car.... Most Inconvenient!

ta!

Thanks

tom

tomjennings
 
Posts: 78
Joined: Thu Aug 17, 2006 1:21 am

Re: Grand Central M4 bootloader issues

by dastels on Sat Jul 04, 2020 6:00 pm

kaleun96: Wire is the underlying I2C library. It will be used by whatever I2C device library you are using. You won't often need to use it directly.

Dave

dastels
 
Posts: 3472
Joined: Tue Oct 20, 2015 3:22 pm

Re: Grand Central M4 bootloader issues

by kaleun96 on Sun Jul 05, 2020 6:15 am

dastels wrote:kaleun96: Wire is the underlying I2C library. It will be used by whatever I2C device library you are using. You won't often need to use it directly.

Dave

Sorry I don't quite follow then, what's the issue with it wanting Wire.h? I don't believe my project has any dependency on the libs you listed, whether one of the libs I'm using has a dependency on one of those I'm not sure.

AFAIK the only library I have installed with a Wire.h header is the standard Arduino one.

The Adafruit GFX library references Wire.h but this shouldn't be a problem if you have the Wire library installed. I don't think the other libs use Wire.h from what I can tell.

kaleun96
 
Posts: 17
Joined: Fri Mar 13, 2020 12:55 pm

Re: Grand Central M4 bootloader issues

by kaleun96 on Mon Jul 13, 2020 11:02 am

dastels wrote:kaleun96: Wire is the underlying I2C library. It will be used by whatever I2C device library you are using. You won't often need to use it directly.

Dave

Managed to replicate the issue, adding
Code: Select all | TOGGLE FULL SIZE
#include "Wire.h"
to the main.cpp file seems to fix it. Not sure why it's required there...

kaleun96
 
Posts: 17
Joined: Fri Mar 13, 2020 12:55 pm

Please be positive and constructive with your questions and comments.