apache / apache/nuttx

Assertion fails within STM32 MAC driver.

Open
#7,435 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 13h
Merged PRs (30d)
230

Description

I am using Ethernet on an STM32F427, and I am plagued with an assertion failing constantly.

It is on file `stm32_eth.c`, line 1372.:
`DEBUGASSERT(dev->d_len == 0 && dev->d_buf == NULL);`

Checking with my debugger I see that `dev->d_len` has a non zero value (which however seems sane, not garbage).
`dev->d_buf` is NULL, as it ought to be.

I had set `CONFIG_NET_ETH_PKTSIZE` to 640, and this problem appeared quite often.
Now, I tried to set this config to 1514 and to my surprise, the problem vanished. I haven't seen this assertion failing again.

Maybe the problem is solved, or maybe it is now so scarce that I haven't noticed it?

I am thinking of two cases here:
* Either there is something "special" with the value 1514, and the driver does not work with smaller values.
* Or having a small buffer triggers the execution of some buggy code (for example by dropping large packets).

I guess that if it is the second case, the problem is still there but it is just temporarily masked for me.

Contributor guide

Open the contributing guide

Research direction

Start in stm32_eth.c at line 1372 and reproduce the assertion with CONFIG_NET_ETH_PKTSIZE set to 640, comparing behavior with 1514. Inspect the packet state values for d_len and d_buf, and verify that the driver handles the smaller buffer size without triggering the assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.