MegaPi Upload error: "undefined reference to `megaPi_slots'"


#1

I’m using a new MegaPi (with a Nema17 stepper motor on port1) and am trying to write scripts with MBlock.
Whenever I try to upload using the Stepper motor block, this error is returned (see below), and the upload fails with an “error compiling” message.

It seems to focus on “undefined reference to `megaPi_slots’”

Any help would be greatly appreciated, Thank you!

Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\MeStepper.cpp.o
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\MeStepperOnBoard.cpp.o
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\MeTemperature.cpp.o
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\MeTouchSensor.cpp.o
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\MeUltrasonicSensor.cpp.o
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\MeUSBHost.cpp.o
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\MeVoice.cpp.o
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\MeWifi.cpp.o
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\utility\avr\Servo.cpp.o
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp/core.a -LC:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp -lm
C:\Users\richa\AppData\Local\Temp\build3725806112167345696.tmp\MakeBlockDrive\MeStepperOnBoard.cpp.o:

In function `MeStepperOnBoard::MeStepperOnBoard(int)’:

C:\Program Files (x86)\mBlock\Arduino\portable\sketchbook\libraries\makeblock\src/MeStepperOnBoard.cpp:97: undefined reference to `megaPi_slots’

C:\Program Files (x86)\mBlock\Arduino\portable\sketchbook\libraries\makeblock\src/MeStepperOnBoard.cpp:97: undefined reference to `megaPi_slots’

collect2.exe: error: ld returned 1 exit status
Error compiling.


#2

May I assume that you have selected the MegaPi from the Boards menu?


#3

Yes. The code will compile in Arduino, but not in Mblock.
There is an active connection to the MegaPi.


#4

Are you using generated code from mBlock or are you writing it yourself? Either way could you post the code?

Do you have a separate Arduino IDE (1.8.x) or are you using the one in the mBlock install (1.6.5)?

@tec_support should probably get cc’ed on this as well.


#5

Hi Richard,

Thanks for your feedback!
This issue does happen on the newer mBlock 3.4.6, we have recorded this problem and will try our best to fix it.
You may temporarily use the older version mBlock to compile this program as a temporarily workaround.


#6

I downloaded the latest version v3.4.8 of MBlock and it is now working properly.
THANK YOU!