Skip to content
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

Build error with NUCLEO_H743ZI2 (Armc5, Mbed os 5.14) #12005

Closed
acabarbaye opened this issue Dec 2, 2019 · 4 comments · Fixed by #12015
Closed

Build error with NUCLEO_H743ZI2 (Armc5, Mbed os 5.14) #12005

acabarbaye opened this issue Dec 2, 2019 · 4 comments · Fixed by #12015

Comments

@acabarbaye
Copy link
Contributor

Description of defect

Following build error appears when compiling blinky example for the following target:

./mbed-os/features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp", line 89: Error: #20: identifier "ETH_RX_BUFFER_SIZE" is undefined

Target(s) affected by this defect ?

NUCLEO_H743ZI2

Toolchain(s) (name and version) displaying this defect ?

Armc5

What version of Mbed-os are you using (tag or sha) ?

mbed-os-5.14.2

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

latest

How is this defect reproduced ?

mbed compile of mbed os blinky

@ciarmcom
Copy link
Member

ciarmcom commented Dec 2, 2019

Internal Jira reference: https://jira.arm.com/browse/MBOTRIAGE-2440

@jeromecoutant
Copy link
Collaborator

jeromecoutant commented Dec 3, 2019

Hi

I confirm that ETH_RX_BUFFER_SIZE is not defined :-(

Why issue has not been found before?
Seems it is because used toolchain is Armc5, which is no more tested in CI.

Loooking at features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp
We got:

#if defined ( __ICCARM__ ) /*!< IAR Compiler */
...
#elif defined ( __CC_ARM )  /* MDK ARM Compiler */
...
__attribute__((section(".RxArraySection"))) uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_RX_BUFFER_SIZE] 
...
#elif defined ( __GNUC__ ) /* GNU Compiler */ 
...
#endif

Seems that ARMC6 doesn't set __CC_ARM and set GNUC ?

@kjbracey-arm any sugestion ?

Should we implement:

#if defined ( ICCARM ) /*!< IAR Compiler */
#else
#endif

or

#if defined ( TOOLCHAIN_IAR ) /*!< IAR Compiler /
#elif defined ( TOOLCHAIN_ARM ) /
MDK ARM Compiler /
#elif defined ( TOOLCHAIN_GCC_ARM ) /
GNU Compiler */
#endif

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 3, 2019

Seems it is because used toolchain is Armc5, which is no more tested in CI.

It's been active in the recent nightlies thus the report.

Seems that ARMC6 doesn't set __CC_ARM and set GNUC ?

That is correct, __CC_ARM is ARMC5. Use that one if you want to have it only used by ARMC5 (or negative for skipping ARMC5).

@kjbracey
Copy link
Contributor

kjbracey commented Dec 3, 2019

You can use __CC_ARM to check specifically for the ARM (formerly Norcroft) compiler core. So ARMC5, but not ARMC6.

You can use __clang__ to look for Clang-based compilers, including ARMC6.

If you want to look for either ARMC5 or ARMC6, then you can test __ARMCC_VERSION. That's what you want to do here, I think - your attribute syntax works on both compilers, and you're sharing the linker and linker map.

I'd rarely recommend doing a >=6000000 test on __ARMCC_VERSION though - if you're doing that you probably really mean "which compiler family is this", for which the above two tests are more appropriate, IMO.

ARMC5, ARMC6 and GCC all set __GNUC__, helpfully(!), so you need to take care on that.

Yes, there are the Mbed-specific TOOLCHAIN_xxx defines, but I've not really used them myself.

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

Successfully merging a pull request may close this issue.

5 participants