Skip to content

API change, uart input not working anymore on previously working setups #11525

@cladmi

Description

@cladmi

Description

Since #11310 applications that were relying on getchar and were previously working stopped working.
I do not know if the impact is on other functions by default too or not.

This is an API change and was review without putting the label and merged without respecting the 2 ACKs for it.

I noticed this when running the test for #11493 with the last master.
I got weird "time took less time than expected" and thought it was missing a synchronization mechanism, so ignored this when merging as was unrelated.

The test was relying on getchar which now does not block and silently returns.

Steps to reproduce the issue

I found it by doing:

make -C tests/xtimer_usleep test

make -C tests/xtimer_usleep flash

Expected results

The firmware waits for input:

�main(): This is RIOT! (Version: 2019.04-devel-308-g2bfa0-HEAD)                                                                                                                                                                                                                           
Running test 5 times with 7 distinct sleep times                                                                                                                                                                                                                                          
Please hit any key and then ENTER to continue                                                                                                                                                                                                                                             

Actual results

The firmware does not wait.

make: Entering directory '/home/harter/work/git/RIOT/tests/xtimer_usleep'                                                                                                                                                                                                                 
/home/harter/work/git/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"                                                                                                                                                                                                         
Twisted not available, please install it if you want to use pyterm's JSON capabilities                                                                                                                                                                                                    
2019-05-14 13:10:39,720 - INFO # Connect to serial port /dev/ttyACM0                                                                                                                                                                                                                      
Welcome to pyterm!                                                                                                                                                                                                                                                                        
Type '/exit' to exit.                                                                                                                                                                                                                                                                     
2019-05-14 13:10:42,435 - INFO # main(): This is RIOT! (Version: 2019.07-devel-266-gdde4f)                                                                                                                                                                                                
2019-05-14 13:10:42,439 - INFO # Running test 5 times with 7 distinct sleep times                                                                                                                                                                                                         
2019-05-14 13:10:42,443 - INFO # Please hit any key and then ENTER to continue                                                                                                                                                                                                            
2019-05-14 13:10:42,458 - INFO # Slept for 10052 us (expected: 10000 us) Offset: 52 us                                                                                                                                                                                                    
2019-05-14 13:10:42,513 - INFO # Slept for 50052 us (expected: 50000 us) Offset: 52 us
2019-05-14 13:10:42,529 - INFO # Slept for 10286 us (expected: 10234 us) Offset: 52 us
2019-05-14 13:10:42,590 - INFO # Slept for 56832 us (expected: 56780 us) Offset: 52 us
2019-05-14 13:10:42,608 - INFO # Slept for 12174 us (expected: 12122 us) Offset: 52 us
2019-05-14 13:10:42,712 - INFO # Slept for 98817 us (expected: 98765 us) Offset: 52 us
2019-05-14 13:10:42,792 - INFO # Slept for 75052 us (expected: 75000 us) Offset: 52 us
2019-05-14 13:10:42,807 - INFO # Slept for 10052 us (expected: 10000 us) Offset: 52 us
2019-05-14 13:10:42,862 - INFO # Slept for 50052 us (expected: 50000 us) Offset: 52 us
2019-05-14 13:10:42,877 - INFO # Slept for 10286 us (expected: 10234 us) Offset: 52 us
2019-05-14 13:10:42,940 - INFO # Slept for 56832 us (expected: 56780 us) Offset: 52 us
2019-05-14 13:10:42,956 - INFO # Slept for 12174 us (expected: 12122 us) Offset: 52 us
2019-05-14 13:10:43,060 - INFO # Slept for 98817 us (expected: 98765 us) Offset: 52 us
2019-05-14 13:10:43,140 - INFO # Slept for 75052 us (expected: 75000 us) Offset: 52 us
2019-05-14 13:10:43,155 - INFO # Slept for 10052 us (expected: 10000 us) Offset: 52 us
2019-05-14 13:10:43,211 - INFO # Slept for 50052 us (expected: 50000 us) Offset: 52 us

Versions

After #11310

So current master e40f483

Metadata

Metadata

Labels

Impact: majorThe PR changes a significant part of the code base. It should be reviewed carefullyType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions