Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 6 months ago.
Serial interrupt causes the TX to stop working after a while
Setup:
- board: NUCLEO-F411RE
- IDE: https://developer.mbed.org/compiler/
- OS: Windows 7
- library: mbed.h
- serial used: UART 6
Code: https://developer.mbed.org/users/ElectronicsSanta/code/Adafruit_GPS_test/rev/5c7edbae459d
Intro: The code above is a stripped down version from a project I'm working on.
Problem: If the code inside the serialRxInterrupt function is commented out, the GPS and the board work perfectly together. The GPS goes into standby and wakes up correctly. If the code remains as is on the above link, the board stops sending TX signals on serial after a while. A screenshot from Saleae Logic: https://i.imgur.com/j5dVd4f.png
The cause of this problem was calling gps.getc() while commands are being sent to the GPS. To get around this, the interrupts will not call gps.getc() while the MCU sends commands to the GPS. Code with changes: https://developer.mbed.org/users/ElectronicsSanta/code/Adafruit_GPS_test/rev/398211e4e73c
posted by Carter John 04 Jul 2017