Skip to content

Fix:mac_lld_init build error, '__eth_rb' will never be NULL#95

Open
Huibean wants to merge 88 commits into
ArduPilot:masterfrom
Huibean:pr-fix-mac_lld_init-build-error
Open

Fix:mac_lld_init build error, '__eth_rb' will never be NULL#95
Huibean wants to merge 88 commits into
ArduPilot:masterfrom
Huibean:pr-fix-mac_lld_init-build-error

Conversation

@Huibean
Copy link
Copy Markdown
Member

@Huibean Huibean commented Jan 25, 2025

To fix a compile error happen on hardware target with ETH driver, gcc12.2/13.3 with Holybro Pixhawk v6x and CUAV Nano7

this error will only rasie in gcc above 12

[11/12] Linking build/Pixhawk6X/modules/ChibiOS/libch.a
[1/1] ChibiOS: Compiling hal_mac_lld.c

../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c: In function 'mac_lld_init':
../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c:283:16: error: the comparison will always evaluate as 'false' for the address of '__eth_rb' will never be NULL [-Werror=address]
  283 |   if (__eth_rb == NULL || __eth_tb == NULL || __eth_rd == NULL || __eth_td == NULL) {
      |                ^~
../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c:130:18: note: '__eth_rb' declared here
  130 | extern uint32_t *__eth_rb[STM32_MAC_RECEIVE_BUFFERS];
      |                  ^~~~~~~~
../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c:283:36: error: the comparison will always evaluate as 'false' for the address of '__eth_tb' will never be NULL [-Werror=address]
  283 |   if (__eth_rb == NULL || __eth_tb == NULL || __eth_rd == NULL || __eth_td == NULL) {
      |                                    ^~
../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c:131:18: note: '__eth_tb' declared here
  131 | extern uint32_t *__eth_tb[STM32_MAC_TRANSMIT_BUFFERS];
      |                  ^~~~~~~~
cc1: all warnings being treated as errors
make: *** [modules/ChibiOS/obj/hal_mac_lld.o] Error 1

remove calls to early_init and late_init for ArduPilot
support ALT bytes in XPI mode
support DMA-safe dummy data for send and receive
add support for TIM8 and FDCAN handlers
tridge and others added 26 commits May 13, 2023 18:17
needed to ensure we get DMA lock before the bus lock, so we don't
deadlock with another device on the same bus
this provides a mechanism to force release a mutex
if phy not detected then return false instead of halting
we want to init if networking is enabled
Bumps [requests](https://github.com/psf/requests) from 2.26.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.26.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [certifi](https://github.com/certifi/python-certifi) from 2021.5.30 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](certifi/python-certifi@2021.05.30...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
git-svn-id: https://svn.code.sf.net/p/chibios/code/trunk@16423 085d63ac-f8f8-4fb4-a5e5-c089fd4f3ff4
a shift of 11 is correct for MAVv1. In v2 it is 21, ETH_MACMDIOAR_PA_Pos
@TheSparkyBoy
Copy link
Copy Markdown

This issue still exist, can someone please fix it?

@andyp1per
Copy link
Copy Markdown
Contributor

Just use the supported compiler version - 10.2.1

@Jaaaky
Copy link
Copy Markdown

Jaaaky commented Aug 4, 2025

@andyp1per @tridge
Actually I'm having the same issue on Linux using supported 12.2 version downloaded from official Tools repo here https://firmware.ardupilot.org/Tools/STM32-tools/

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants