Skip to content

Ethernet freertos_tcp on f439zi nucleo not working #583

@kikass13

Description

@kikass13

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

End

Thank you for reading, maybe someone can help

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions