You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, cool project. Thanks for the work so far; It's been helpful while developing a GRBL control program.
I've got an issue though:
When i push enough commands to fill Grbl's planner buffer, realtime commands stop working. eg: "?" no longer triggers a status update.
You can see above me sending Gcode until i stop getting "ok" back. Ie, the planner buffer has filled.
After that, sometimes a "?" returns a status report but usually it does not.
I've dug around in the code for a day.
Grbl's ISR(SERIAL_RX) is definitely receiving the serial port data.
The following modifications can be used to prove this:
in ./grbl-sim/serial.c:
[...SNIP...]
extern volatile uint8_t serial_tx_buffer_head;
extern volatile uint8_t serial_tx_buffer_tail;
extern volatile uint8_t serial_rx_buffer_head;
extern volatile uint8_t serial_rx_buffer_tail;
extern volatile uint8_t sys_rt_exec_state;
void simulate_read_interrupt(){
uint8_t char_in = platform_poll_stdin();
if (char_in) {
UDR0 = char_in;
//EOF or CTRL-F to exit
if (UDR0 == EOF || UDR0 == 0xFF || UDR0 == 0x06 ) {
sim.exit = exit_REQ;
}
//debugging
if (UDR0 == '%') {
printf("%ld %f\n",sim.masterclock,(double)sim.sim_time);
printf("serial_tx_buffer_tail: %i serial_tx_buffer_head: %i\n",
serial_tx_buffer_tail, serial_tx_buffer_head);
printf("serial_rx_buffer_tail: %i serial_rx_buffer_head: %i\n",
serial_rx_buffer_tail, serial_rx_buffer_head);
printf("sys_rt_exec_state: 0x%x\n", sys_rt_exec_state);
}
interrupt_SERIAL_RX();
// The following line shows the EXEC_STATUS_REPORT flag is always correctly set.
printf("sys_rt_exec_state: 0x%x\n", sys_rt_exec_state);
}
}
uint8_t count = 0;
void simulate_serial(){
simulate_write_interrupt();
simulate_read_interrupt();
}
If you compile the above you'll see the serial_rx_buffer is still filling for all non realtime commands
and for realtime commands the flags are getting set in sys_rt_exec_state.
So since realtime commands work /before/ the planned buffer fills but not afterwards...
i presume Grbl is making more calls to protocol_execute_realtime() in the before case.
I can't seem to find where in Grbl code consuming data from serial_read() blocks once the planned buffer is full....
Any thoughts?
The text was updated successfully, but these errors were encountered:
Hi, cool project. Thanks for the work so far; It's been helpful while developing a GRBL control program.
I've got an issue though:
When i push enough commands to fill Grbl's planner buffer, realtime commands stop working. eg: "?" no longer triggers a status update.
My system:
Steps to reproduce:
You can see above me sending Gcode until i stop getting "ok" back. Ie, the planner buffer has filled.
After that, sometimes a "?" returns a status report but usually it does not.
I've dug around in the code for a day.
Grbl's
ISR(SERIAL_RX)
is definitely receiving the serial port data.The following modifications can be used to prove this:
in
./grbl-sim/serial.c
:If you compile the above you'll see the
serial_rx_buffer
is still filling for all non realtime commandsand for realtime commands the flags are getting set in
sys_rt_exec_state
.So since realtime commands work /before/ the planned buffer fills but not afterwards...
i presume Grbl is making more calls to
protocol_execute_realtime()
in the before case.I can't seem to find where in Grbl code consuming data from
serial_read()
blocks once the planned buffer is full....Any thoughts?
The text was updated successfully, but these errors were encountered: