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

Pin D06 on F7FeatherV2 is active high after Meadow reset. #790

Open
Peter-Moody opened this issue Oct 15, 2024 · 2 comments
Open

Pin D06 on F7FeatherV2 is active high after Meadow reset. #790

Peter-Moody opened this issue Oct 15, 2024 · 2 comments

Comments

@Peter-Moody
Copy link

Peter-Moody commented Oct 15, 2024

Describe the bug
In Public Slack's support channel kaarew (Korken) reported that D06 after restarting is always active high. This was seen on a F7FeatherV2 v2.d. I repeated the test and saw the same behavior. My test was conducted with Mono disabled (meadow runtime disable).

To Reproduce
On Meadow restart measure the voltage on D06. It should be floating. However, the voltage I measured was 3.233v. Pulling D06 down with a 1K resistor only dropped the voltage to 3.172.

Expected behavior
It is expected that, on restart of Meadow, D06 would be open not driven high.

@Peter-Moody
Copy link
Author

Peter-Moody commented Oct 18, 2024

Background
PB13 on FeatherV1 is used for UART5 TX, on FeatherV2 PB13 is used for D06 and UART5 TX is PC12. Below board.h shows, RX is always the same for both V1 and V2 boards but, TX changes with version.

// UART5 (Meadow STM32F7 to ESP32)
#define GPIO_UART5_RX     GPIO_UART5_RX_1 // PD2
// Left the original '#define GPIO_UART5_TX' so modifying Nuttx code not needed
#define GPIO_UART5_TX     GPIO_UART5_TX_3 // PB13 - default
#define GPIO_UART5_TX_V1  GPIO_UART5_TX_3 // PB13 - F7v1
#define GPIO_UART5_TX_V2  GPIO_UART5_TX_1 // PC12 - F7v2 & CCMv2

What I found

The first step is in espcp_coprocessor.c where the function espcp_early_init() correctly uses the hardware version information to set _active_pins to &_f7v2_pins if the board is a FeatherV2 or CCM. A bit later the function espcp_gpio_init() (same file) uses this information to configure PB13 as UART5's TX pin. So far all is good.

Afterward, hcom_esp32_network_monitor.c starts a thread and this thread calls the Nuttx function open() to open /dev/ttyS2. Nuttx then calls uart_open() in serial.c which, in turn, calls code in stm32_serial.c and eventually calls up_setup(). Within up_setup() UART5's RX and TX pins are configured and PB13 becomes UART5s TX pin which is wrong for FeatherV2.

This maybe an easy fix or there may be other considerations I am not aware of.

@NevynUK
Copy link

NevynUK commented Oct 24, 2024

Fix merged into main code base 24th Oct 2024.

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

No branches or pull requests

2 participants