Stops play gcode file.

When playing a gcode file of abort 55000 lines, I am getting this:

G1X-18.524Y-23.430Z-2.488
                         ok
G1X-17.927Y-23.700Z-2.417
                         ok
G1X-17.435Y-23.753Z-2.311
                         ok
G1X-17.197Y-23.764Z-2.294
                         ok
G1X-16.966Y-23.759Z-2.288
                         ok
G1X-16.390Y-23.748Z-2.191
                         ok
G1X-16.044Y-23.741Z-2.187
                         ok

> G1X-8.608Y-22.852Z-2.543
ok
Entering boot mode…
G1X-8.114Y-22.876Z-2.376
ok
G1X-8.122Y-23.035Z-2.388
ok
G1X-7.889Y-23.053Z-2.365
ok
G1X-7.539Y-23.080Z-2.394
ok
G1X-6.957Y-23.147Z-2.515
ok
G1X-6.841Y-23.162Z-2.525
ok
G1X-6.724Y-23.176Z-2.505
ok
G1X-6.378Y-23.236Z-2.384
ok
G1X-5.543Y-23.396Z-2.197
ok
G1X-4.969Y-23.525Z-2.070
ok
G1X-4.176Y-23.748Z-2.036
ok
G1X-3.952Y-23.821Z-2.046
ok
G1X-3.728Y-23.895Z-2.093
ok
G1X-3.257Y-24.058Z-2.271
ok
G1X-2.709Y-24.267Z-2.453
ok
G1X-2.600Y-24.308Z-2.472
ok
G1X-1.851Y-24.641Z-2.341
ok
G1X-0.992Y-25.076Z-2.261
ok
G1X-0.416Y-25.397Z-2.280
ok
G1X0.330Y-25.860Z-2.340
ok
G1X0.557Y-25.940Z-2.389
ok
G1X1.012Y-26.101Z-2.545
ok
G1X1.349Y-26.229Z-2.525
ok
G1X2.250Y-26.621Z-2.390
ok
G1X2.593Y-26.608Z-2.329
ok
G1X2.936Y-26.595Z-2.339
ok
G1X3.852Y-26.604Z-2.480
ok
G1X4.192Y-26.564Z-2.521
ok
G1X4.532Y-26.524Z-2.516
ok
G1X5.153Y-26.295Z-2.465
ok
G1X5.783Y-26.093Z-2.330
ok

I have done several rebuilds with different options(disabled network support, touchprobe etc) but still get the same result. It stops at about line 18354-18359 everytime. I thought it might be memory issues, but I have caught it right before it gets to that line with:

mem

Unused Heap: 8752 bytes
Used Heap Size: 15744
Allocated: 12676, Free: 1516
Total Free RAM: 10268 bytes
Free AHB0: 15052, AHB1: 10456

I modifed SimpleShell.cpp

stream->printf("Entering boot mode...\r\n");
    //system_reset(true);

That got me past lines 18xxx but it still crashed again at about 22xxx with:

G1X8.074Y-29.786Z-2.678
                       ok
G1X8.411Y-29.713Z-2.656
                       ok
G1X8.866Y-29.640Z-2.554
                       ok
G1X9.227Y-29.586Z-2.524
                       ok
G1X9.723Y-29.534Z-2.529
                       ok
Aborted playing or paused file

And I didnt issue any commands or pause buttons etc.

My config file(kinda plain)

# Robot module configurations : general handling of movement G-codes and slicing into moves
default_feed_rate                            1000             # Default rate ( mm/minute ) for G1/G2/G3 moves
default_seek_rate                            1200             # Default rate ( mm/minute ) for G0 moves
mm_per_arc_segment                           0.5              # Arcs are cut into segments ( lines ), this is the length for these segments.  Smaller values mean more resolution, higher values mean faster computation
mm_per_line_segment                          5                # Lines can be cut into segments ( not usefull with cartesian coordinates robots ).

Arm solution configuration : Cartesian robot. Translates mm positions into stepper positions

alpha_steps_per_mm 320 # Steps per mm for alpha stepper
beta_steps_per_mm 320 # Steps per mm for beta stepper
gamma_steps_per_mm 320 # Steps per mm for gamma stepper

Planner module configuration : Look-ahead and acceleration configuration

planner_queue_size 32 # Size of the planning queue, must be a power of 2. 128 seems to be the maximum.
acceleration 900 # Acceleration in mm/second/second.
acceleration_ticks_per_second 1000 # Number of times per second the speed is updated
junction_deviation 0.05 #
# and have more jerk
#minimum_planner_speed 0.0 # sets the minimum planner speed in mm/sec

Stepper module configuration

microseconds_per_step_pulse 1 # Duration of step pulses to stepper drivers, in microseconds
minimum_steps_per_minute 1200 # Never step slower than this
base_stepping_frequency 100000 # Base frequency for stepping, higher gives smoother movement

Cartesian axis speed limits

x_axis_max_speed 1200 # mm/min
y_axis_max_speed 1200 # mm/min
z_axis_max_speed 650 # mm/min

Stepper module pins ( ports, and pin numbers, appending “!” to the number will invert a pin )

alpha_step_pin 2.0 # Pin for alpha stepper step signal
alpha_dir_pin 0.5 # Pin for alpha stepper direction
#alpha_dir_pin 2.6 # Pin for alpha stepper direction
alpha_en_pin 0.4 # Pin for alpha enable pin
alpha_current 1.5 # X stepper motor current
alpha_max_rate 1200.0 # mm/min

beta_step_pin 2.1 # Pin for beta stepper step signal
beta_dir_pin 0.11 # Pin for beta stepper direction
beta_en_pin 0.10 # Pin for beta enable
beta_current 1.5 # Y stepper motor current
beta_max_rate 1200.0 # mm/min

gamma_step_pin 2.2 # Pin for gamma stepper step signal
gamma_dir_pin 0.20! # Pin for gamma stepper direction
gamma_en_pin 0.19 # Pin for gamma enable
gamma_current 1.5 # Z stepper motor current
gamma_max_rate 650.0 # mm/min

Serial communications configuration ( baud rate default to 9600 if undefined )

uart0.baud_rate 115200 # Baud rate for the default hardware serial port
second_usb_serial_enable true # This enables a second usb serial port (to have both pronterface and a terminal connected)
#leds_disable true # disable using leds after config loaded

Extruder module configuration

extruder_module_enable false # Whether to activate the extruder module at all. All configuration is ignored if false
extruder_steps_per_mm 140 # Steps per mm for extruder stepper
extruder_default_feed_rate 600 # Default rate ( mm/minute ) for moves where only the extruder moves
extruder_acceleration 50 # Acceleration for the stepper motor, as of 0.6, arbitrary ratio
extruder_max_speed 1000 # mm^3/s

extruder_step_pin 2.3 # Pin for extruder step signal
extruder_dir_pin 0.22 # Pin for extruder dir signal
extruder_en_pin 0.21 # Pin for extruder enable signal
delta_current 1.5 # Extruder stepper motor current

Laser module configuration

laser_module_enable false # Whether to activate the laser module at all. All configuration is ignored if false.
#laser_module_pin 2.5 # this pin will be PWMed to control the laser. Only P2.0 - P2.5 can be used since laser requires hardware PWM
#laser_module_max_power 0.8 # this is the maximum duty cycle that will be applied to the laser
#laser_module_tickle_power 0.0 # this duty cycle will be used for travel moves to keep the laser active without actually burning
#laser_module_pwm_period 20 # this sets the pwm frequency, the value is the period in microseconds

Hotend temperature control configuration

temperature_control.hotend.enable false # Whether to activate this ( “hotend” ) module at all. All configuration is ignored if false.
temperature_control.hotend.thermistor_pin 0.23 # Pin for the thermistor to read
temperature_control.hotend.heater_pin 2.7 # Pin that controls the heater
temperature_control.hotend.thermistor EPCOS100K # see src/modules/tools/temperaturecontrol/TemperatureControl.cpp:64 for a list of valid thermistor names
temperature_control.hotend.set_m_code 104 #
temperature_control.hotend.set_and_wait_m_code 109 #
temperature_control.hotend.designator T #

#temperature_control.hotend.p_factor 13.7 # permanenetly set the PID values after an auto pid
#temperature_control.hotend.i_factor 0.097 #
#temperature_control.hotend.d_factor 24 #

#temperature_control.hotend.max_pwm 64 # override max pwm, 64 is a good value if driving a 12v resistor with 24v.

temperature_control.bed.enable false #
temperature_control.bed.thermistor_pin 0.24 #
temperature_control.bed.heater_pin 2.5 #
temperature_control.bed.thermistor Honeywell100K # see src/modules/tools/temperaturecontrol/TemperatureControl.cpp:64 for a list of valid thermistor names
temperature_control.bed.set_m_code 140 #
temperature_control.bed.set_and_wait_m_code 190 #
temperature_control.bed.designator B #

Switch module for fan control

switch.fan.enable false #
switch.fan.input_on_command M106 #
switch.fan.input_off_command M107 #
switch.fan.output_pin 2.6 #

#switch.misc.enable true #
#switch.misc.input_on_command M42 #
#switch.misc.input_off_command M43 #
#switch.misc.output_pin 2.4 #

Switch module for spindle control

#switch.spindle.enable false #

Endstops

endstops_enable true # the endstop module is enabled by default and can be disabled here
#corexy_homing false # set to true if homing on a hbit or corexy
alpha_min_endstop 1.24!^ # add a ! to invert if endstop is NO connected to ground
alpha_max_endstop 1.25!^ #
alpha_homing_direction home_to_min # or set to home_to_max and set alpha_max
alpha_min 0 # this gets loaded after homing when home_to_min is set
alpha_max 1300 # this gets loaded after homing when home_to_max is set
beta_min_endstop 1.26!^ #
beta_max_endstop 1.27!^ #
beta_homing_direction home_to_min #
beta_min 0 #
beta_max 900 #
gamma_min_endstop 1.28!^ #
gamma_max_endstop 1.29!^ #
gamma_homing_direction home_to_min #
gamma_min 0 #
gamma_max 400 #

alpha_fast_homing_rate_mm_s 18 # feedrates in mm/second
beta_fast_homing_rate_mm_s 18 # "
gamma_fast_homing_rate_mm_s 4 # "
alpha_slow_homing_rate_mm_s 5 # "
beta_slow_homing_rate_mm_s 5 # "
gamma_slow_homing_rate_mm_s 2 # "

alpha_homing_retract_mm 20 # distance in mm
beta_homing_retract_mm 20 # "
gamma_homing_retract_mm 10 # "

#endstop_debounce_count 100 # uncomment if you get noise on your endstops

Pause button

pause_button_enable true #
pause_button_pin 2.12!^

Panel

panel.enable false # set to true to enable the panel code
#panel.lcd smoothiepanel # set type of panel also viki_lcd, i2c_lcd is a generic i2c panel, panelolu2
#panel.encoder_a_pin 3.25!^ # encoder pin
#panel.encoder_b_pin 3.26!^ # encoder pin

Example for reprap discount GLCD

on glcd EXP1 is to left and EXP2 is to right, pin 1 is bottom left, pin 2 is top left etc.

+5v is EXP1 pin 10, Gnd is EXP1 pin 9

#panel.lcd reprap_discount_glcd #

#panel.lcd st7565_glcd #

panel.lcd universal_adapter #

panel.spi_channel 0 # spi channel to use ; GLCD EXP1 Pins 3,5 (MOSI, SCLK)
panel.spi_cs_pin 0.16 # spi chip select ; GLCD EXP1 Pin 4
panel.busy_pin 2.13
#panel.encoder_a_pin 3.25!^ # encoder pin ; GLCD EXP2 Pin 3
#panel.encoder_b_pin 3.26!^ # encoder pin ; GLCD EXP2 Pin 5
#panel.click_button_pin 1.30!^ # click button ; GLCD EXP1 Pin 2
#panel.buzz_pin 1.31 # pin for buzzer ; GLCD EXP1 Pin 1
#panel.button_pause_pin 2.11^ # kill/pause ; GLCD EXP2 Pin 8
#panel.rst_pin 1.22
#panel.a0_pin 2.13
#panel.reversed true

pins used with other panels

#panel.up_button_pin 0.1! # up button if used
#panel.down_button_pin 0.0! # down button if used
#panel.click_button_pin 0.18! # click button if used
#panel.i2c_pins 3
#panel.i2c_address 0
#panel.i2c_frequency
#panel.i2c_interrupt_pin
panel.menu_offset 0 # some panels will need 1 here

panel.alpha_jog_feedrate 6000 # x jogging feedrate in mm/min
panel.beta_jog_feedrate 6000 # y jogging feedrate in mm/min
panel.gamma_jog_feedrate 200 # z jogging feedrate in mm/min

panel.hotend_temperature 185 # temp to set hotend when preheat is selected
panel.bed_temperature 60 # temp to set bed when preheat is selected

Example of a custom menu entry, which will show up in the Custom entry.

NOTE _ gets converted to space in the menu and commands, | is used to separate multiple commands

#custom_menu.power_on.enable true #
#custom_menu.power_on.name Power_on #
#custom_menu.power_on.command M80 #

#custom_menu.power_off.enable true #
#custom_menu.power_off.name Power_off #
#custom_menu.power_off.command M81 #

Only needed on a smoothieboard

currentcontrol_module_enable false #

return_error_on_unhandled_gcode true #

network settings

network.enable true # enable the ethernet network services
network.webserver.enable true # enable the webserver
network.telnet.enable true # enable the telnet server
#network.ip_address auto # use dhcp to get ip address

uncomment the 3 below to manually setup ip address

network.ip_address 192.168.1.254 # the IP address
network.ip_mask 255.255.255.0 # the ip mask
network.ip_gateway 192.168.1.1 # the gateway address

#network.ip_address 207.126.40.178 # the IP address
#network.ip_mask 255.255.255.224 # the ip mask
#network.ip_gateway 207.126.40.161 # the gateway address
#network.mac_override xx.xx.xx.xx.xx.xx # override the mac address, only do this if you have a conflict

Imported from wikidot

Can you try with a queue size of 16 ?

Sorry forgot to mention i did, no change. also tried 64 also no change.

Can you try with panel and ethernet fully disabled ?

I have tried it without network(src\makefile export NONETWORK = 1), but I dont have a working panel. I have used just serial console but still get the same result. I’ve been beating my head on this all week before I posted here. But at this point I have ran out of things to try(that I know of).

Can I see more lines ( about 100 ) before the moment it crashes ?

Sure I will run it again, also not sure if it matters but I’m using a LPC1769 board.

You mean you are using a lcpxpresso or the like instead of a smoothieboard or azteeg X5 ?

Correct, its a lpcxpresso LPC1769, I cant afford a smoothieboard(yet) but I already had the LPC1769.

It might look like for some reason the board thinks the “bootloader” button ( that is used for flashing the bootloader so you probably have it wired ) is being pressed.

I have no idea however at this point why that would happen always at the same point in the file …

I will look into that but so far so good with the changes to “SimplePlayer.cpp” and these to “Player.cpp”

void Player::abort_command( string parameters, StreamOutput *stream )
{
   /* if(!playing_file && current_file_handler == NULL) {
        stream->printf("Not currently playing\r\n");
        return;
    }
    playing_file = false;
    played_cnt = 0;
    file_size = 0;
    this->filename = "";
    this->current_stream = NULL;
    fclose(current_file_handler);
    current_file_handler = NULL;
    stream->printf("Aborted playing or paused file\r\n");
    */
    stream->printf("Told to abort for some reason but aint gonna do it.\r\n");
}

Its made it past line 35xxx which is the longest its made it thus far.

I’ll bet the problem is that fact you have no spaces in your gcode. This is really bad practice. what happens is it thinks the entire line is one command, and generates a hash for it, which eventually matches a console command by pure random chance.

I recommend you format your gcode in the recommended way with spaces in between the Gx and the other parameters and this problem will go away. all you did was hide the matches, but much worse matches could occur.

FYI this is now fixed in edge, we no longer use checksums to match commands.