Maple Mini Windows compilation issues

Windows XP,Vista,7,8 and 8.1 etc
Post Reply
andysheen
Posts: 4
Joined: Tue Apr 19, 2016 2:14 pm

Maple Mini Windows compilation issues

Post by andysheen » Tue Apr 19, 2016 2:38 pm

Hey Everybody,

I'm having issues with uploads from a windows 8 upload using Arduino 1.6.5 and my Maple Mini.

The top line is that it seems to compile and upload fine, but if my code uses any interrupts the program pauses. I've tried the same sketch on my Mac and it works fine.

If I unplug and plug it back into my windows machine, I can recompile and upload fine, but still pauses on interrupt. After i've uploaded from Windows, I cannot upload from my OSX machine until I reinstall the bootloader via usb from the Mac.

Any tips?

Thank you!

User avatar
mrburnette
Posts: 1827
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Maple Mini Windows compilation issues

Post by mrburnette » Tue Apr 19, 2016 3:32 pm

andysheen wrote: <...>
The top line is that it seems to compile and upload fine, but if my code uses any interrupts the program pauses. I've tried the same sketch on my Mac and it works fine.
<...>

Welcome Andy.

The "compile and upload" under Windows is all bootloader code. In this situation, the "serial" USB connection is used to cause a reset to the Maple Mini and the bootloader then uses the DFU over USB to install your sketch.

After the sketch starts, then the Serial.print() over USB is code that gets attached to your sketch and uploaded - it is not the bootloader serial code.

Do all of the 'example sketches' work? Especially stuff like 'Blink n Count' ?

FYI: Please reference the WiKi here and ensure that you have followed the Windows driver installation procedure. I will cut&paste the relevant statement below:
If using Maple or Maple mini, you will need to install the drivers in drivers/win folder.

Maple and Maple mini use drivers which come as standard on Windows 7 or newer, however USB VID/PID numbers of the Maple boards need to be associated with the relevant drivers, and Windows 7 and newer also require that the drivers and inf files need to be "signed".

This is a complex process, but has been made seamless thanks to the work of @timschuerewegen who created a modified version of dwi-simple (See https://github.com/pbatard/libwdi. I will add the modified sources to the repo when I get around to it.)

Run the install_drivers.bat file, which runs dwi-simple.exe twice, once to install the usb serial device and once to install the DFU device.

Ray

andysheen
Posts: 4
Joined: Tue Apr 19, 2016 2:14 pm

Re: Maple Mini Windows compilation issues

Post by andysheen » Wed Apr 20, 2016 9:52 am

Hi Ray!

Thanks for the heads up, The upload from windows is actually fine (tested on 7 and 8.1), It seems like it's how it is compiled differs from windows to mac.
mrburnette wrote:Do all of the 'example sketches' work? Especially stuff like 'Blink n Count' ?
Yeah, they all work fine (thanks for the examples!)! I seem to have narrowed it down to using attachInterrupt .

I'm currently using interrupt to check a button press.

Code: Select all

  attachInterrupt(PA2, interruptFunction, CHANGE);
if I use digitalRead instead, code seems to compile and work fine on both platforms, using attachInterrupt seems to only work on OSX - weird! :?

Andy

User avatar
mrburnette
Posts: 1827
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Maple Mini Windows compilation issues

Post by mrburnette » Wed Apr 20, 2016 12:16 pm

andysheen wrote: <...>
if I use digitalRead instead, code seems to compile and work fine on both platforms, using attachInterrupt seems to only work on OSX - weird! :?

Andy
So, are you saying that you can compile on both platforms, but the STM32 fails on Windows but functions correctly on OSX? Stated another way, you can compile, link, load on Windows but the code does not work and then if the module is taken to the Apple, the Windows generated code works? Or, must you compile, link, load on OSX for it to work on OSX only?

Strange.

Ray

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Maple Mini Windows compilation issues

Post by RogerClark » Wed Apr 20, 2016 12:40 pm

Strange...

I have used attachInterrupt in the last few weeks and it works fine on my PC.

This does however sound like its a compiler version issue, as we have had problems in the past with callback functions not being linked by the compiler.

That specific issue happened with the hardware timers, but the external input interrupt would possibly suffer from the same problem under some circumstances.

When did you install the IDE ( and specifically when did you install the ARM compiler, by installing the Due or Zero), i.e I wonder if the IDE boards manager now installs a different / newer version of the ARM compiler.

We already had one issue with gcc 4.8 optimising out a read to the USB hardware, but I am not sure why the person using gcc 4.9 was using that version. I presumed that had some special install, but perhaps thats what the Boards Manager now installs ??

andysheen
Posts: 4
Joined: Tue Apr 19, 2016 2:14 pm

Re: Maple Mini Windows compilation issues

Post by andysheen » Wed Apr 20, 2016 2:57 pm

mrburnette wrote: So, are you saying that you can compile on both platforms, but the STM32 fails on Windows but functions correctly on OSX? Stated another way, you can compile, link, load on Windows but the code does not work and then if the module is taken to the Apple, the Windows generated code works? Or, must you compile, link, load on OSX for it to work on OSX only?
Code using attachInterrupt does not work correctly (program freezes on interrupt) when compiled on windows. The same code will compile and work fine when compiled on OSX.
RogerClark wrote: When did you install the IDE ( and specifically when did you install the ARM compiler, by installing the Due or Zero), i.e I wonder if the IDE boards manager now installs a different / newer version of the ARM compiler.
Just had a quick check, compiled and tried the latest 3 versions of Due/Zero board manager on Windows 7,8.1 & OSX. attachInterrupt still doesn't work when compiled on windows, all version fine on OSX.

Andy

User avatar
mrburnette
Posts: 1827
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Maple Mini Windows compilation issues

Post by mrburnette » Wed Apr 20, 2016 3:09 pm

Andy, I'm on Linux Mint, and my compiler is here:
/home/ray/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/arm-none-eabi/bin

from the shell,

Code: Select all

$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I think, like Roger, that we have a version issue with the toolset.

Ray

andysheen
Posts: 4
Joined: Tue Apr 19, 2016 2:14 pm

Re: Maple Mini Windows compilation issues

Post by andysheen » Tue May 03, 2016 1:33 pm

Hey Guys,

I think I may have located the problem.

My OSX machine has been running an old version of the hardware folder (15 Nov 2015). When I use this version of the hardware folder on all the other machines they compile and work fine.

Also just checked the latest github version of hardware folder on my OSX machine and it has the same issues with external interrupt.

Something in the later commits (after 15 nov 2015) must have changed the external interrupt?

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Maple Mini Windows compilation issues

Post by RogerClark » Tue May 03, 2016 8:21 pm

I used one external interrupt a few weeks ago and it worked Ok.

try downloading a few fresh copy of the whole repo

Post Reply