Skip to content

Ethernet OPTA: fix crash when DHCP is used on fast DHCP server #903

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions variants/OPTA/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ void _ontouch1200bps_();

#define USB_MAX_POWER (500)

#define ETHERNET_PHY_RESET (185)

static GPIO_TypeDef * const GPIO_PORT[] = {
GPIOA,
GPIOB,
Expand Down
8 changes: 7 additions & 1 deletion variants/OPTA/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ PinDescription g_APinDescription[] = {
{ PJ_12, NULL, NULL, NULL },
{ PJ_13, NULL, NULL, NULL },
{ PJ_14, NULL, NULL, NULL },
{ PJ_15, NULL, NULL, NULL },
{ PJ_15, NULL, NULL, NULL }, // 185 - RESET ETHERNET PHY ON OPTA
{ PK_0, NULL, NULL, NULL },
{ PK_1, NULL, NULL, NULL },
{ PK_2, NULL, NULL, NULL },
Expand Down Expand Up @@ -355,6 +355,11 @@ void initVariant() {
// Disable the FMC bank1 (enabled after reset)
// See https://github.com/STMicroelectronics/STM32CubeH7/blob/beced99ac090fece04d1e0eb6648b8075e156c6c/Projects/STM32H747I-DISCO/Applications/OpenAMP/OpenAMP_RTOS_PingPong/Common/Src/system_stm32h7xx.c#L215
FMC_Bank1_R->BTCR[0] = 0x000030D2;


pinMode(ETHERNET_PHY_RESET,OUTPUT);
// keep ethernet phy reset...
digitalWrite(ETHERNET_PHY_RESET, LOW);
}

#ifdef SERIAL_CDC
Expand All @@ -377,6 +382,7 @@ uint8_t getUniqueSerialNumber(uint8_t* name) {
}

void _ontouch1200bps_() {
digitalWrite(ETHERNET_PHY_RESET, LOW);
HAL_RTCEx_BKUPWrite(&RTCHandle, RTC_BKP_DR0, 0xDF59);
NVIC_SystemReset();
}
Expand Down
Loading