Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAX32625PICO transmits UART data twice when built with GCC #1023

Open
bridadan opened this issue Apr 4, 2023 · 0 comments
Open

MAX32625PICO transmits UART data twice when built with GCC #1023

bridadan opened this issue Apr 4, 2023 · 0 comments

Comments

@bridadan
Copy link

bridadan commented Apr 4, 2023

Hello DAPLink team!

I've been tracking down an issue when using the MAX32625PICO. I have a local build of the FW, built from the 0257 release. I include a small change that makes the PICO use the DIP pins instead of the SWD header by default: https://github.com/bridadan/DAPLink/tree/debug_double_tx

I'm building with GCC: python tools/progen_compile.py --toolchain make_gcc_arm max32625_if --clean. And I'm using just the interface build since I don't want the MSD feature (though I've confirmed it also appears when the MSD is active using the max32625_max32620fthr_if project).

The issue is occasionally the PICO will transmit some UART data twice, even though I've only sent it once. Here's my test setup:

  1. One PICO setup as a transmitter, another setup as a receiver (DIP P0_1 from the TX connected to DIP P0_0 on the RX)
  2. A Saleae logic analyzer connected to the UART line to serve as a ground truth
  3. Kernel level USB traffic snooping using the usbmon kernel module and wireshark for trace capture

Each PICO is being controlled by a Python script (present in my branch above):

  • The transmitter is controlled by serial_stress_test_tx.py
  • The receiver is controlled by serial_stress_test_rx.py

The transmitter and receiver are synchronized by first sending an s character (since I was having issues with data remaining in the buffer). Once that's done, the transmitter will transmit an integer followed by a \n. The integer increases by one each transmit. The receive will look for any transmissions that don't follow this sequence and it will print the line it received. This allows you to then match up the bad line with what was measured by the Saleae and the USB trace.

I've attached my Saleae capture (.sal) and the Wireshark USB trace (.pcapng) below. You can see that the line that includes 27 was transmitted twice by the PICO but it was only commanded once in the USB trace (filter with usb.device_address==52 to only see messages sent to the PICO).

Screenshot from 2023-04-04 09-42-45

double_tx_27.zip

The interesting thing with all of this is it doesn't appear to be an issue on the released 0257 build using armcc. I don't have access to a copy of armcc so I can't verify it locally.

One thing I can say is I made some modifications to the firmware to try and figure out if its a bug in the UART driver or if its somewhere in the USB stack. I know that uart_write_data() is being called twice with the same contents (same length, same buffer), so that leads me to believe that the error is occurring before the UART driver. Hopefully that helps narrow it down, I'd appreciate any ideas or pointers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant