mirror of
https://github.com/pine64/blisp.git
synced 2026-09-18 08:51:31 +00:00
Final support of flashing on macOS
For some reason, macOS have issues with USB CDC, surprisingly, CH340G convertor works just fine. But FTDI and Bouffalo's USB CDC didn't worked. Basically, without writing anything, we don't receive response from board. This was fixed by adding drain after writing BOUFALLOLABRESET handshake + adding drains after every commmand write. Also, for some reason, in USB CDC, the size of USB payload is limited, else it will fail.
This commit is contained in:
@@ -130,6 +130,10 @@ int32_t blisp_send_command(struct blisp_device* device,
|
||||
blisp_dlog("Received error or not written all data: %d", ret);
|
||||
return BLISP_ERR_UNKNOWN;
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
sp_drain(serial_port);
|
||||
#endif
|
||||
|
||||
return BLISP_OK;
|
||||
}
|
||||
|
||||
@@ -191,6 +195,9 @@ int32_t blisp_device_handshake(struct blisp_device* device, bool in_ef_loader) {
|
||||
if (!in_ef_loader) {
|
||||
if (device->is_usb) {
|
||||
sp_blocking_write(serial_port, "BOUFFALOLAB5555RESET\0\0", 22, 100);
|
||||
#ifdef __APPLE__
|
||||
sp_drain(serial_port);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
ret = sp_blocking_write(serial_port, handshake_buffer, bytes_count, 500);
|
||||
@@ -210,6 +217,7 @@ int32_t blisp_device_handshake(struct blisp_device* device, bool in_ef_loader) {
|
||||
return BLISP_OK;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
blisp_dlog("Received no response from chip.");
|
||||
return BLISP_ERR_NO_RESPONSE;
|
||||
|
||||
Reference in New Issue
Block a user