File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed
mbed_drivers/reset_reason Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 49
49
#define MSG_KEY_RESET_REASON " reason"
50
50
#define MSG_KEY_DEVICE_RESET " reset"
51
51
52
- #define SERIAL_FLUSH_TIME_MS 20
52
+ /* To prevent a loss of Greentea data, the serial buffers have to be flushed
53
+ * before the UART peripheral shutdown. The UART shutdown happens when the
54
+ * device is entering the deepsleep mode or performing a reset.
55
+ *
56
+ * With the current API, it is not possible to check if the hardware buffers
57
+ * are empty. However, it is possible to determine the time required for the
58
+ * buffers to flush.
59
+ *
60
+ * Assuming the biggest Tx FIFO of 128 bytes (as for CY8CPROTO_062_4343W)
61
+ * and a default UART config (9600, 8N1), flushing the Tx FIFO wold take:
62
+ * (1 start_bit + 8 data_bits + 1 stop_bit) * 128 * 1000 / 9600 = 133.3 ms.
63
+ * To be on the safe side, set the wait time to 150 ms.
64
+ */
65
+ #define SERIAL_FLUSH_TIME_MS 150
53
66
54
67
typedef enum {
55
68
CMD_STATUS_CONTINUE,
Original file line number Diff line number Diff line change 49
49
#define MSG_KEY_RESET_REASON " reason"
50
50
#define MSG_KEY_DEVICE_RESET " reset"
51
51
52
- /* To prevent loss of Greentea data, flush serial buffers before the UART peripheral shutdown. The UART shutdown happens when the
52
+ /* To prevent a loss of Greentea data, the serial buffers have to be flushed
53
+ * before the UART peripheral shutdown. The UART shutdown happens when the
53
54
* device is entering the deepsleep mode or performing a reset.
54
55
*
55
56
* With the current API, it is not possible to check if the hardware buffers
56
- * are empty. However, you can determine the amount of time required for the
57
+ * are empty. However, it is possible to determine the time required for the
57
58
* buffers to flush.
58
59
*
59
- * For example, NUMAKER_PFM_NUC472:
60
- * The UART peripheral has 16-byte Tx FIFO. With a baud rate of 9600,
61
- * flushing the Tx FIFO would take: 16 * 8 * 1000 / 9600 = 13 .3 ms.
62
- * To be on the safe side, set the wait time to 20 ms.
60
+ * Assuming the biggest Tx FIFO of 128 bytes (as for CY8CPROTO_062_4343W)
61
+ * and a default UART config (9600, 8N1), flushing the Tx FIFO wold take:
62
+ * (1 start_bit + 8 data_bits + 1 stop_bit) * 128 * 1000 / 9600 = 133 .3 ms.
63
+ * To be on the safe side, set the wait time to 150 ms.
63
64
*/
64
- #define SERIAL_FLUSH_TIME_MS 20
65
+ #define SERIAL_FLUSH_TIME_MS 150
65
66
66
67
typedef enum {
67
68
CMD_STATUS_CONTINUE,
You can’t perform that action at this time.
0 commit comments