Hello
I have a maple mini and I want to leave it plugged in and boot my Linux PC.
Now I see that the device isn't there. I have to reset it before it gets available.
Of course I could try hardware hacks to reset it after boot.
Any simpler suggestions?
Maple mini not available after boot
(23 posts) (3 voices)-
Posted 3 years ago #
-
my maple mini is flawlessly recognized when plugged in before boot on my Arch Linux boxes. somebody with the same distro may be of help, what distro is it you use?
Posted 3 years ago # -
It is a voyage linux (debian based) on a alix3d3 board. maybe it is a problem with the PC. I'll try the reset.py script after boot. maybe this will work...
Posted 3 years ago # -
do you mean that when you reboot the PC, the mini doesn't show up under /dev/maple?
Posted 3 years ago # -
Yes, after boot I don't see /dev/ttyACM0 and no symlink /dev/maple
after a reset of the maple using its reset button, I see it. but if I reset it one again, it is gone.I always have to reset my mini twice, after the first reset it is unresponsive and invisible on USB (no lsusb, dmesg says "device disconnected".
in detail: now it is running, has a blink program on it and blinks.
lsusb:
Bus 005 Device 003: ID 1eaf:0004dmesg:
[ 895.384087] usb 5-1: new full-speed USB device number 3 using uhci_hcd
[ 895.711385] cdc_acm 5-1:1.0: ttyACM0: USB ACM device
[ 895.714479] usbcore: registered new interface driver cdc_acm
[ 895.714488] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adaptersthen I press reset button once:
lsusb: nothing visible any moredmesg:
[ 895.711385] cdc_acm 5-1:1.0: ttyACM0: USB ACM device
[ 895.714479] usbcore: registered new interface driver cdc_acm
[ 895.714488] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 1239.176200] usb 5-1: USB disconnect, device number 3
[ 1239.664144] usb 5-1: new full-speed USB device number 4 using uhci_hcd
[ 1242.152165] usb 5-1: USB disconnect, device number 4Blink program not running any more. and I have to reset it to get my device back...
Is that normal? With arduino I never had this...
Posted 3 years ago # -
Is that normal?
No, not normal, and I'm unable to reproduce any of those issues on my machine (64-bit Ubuntu 12.04). Rebooting works fine, and I get both /dev/maple and the /dev/ttyACM back on every reset. What's the output of
$ udevadm monitor
on both kinds of reset (the "failed" and "successful" kinds)?For reference, mine is here: http://pastebin.com/1SikQEdX
Posted 3 years ago # -
Hello mbolivar. here is my udevadm output. I added comments for what I did. in difference to you pastebin I see that in your case the device is added after remove. in my case the last statement is "removed"
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel ueventplugging in:
KERNEL[10627.567000] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
KERNEL[10627.571740] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
UDEV [10627.594038] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
UDEV [10627.610016] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
KERNEL[10629.944676] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
KERNEL[10629.945109] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
UDEV [10629.945795] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
UDEV [10629.951618] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
KERNEL[10630.407896] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
KERNEL[10630.409910] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
KERNEL[10630.413581] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/tty/ttyACM0 (tty)
KERNEL[10630.413748] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1 (usb)
UDEV [10630.426429] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
UDEV [10630.429876] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1 (usb)
UDEV [10630.431276] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
UDEV [10630.461943] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/tty/ttyACM0 (tty)now resetting:
KERNEL[10643.584896] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/tty/ttyACM0 (tty)
KERNEL[10643.585063] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
KERNEL[10643.585198] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1 (usb)
KERNEL[10643.585651] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
UDEV [10643.594767] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1 (usb)
UDEV [10643.595392] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/tty/ttyACM0 (tty)
UDEV [10643.596355] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
UDEV [10643.596895] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
KERNEL[10644.539905] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
KERNEL[10644.544731] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
UDEV [10644.556713] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
UDEV [10644.570377] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
KERNEL[10646.808543] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
KERNEL[10646.809001] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
UDEV [10646.809993] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
UDEV [10646.811189] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)Posted 3 years ago # -
I'm not sure, but this is my guess about what's happening when you reset it.
KERNEL[10643.584896] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/tty/ttyACM0 (tty)
KERNEL[10643.585063] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
KERNEL[10643.585198] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1 (usb)
KERNEL[10643.585651] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
UDEV [10643.594767] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1 (usb)
UDEV [10643.595392] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/tty/ttyACM0 (tty)
UDEV [10643.596355] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
UDEV [10643.596895] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)These look like they're in response to the chip going down when you press the reset button.
KERNEL[10644.539905] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
KERNEL[10644.544731] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
UDEV [10644.556713] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
UDEV [10644.570377] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)This looks like the bootloader coming up in DFU mode.
KERNEL[10646.808543] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
KERNEL[10646.809001] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)
UDEV [10646.809993] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb)
UDEV [10646.811189] remove /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb)This then would be the bootloader deciding it was done, tearing itself down, and jumping to user code (the blinky program).
However, you then don't get the corresponding add events where the Mini's serial port /dev/ttyACM gets brought up in response to SerialUSB.begin() getting called from init() (which is a function that gets called before your setup()). Since you say that the blink sketch never runs, my guess would be that init() is crashing. The next step is to try to figure out if that's true, and if so, where it's crashing.
What version of libmaple are you running? Are you using Maple IDE or the Unix toolchain?
Posted 3 years ago # -
i'm using maple ide 0.0.12 on ubuntu 32 bit and the libmaple that came with it.
so the blink sketch is the example provided with the ide. nothing changed...
but if init() is crashing, why every 2nd time? because on every second reset it works well, I have developed a lot of code on it. see: https://github.com/everycook/EveryCook_Firmware
but now the firmware is ready and for the integration in my machine the reset problem is really annoying :-(
I remember that at my very first upload I had the wrong board selected. may that be a reason? see: http://forums.leaflabs.com/topic.php?id=1215
I can't remember how the board worked before that...
Posted 3 years ago # -
but if init() is crashing, why every 2nd time?
Yes, that's an interesting question, and one I'm curious to know the answer to.
The reason I believe init() is freezing up is because you say the board doesn't blink when the reset fails to bring up a /dev/ttyACM. Since the blinky program is known to work, that means control never gets to your setup()/loop(). So something before went wrong, and the likely suspect is init(), since the rest of the libmaple startup code is very simple and unlikely to be causing the bug.
Not having the right board selected for a single upload is almost definitely not the cause of the problem, as you've overwritten the bad first upload every single time you've uploaded another program.
Let's try a simple test to see whether or not the USB code in init() is to blame.
In the Maple IDE v0.0.12 directory, the source code for init() is in the file hardware/leaflabs/cores/maple/boards.cpp. Open it up; init() is the first function in the file. It looks like this:
void init(void) { setupFlash(); setupClocks(); setupNVIC(); systick_init(SYSTICK_RELOAD_VAL); gpio_init_all(); afio_init(); setupADC(); setupTimers(); setupUSB(); boardInit(); }
Here are the steps to follow to test things out:
- Close Maple IDE if you have it open.
- In init(), comment out the line that says
setupUSB();
and save boards.cpp. (It's the second-to-last line in the function.) - Reopen Maple IDE, and recompile/upload the blinky sketch to the Maple Mini.
- Reset the board a few times.
If there is something wrong with the way USB enumeration is working, then the board should blink every time you reset. Does that happen?
IMPORTANT: though the board should blink, the /dev/ttyACM will not come up, since you commented out setupUSB(). Make sure to uncomment setupUSB() after you're done with the test, so things work normally afterwards.
Posted 3 years ago # -
Nope, no change visible. board blinks every 2nd reset as before. but thanks for the try!
Posted 3 years ago # -
just made another test that may be helpful: connected on a usb power supply I have the same behaviour. I still need 2 resets. so the USB connection is probably not the cause of my troubles.
Posted 3 years ago # -
connected on a usb power supply I have the same behaviour. I still need 2 resets.
That's a good test, and a mysterious result. It does rule out USB problems. We've never had reports of this behavior before, and I have no idea what's causing it. It sounds like the board is defective.
Posted 3 years ago # -
I'll know tomorrow. ordered 3 more minis from seeedstudios and they left hong kong on sunday. I'll tell you how they behave...
Posted 3 years ago # -
ok. if it turns out busted, please contact us at info@leaflabs.com for a replacement.
Posted 3 years ago #
Reply »
You must log in to post.