-
Notifications
You must be signed in to change notification settings - Fork 155
Description
Hello,
I will append my experience here, even though there is an issue for that already:
Preamble
I got @mikewolfram 's lan8720a phy driver and the corresponding example (using freertos_tcp) working with the f767zi nucleo board after changing some of the PHY pins hardcoded in the example he gave.
Getting There
After that, I tried to get it running on the f439zi but was unable to do so. After some hours of experimenting with the freertos network scheduler (RTOS_IP) and ethernet stack, i finally ended inside the event loop (controlled by freertos ip stack) of the lan8720a (see here) which should eventually handle arp requests coming from another laptop connected to the board via ethernet.
The Problem
The event loop handles events constantly (as expected), but every event is regarded as a NOP modm::platform::eth::Event::None and therefore ignored. Which means that the feeding function, responsible for setting proper events, is not working properly.
As it turns out, the producer function is this ISR
MODM_ISR(ETH)
{
using modm::platform::eth;
using modm::ethernet;
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
EMAC::InterruptFlags_t irq = EMAC::getInterruptFlags();
EMAC::acknowledgeInterrupt(irq);
if (irq & (eth::InterruptFlags::Receive | eth::InterruptFlags::ReceiveBufferUnavailable)) {
ethernet::isrEvent |= eth::Event::Receive;
if (ethernet::emacTaskHandle) {
vTaskNotifyGiveFromISR(ethernet::emacTaskHandle, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
if (irq & (eth::InterruptFlags::Transmit)) {
ethernet::isrEvent |= eth::Event::Transmit;
if (ethernet::emacTaskHandle) {
vTaskNotifyGiveFromISR(ethernet::emacTaskHandle, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
if (EMAC::getInterruptFlags() & eth::InterruptFlags::AbnormalIrqSummary) {
// not used yet
}
}My test have shown (led blinky, event chain debugging) that this specific ISR is not called properly.
Is there something you guys can tell me about the differences between the interrupt handling (mainly ethernet-DMA interrupts) ?
Other Stuff
- I tried checking registers for interrupts, dma and others to see if any flags have changed but it seems that these chips(f4 & f7) are equal in that matter
- we have an internal issue where this errata was evaluated, but we could not find anything in particular which could be problematic: https://www.st.com/resource/en/errata_sheet/dm00068628-stm32f427437-and-stm32f429439-line-limitations-stmicroelectronics.pdf
End
Thank you for reading, maybe someone can help