diff --git a/scum_programmer/nrf-fw/hdlc.c b/scum_programmer/nrf-fw/hdlc.c index f8bfa10..8746189 100644 --- a/scum_programmer/nrf-fw/hdlc.c +++ b/scum_programmer/nrf-fw/hdlc.c @@ -4,17 +4,17 @@ //=========================== definitions ====================================== -#define HDLC_BUFFER_SIZE (UINT8_MAX) ///< Maximum size of the RX buffer -#define HDLC_FLAG (0x7E) ///< Start/End flag -#define HDLC_FLAG_ESCAPED (0x5E) ///< Start/End flag escaped -#define HDLC_ESCAPE (0x7D) ///< Data escape byte -#define HDLC_ESCAPE_ESCAPED (0x5D) ///< Escape flag escaped -#define HDLC_FCS_INIT (0xFFFF) ///< Initialization value of the FCS -#define HDLC_FCS_OK (0xF0B8) ///< Expected value of the FCS +#define HDLC_BUFFER_SIZE (2048U) ///< Maximum size of the RX buffer +#define HDLC_FLAG (0x7E) ///< Start/End flag +#define HDLC_FLAG_ESCAPED (0x5E) ///< Start/End flag escaped +#define HDLC_ESCAPE (0x7D) ///< Data escape byte +#define HDLC_ESCAPE_ESCAPED (0x5D) ///< Escape flag escaped +#define HDLC_FCS_INIT (0xFFFF) ///< Initialization value of the FCS +#define HDLC_FCS_OK (0xF0B8) ///< Expected value of the FCS typedef struct { uint8_t buffer[HDLC_BUFFER_SIZE]; ///< Input buffer - uint8_t buffer_pos; ///< Current position in the input buffer + uint16_t buffer_pos; ///< Current position in the input buffer hdlc_state_t state; ///< Current state of the HDLC RX engine uint16_t fcs; ///< Current value of the FCS } hdlc_vars_t; @@ -103,7 +103,7 @@ size_t hdlc_decode(uint8_t *output) { return output_pos; } - uint8_t input_pos = 0; + uint16_t input_pos = 0; bool escape_byte = false; while (input_pos < _hdlc_vars.buffer_pos) { uint8_t current_byte = _hdlc_vars.buffer[input_pos]; diff --git a/scum_programmer/nrf-fw/scum-programmer.c b/scum_programmer/nrf-fw/scum-programmer.c index af521df..5915710 100644 --- a/scum_programmer/nrf-fw/scum-programmer.c +++ b/scum_programmer/nrf-fw/scum-programmer.c @@ -15,8 +15,8 @@ SCuM programmer. //=========================== defines ========================================= #define UART_BUF_SIZE (32U) -#define COMMAND_BUF_SIZE (256U) -#define CHUNK_SIZE (128U) +#define COMMAND_BUF_SIZE (2048U) +#define CHUNK_SIZE (1024U) #define SCUM_MEM_SIZE (1 << 16) // 64KiB #define CALIBRATION_PORT 0UL diff --git a/scum_programmer/programmer/scum.py b/scum_programmer/programmer/scum.py index c3c952a..58a0f76 100644 --- a/scum_programmer/programmer/scum.py +++ b/scum_programmer/programmer/scum.py @@ -12,7 +12,7 @@ # Constants USB_CHUNK_SIZE = 64 -CHUNK_SIZE = 128 +CHUNK_SIZE = 1024 class Command(IntEnum):