stepper.h

Can someone help me port this library?
Nutsy
Posts: 260
Joined: Sun Jul 24, 2016 4:26 pm

stepper.h

Post by Nutsy » Mon Jul 25, 2016 2:53 pm

I realise its a fairly simply control library, But ive noticed it doesnt seem to fully work under STM.

Running the same code in STM i get very very slow stepper move loops...
Anyone know whats causing it and how to make it go fast again? :D

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

Re: stepper.h

Post by RogerClark » Mon Jul 25, 2016 9:56 pm

where is this file?

Nutsy
Posts: 260
Joined: Sun Jul 24, 2016 4:26 pm

Re: stepper.h

Post by Nutsy » Tue Jul 26, 2016 12:54 pm

Hmm its in the core library of arduino... Tbh dont worry about it. The library works... Just for some reason its very slow on the stm. Its just a set of bit read outs and if statements. It shouldn't be this slow and tbh shouldn't need porting.

Sorry

madias
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Re: stepper.h

Post by madias » Tue Jul 26, 2016 1:17 pm

I think the problem is in line 177 of stepper.cpp

Code: Select all

 this->step_delay = 60L * 1000L * 1000L / this->number_of_steps / whatSpeed;
For an easy cure you can use the exchanged code from the arduino forum:
http://forum.arduino.cc/index.php?topic=46964.0

madias
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Re: stepper.h

Post by madias » Tue Jul 26, 2016 1:37 pm

I would give the acc stepper library a try:
https://www.pjrc.com/teensy/td_libs_AccelStepper.html

Nutsy
Posts: 260
Joined: Sun Jul 24, 2016 4:26 pm

Re: stepper.h

Post by Nutsy » Wed Jul 27, 2016 7:48 pm

trying to run the accel stepper lib but getting an error

Code: Select all

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -hardware "/Users/Helen/Library/Arduino15/packages" -hardware "/Users/Helen/Documents/Arduino/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -tools "/Users/Helen/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/Helen/Documents/Arduino/libraries" -fqbn=Arduino_STM32:STM32F1:mapleMini:bootloader_version=bootloader20 -ide-version=10609 -build-path "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/arduino_modified_sketch_49855/ProportionalControl.pde"
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -hardware "/Users/Helen/Library/Arduino15/packages" -hardware "/Users/Helen/Documents/Arduino/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -tools "/Users/Helen/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/Helen/Documents/Arduino/libraries" -fqbn=Arduino_STM32:STM32F1:mapleMini:bootloader_version=bootloader20 -ide-version=10609 -build-path "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/arduino_modified_sketch_49855/ProportionalControl.pde"
Warning: platform.txt from core 'STM32 Boards (STM32duino.com)' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
"/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE  -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_maple_mini -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_MAPLE_MINI -DARDUINO_ARCH_STM32F1   -DMCU_STM32F103CB -DSERIAL_USB  -mthumb  -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -DSERIAL_USB  -mthumb  -march=armv7-m -D__STM32F1__ "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/include" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/stm32f1/include"                                                           "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/stm32f1" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/usb_lib" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/cores/maple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/variants/maple_mini" "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp/sketch/ProportionalControl.pde.cpp" -o "/dev/null"
"/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE  -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_maple_mini -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_MAPLE_MINI -DARDUINO_ARCH_STM32F1   -DMCU_STM32F103CB -DSERIAL_USB  -mthumb  -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -DSERIAL_USB  -mthumb  -march=armv7-m -D__STM32F1__ "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/include" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/stm32f1/include"                                                           "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/stm32f1" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/usb_lib" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/cores/maple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/variants/maple_mini" "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp/sketch/ProportionalControl.pde.cpp" -o "/dev/null"
"/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE  -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_maple_mini -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_MAPLE_MINI -DARDUINO_ARCH_STM32F1   -DMCU_STM32F103CB -DSERIAL_USB  -mthumb  -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -DSERIAL_USB  -mthumb  -march=armv7-m -D__STM32F1__ "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/include" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/stm32f1/include"                                                           "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/stm32f1" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/usb_lib" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/cores/maple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/variants/maple_mini" "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp/sketch/ProportionalControl.pde.cpp" -o "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
fork/exec /bin/arm-none-eabi-g++: no such file or directory
Error compiling for board Maple Mini.

User avatar
martinayotte
Posts: 1241
Joined: Mon Apr 27, 2015 1:45 pm

Re: stepper.h

Post by martinayotte » Wed Jul 27, 2016 8:44 pm

Did you upgraded your IDE recently ?
Becuase it seems that you lost the toolchain path, and/or it can not read the plateform.txt file properly

Code: Select all

Warning: platform.txt from core 'STM32 Boards (STM32duino.com)' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
"/bin/arm-none-eabi-g++" ...

Nutsy
Posts: 260
Joined: Sun Jul 24, 2016 4:26 pm

Re: stepper.h

Post by Nutsy » Wed Jul 27, 2016 9:11 pm

Hmmm nope but I have been tidying up the library folder as i was trying all sorts and some conflicted...

Its possible i might have moved that file. Though its not there now. Im trying to find the download to put it back

Nutsy
Posts: 260
Joined: Sun Jul 24, 2016 4:26 pm

Re: stepper.h

Post by Nutsy » Thu Jul 28, 2016 12:27 am

found it, it in the hardware folder... looking inside the file it seems complete... no corrupted text, complete code. If there anything I can do to fix the links?

davey
Posts: 28
Joined: Sat Jun 17, 2017 8:49 pm

Re: stepper.h

Post by davey » Wed Jun 28, 2017 10:03 pm

Fast again? You mean it was working faster before or do you mean fast as compared to an Arduino?

I upgraded to STM32 partially because Arduino stepping is too slow. I hope it will be much faster though I'm also considering using hardware timers for pulses. Haven't found a lot of info in that. :-(

I wrote the Accelstepper code last night and hope to test it tonite :-) I'll let you know if I run across something related to your error but that sounds like a general tool chain issue than anything related to the library.

I'm a noob at stm32duino but if it were me I'd try reinstalling stm32duino. Maybe that'll restore the tool path. Which ide are you using?

Davey
Nutsy wrote:
Mon Jul 25, 2016 2:53 pm
I realise its a fairly simply control library, But ive noticed it doesn't seem to fully work under STM.

Running the same code in STM i get very very slow stepper move loops...
Anyone know whats causing it and how to make it go fast again? :D

Post Reply