2023-02-24 08:53 AM
Using a Discovery L0538, and want to make use of the 2nd UART (really only need the RX on pin PA3). I noted in the User Manual that to disable the onboard touch sensor and use this pin, I need to jump solder bridge SB24 (which I did, alng with the other five SBs next to it).
However, this pin appears stuck low when I try to receive data on it (all zeroes). I am using a RS232 to TTL converter board to send data to it. If I remove the wire from the converter to PA3, I can see the correct data from the converter board. But as soon as a solder it back to PA3 all I get is zeroes. I config'd the UART with MXCube; note that UART1 is working fine.
Have I missed something else to get this pin working as a UART? I verified with a DMM the solder bridges have continuity. Not detecting a short to ground on PA3. Tried enabling the pullup on that pin, no change.
2023-02-28 06:32 AM
Oh I see. Okay.
GPIOA_IDR=0x460c which means that the mcu sees PA3 to be high.
At the same time, USART2 has a confusing set of flags set in ISR, indicating indeed an excessively long (FE = 1) zero (RDR = 0). It might indicate a past event, though.
My reading of the schematics is, that the 47nF (C14) sampling capacitor is permanently attached to PA3. That might "generate" an "initial zero", but I don't think it would load the the USART/USB converter's ouput so that it would be unable to work.
Try in code to set PA3 as GPIO input first, with pullup switched on, then wait until it goes high, and enable USART only after that. Verify, that you are connecting the external converter to PA3 indeed - maybe try first just leave PA3 as input (perhaps with a pullup switched on), and using some flying wire connect the position where you're going to connect the converter to ground and observe in debugger whether bit 3 of GPIOA_IDR changes appropriately.
JW
PS. You don't use the touch, do you?
2023-02-28 07:18 AM
I will try this, thank you so much. And no, I do not use the touch.
2023-03-02 06:44 AM
I tried setting PA3 as an input (with pullup), waiting to see it go high, then enabling UART2. No change. Out of desperation, I also pulled C14. No change. I am officially stumped.
2023-03-02 09:35 AM
I just checked, and PA3 is connected to SB27, not SB24.
Are you sure you did not accidentally connected neighbouring pads on the row of solder bridges, i.e. shorted SB27 with SB26 or SB28?
JW
2023-03-02 09:49 AM
Good catch; the chart on page 25 of the User Manual sure seemed to suggest to me that PA3 corresponded to SB24. Either way, I just checked: I have good continuity across SB27, and no continuity between SB27 and SB26 or SB27 and SB28.