Fix handshake procedure :

- set RST and P8 low
 - wait
 - set P8 high
 - wait
 - set RST high

Also, do not reset again when sending the 2nd handshake.
This commit is contained in:
Jean-François Milants 2022-11-09 21:09:47 +01:00
parent 6e036df085
commit 48ecd90f71
2 changed files with 3 additions and 3 deletions

View File

@ -143,9 +143,9 @@ blisp_device_handshake(struct blisp_device* device, bool in_ef_loader) {
sp_set_rts(serial_port, SP_RTS_ON);
sp_set_dtr(serial_port, SP_DTR_ON);
sleep_ms(50);
sp_set_rts(serial_port, SP_RTS_OFF);
sleep_ms(100);
sp_set_dtr(serial_port, SP_DTR_OFF);
sleep_ms(100);
sp_set_rts(serial_port, SP_RTS_OFF);
}
uint32_t bytes_count = device->chip->handshake_byte_multiplier * (float)device->current_baud_rate / 10.0f;

View File

@ -318,7 +318,7 @@ void blisp_flash_firmware() {
}
printf("Sending a handshake...");
ret = blisp_device_handshake(&device, false);
ret = blisp_device_handshake(&device, true);
if (ret != 0) {
fprintf(stderr, "\nFailed to handshake with device.\n");
goto exit1;