Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions scum_programmer/nrf-fw/hdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions scum_programmer/nrf-fw/scum-programmer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scum_programmer/programmer/scum.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Constants
USB_CHUNK_SIZE = 64
CHUNK_SIZE = 128
CHUNK_SIZE = 1024


class Command(IntEnum):
Expand Down