File tree Expand file tree Collapse file tree 9 files changed +30
-14
lines changed Expand file tree Collapse file tree 9 files changed +30
-14
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ jobs:
103
103
run : timeout 10 bash espflash/tests/scripts/board-info.sh
104
104
105
105
- name : flash test
106
- run : timeout 60 bash espflash/tests/scripts/flash.sh ${{ matrix.board.mcu }}
106
+ run : timeout 80 bash espflash/tests/scripts/flash.sh ${{ matrix.board.mcu }}
107
107
108
108
- name : monitor test
109
109
run : timeout 10 bash espflash/tests/scripts/monitor.sh
@@ -116,7 +116,7 @@ jobs:
116
116
timeout 90 bash espflash/tests/scripts/save-image_write-bin.sh ${{ matrix.board.mcu }}
117
117
118
118
- name : erase-region test
119
- run : timeout 15 bash espflash/tests/scripts/erase-region.sh
119
+ run : timeout 30 bash espflash/tests/scripts/erase-region.sh
120
120
121
121
- name : hold-in-reset test
122
122
run : timeout 10 bash espflash/tests/scripts/hold-in-reset.sh
Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
50
50
- Updated bootloaders with ` release/v5.4 ` ones from IDF (#857 )
51
51
- Refactor image formatting to allow supporting more image formats in a backward compatible way (#877 )
52
52
- Avoid having ESP-IDF format assumptions in the codebase (#877 )
53
- - Automatically migrate ` espflash@3 ` configuration files to the new format (#883 )
54
- - ` Flasher ` now takes the ` Connection ` in new, instead of constructing the connection inside ` Flasher::connect ` (#882 )
53
+ - ` Flasher ` now takes the ` Connection ` in new, instead of constructing the connection inside ` Flasher::connect ` (#882 , #885 )
55
54
- ` detect_chip ` has moved to the ` Connection ` struct (#882 )
56
55
- ` Flasher::into_serial ` has been replaced by ` Flasher::into_connection ` (#882 )
56
+ - Automatically migrate ` espflash@3 ` configuration files to the new format (#883 )
57
57
58
58
### Fixed
59
59
Original file line number Diff line number Diff line change @@ -453,6 +453,7 @@ pub fn connect(
453
453
!no_verify,
454
454
!no_skip,
455
455
args. chip ,
456
+ args. baud . or ( config. project_config . baudrate ) ,
456
457
) ?)
457
458
}
458
459
Original file line number Diff line number Diff line change @@ -398,9 +398,9 @@ impl Connection {
398
398
Ok ( ( ) )
399
399
}
400
400
401
- /// Get the current baud rate of the serial port.
402
- pub fn baud ( & self ) -> u32 {
403
- self . baud
401
+ // Get the current baud rate of the serial port.
402
+ pub fn baud ( & self ) -> Result < u32 , Error > {
403
+ Ok ( self . serial . baud_rate ( ) ? )
404
404
}
405
405
406
406
/// Run a command with a timeout defined by the command type.
Original file line number Diff line number Diff line change @@ -648,6 +648,7 @@ impl Flasher {
648
648
verify : bool ,
649
649
skip : bool ,
650
650
chip : Option < Chip > ,
651
+ baud : Option < u32 > ,
651
652
) -> Result < Self , Error > {
652
653
// The connection should already be established with the device using the
653
654
// default baud rate of 115,200 and timeout of 3 seconds.
@@ -706,9 +707,11 @@ impl Flasher {
706
707
707
708
// Now that we have established a connection and detected the chip and flash
708
709
// size, we can set the baud rate of the connection to the configured value.
709
- if flasher. connection . baud ( ) > 115_200 {
710
- warn ! ( "Setting baud rate higher than 115,200 can cause issues" ) ;
711
- flasher. change_baud ( flasher. connection . baud ( ) ) ?;
710
+ if let Some ( baud) = baud {
711
+ if baud > 115_200 {
712
+ warn ! ( "Setting baud rate higher than 115,200 can cause issues" ) ;
713
+ flasher. change_baud ( baud) ?;
714
+ }
712
715
}
713
716
714
717
Ok ( flasher)
@@ -1132,7 +1135,7 @@ impl Flasher {
1132
1135
debug ! ( "Change baud to: {}" , baud) ;
1133
1136
1134
1137
let prior_baud = match self . use_stub {
1135
- true => self . connection . baud ( ) ,
1138
+ true => self . connection . baud ( ) ? ,
1136
1139
false => 0 ,
1137
1140
} ;
1138
1141
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ impl Target for Esp32 {
149
149
#[ cfg( feature = "serialport" ) ]
150
150
fn crystal_freq ( & self , connection : & mut Connection ) -> Result < XtalFrequency , Error > {
151
151
let uart_div = connection. read_reg ( UART_CLKDIV_REG ) ? & UART_CLKDIV_MASK ;
152
- let est_xtal = ( connection. baud ( ) * uart_div) / 1_000_000 / XTAL_CLK_DIVIDER ;
152
+ let est_xtal = ( connection. baud ( ) ? * uart_div) / 1_000_000 / XTAL_CLK_DIVIDER ;
153
153
let norm_xtal = if est_xtal > 33 {
154
154
XtalFrequency :: _40Mhz
155
155
} else {
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ impl Target for Esp32c2 {
76
76
#[ cfg( feature = "serialport" ) ]
77
77
fn crystal_freq ( & self , connection : & mut Connection ) -> Result < XtalFrequency , Error > {
78
78
let uart_div = connection. read_reg ( UART_CLKDIV_REG ) ? & UART_CLKDIV_MASK ;
79
- let est_xtal = ( connection. baud ( ) * uart_div) / 1_000_000 / XTAL_CLK_DIVIDER ;
79
+ let est_xtal = ( connection. baud ( ) ? * uart_div) / 1_000_000 / XTAL_CLK_DIVIDER ;
80
80
let norm_xtal = if est_xtal > 33 {
81
81
XtalFrequency :: _40Mhz
82
82
} else {
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ impl Target for Esp32c5 {
78
78
#[ cfg( feature = "serialport" ) ]
79
79
fn crystal_freq ( & self , connection : & mut Connection ) -> Result < XtalFrequency , Error > {
80
80
let uart_div = connection. read_reg ( UART_CLKDIV_REG ) ? & UART_CLKDIV_MASK ;
81
- let est_xtal = ( connection. baud ( ) * uart_div) / 1_000_000 / XTAL_CLK_DIVIDER ;
81
+ let est_xtal = ( connection. baud ( ) ? * uart_div) / 1_000_000 / XTAL_CLK_DIVIDER ;
82
82
let norm_xtal = if est_xtal > 45 {
83
83
XtalFrequency :: _48Mhz
84
84
} else {
Original file line number Diff line number Diff line change @@ -53,3 +53,15 @@ if ! echo "$result" | grep -q "Hello world!"; then
53
53
echo " Monitoring failed!"
54
54
exit 1
55
55
fi
56
+
57
+ # Test with a higher baud rate
58
+ result=$( timeout 15s espflash flash --no-skip --monitor --non-interactive --baud 921600 $app 2>&1 | tr -d ' \0' )
59
+ echo " $result "
60
+ if [[ ! $result =~ " Flashing has completed!" ]]; then
61
+ echo " Flashing failed!"
62
+ exit 1
63
+ fi
64
+ if ! echo " $result " | grep -q " Hello world!" ; then
65
+ echo " Monitoring failed!"
66
+ exit 1
67
+ fi
You can’t perform that action at this time.
0 commit comments