Skip to content

I2C STM32WL Debug : Unable to link because inline are not inlined #15379

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

Closed
hallard opened this issue Jan 28, 2023 · 4 comments · Fixed by #15383
Closed

I2C STM32WL Debug : Unable to link because inline are not inlined #15379

hallard opened this issue Jan 28, 2023 · 4 comments · Fixed by #15383

Comments

@hallard
Copy link
Contributor

hallard commented Jan 28, 2023

Description of defect

Depending on code, sometimes unable to link using I2C on STM32WL because looks like inline not inlined and thus linker fail to find the function

Target(s) affected by this defect ?

STM32WL (may be other)

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

image

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

master since @multiplemonomials commit 0751932

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

mbed studio 1.4.4.1

How is this defect reproduced ?

Not really sure sometimes in happens with some code other not.
I suspect compiler defect under certain circonstances depending on code, in my case target use mbed-cryptoauthlib for I2C secure element and another I2C device. in that case it always happen (in debug only the one that do not have --inline flag on profile)
develop and releaseprofiles have no issues

In my case i2c_is_ready_for_transaction_start() is not created (not inlined) failed to link (makes sense)

[Error] @0,0: L6218E: Undefined symbol i2c_is_ready_for_transaction_start (referred from BUILD/EVOLY_T_V12/ARMC6/mbed-os/targets/TARGET_STM/i2c_api.o).
Warning: L3912W: Option 'legacyalign' is deprecated.
Error: L6218E: Undefined symbol i2c_is_ready_for_transaction_start (referred from BUILD/EVOLY_T_V12/ARMC6/mbed-os/targets/TARGET_STM/i2c_api.o).
Finished: 0 information, 1 warning and 1 error messages.
[ERROR] Warning: L3912W: Option 'legacyalign' is deprecated.
Error: L6218E: Undefined symbol i2c_is_ready_for_transaction_start (referred from BUILD/EVOLY_T_V12/ARMC6/mbed-os/targets/TARGET_STM/i2c_api.o).
Finished: 0 information, 1 warning and 1 error messages.

anyway changing to always_inline with solve the issue (not sure it's the best option)

inline bool i2c_is_ready_for_transaction_start(stm_i2c_state state)
{
    // Note: We can safely send a transaction start in the middle of any single byte operation; this creates a
    // repeated start.

    return state == STM_I2C_IDLE || STM_I2C_PENDING_START == state
           || state == STM_I2C_SB_READ_IN_PROGRESS || state == STM_I2C_SB_WRITE_IN_PROGRESS;
}
MBED_FORCEINLINE bool i2c_is_ready_for_transaction_start(stm_i2c_state state)
@mbedmain
Copy link

@hallard thank you for raising this issue.Please take a look at the following comments:

Could you add some more detail to the description? A good description should be at least 25 words.

NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'. This indicates to us that at least all the fields have been considered.
Please update the issue header with the missing information.

@multiplemonomials
Copy link
Contributor

Wow that's odd, it sorta feels like an Arm Compiler internal issue

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 6, 2023

I've seen this before somewhere. I found this page now that could help:

https://developer.arm.com/documentation/ka002210/latest (static inline should fix it?)

Edit: I would just remove inline. Let compiler to do the work, it's a hint anyway.

@hallard
Copy link
Contributor Author

hallard commented Feb 22, 2023

Let's do like that with #15383

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.

4 participants