How to use TX pin of STMOD+ connector from STM32H747I-DISCO board for USART2?
I started from the documentation of both discovery board and MB1280-B1 STMOD board.
They both state, that the pin number 2 of STMOD+ (P2) connector of the discovery board is connected, I quote: "SPI2_MOSI/ USART2_TX (PC3/PD5)".
So - USART2, pin PD5. That's what I set in CubeIDE.
I configured the USART2 as Single Wire Half Duplex, because I connected DS18B20 temperature sensor using Single Wire protocol.
My setup was tested with an other Nucleo board and it worked. Tested with drivers and all.
The problem is - despite the USART2 initializes properly, it doesn't read anything. To be exact - I get 0x00 instead of 0xe0 that is expected.
It behaves as nothing was connected to the USART2 TX pin.
Then I changed my target port to USART6, that is by default assigned to PC6 pin. It is also accessible on STMOD+ connector, as INT signal. I don't like it, because I was planning to use that pin for a different purpose.
But anyways - it works. So my code is correct, my connections are OK, my DS18B20 is operational and reads the correct temperature.
The problem is I can't use USART2 as is described in documentation. There is a "USART2 TX" pin described in my discovery board documentation. It should be PB5 MCU pin. That's what I have set in IOC file. But somehow - it doesn't work.
I suspect the problem here is it's not only USART2_TX (PD5), but also SPI2_MOSI (PC3). It's like "SPI2_MOSI/ USART2_TX (PC3/PD5)" entry in the table. So... which one? Is it somehow selectable?
Also, when I want to use SPI2 - it's also pin nr 8 of the STMOD+, described as " SPI2_MOSIs (PB15)"... I'm a little lost here. I thought SPI needs just MOSI, MISO, NSS and SCK. What's "MOSIs"?
Is it possible to use both SPI2, USART2 and I2C4? I'd also need an interrupt input (from GPIO expander), one PWM input and 2 PWM outputs. All applicable pins seem to be accessible looking at the documentation and IOC configuration, however - it doesn't work as I think it should work. What am I missing here?
UPDATE: I also read Appendix B on page 59 of the STM32H747I-DISCO manual, it's super confusing. The same pins are bound to RX, TX, MISO and MOSI signals. So - pins 2 and 3 can be TXS2 and RXS2, or RXS2 and TXS2, depending on which table column you read. But - as I tested - neither works. I try to read USART2 on PD5, I get nothing regardless of the signal connected to the STMOD+ pin 2 or 3. When I connect the signal to pin 11 of STMOD+, I can read it as USART6 PC6. Why, why and why?
