Hi Dialog,
For my project I have configured debug prints to go over UART2, which I normally read using a terminal emulator program like picocom or miniterm.py, using the USB2(DBG) port. I can also read the logs using a USB to TTL adapter connected to P1_3 and P2_3 (default pin mapping for UART2 in most examples).
我想做的是读那些日志using the USB to TTL adapter while I'm charging with USB1(CHG). I'm using a USB to wall adapter to power the board, and the software appears to be functioning, but I'm getting garbage debug prints over UART2. In order to make the software functional, I had to enable this flag in my custom_config:
#define dg_configUSE_USB_CHARGER 1
Is there anything else I need to do to get serial working?
Device:
Hi ainwood87,
The problem you see with the UART does not have the root cause in the #define dg_configUSE_USB_CHARGER 1 macro definition.
What happens is that you probably have the VBAT supply at 3V. The external USB to UART TTL adapter usually works with 3.3-3.5V.
This triggers the protection on the pads and caused the problems you report.
When the #define dg_configUSE_USB_CHARGER 1 then when the USB1 is plugged the Charger is pumping the VBAT as it attempts to charge the supposed battery there and this compensates the electrical uneven voltage levels.
When the #define dg_configUSE_USB_CHARGER 0 then the USB supplies the system, but the voltages are still 3V on GPIOs and the GPIOS are going a little crazy.
Solution:
Guessing that you are using the PorDK.
Thanks, PM_Dialog