You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
the definition is now "__syscall const struct device *device_get_binding(const char *name);",
which bring many compile warnings as below, and at last, program can't link
warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
37 | struct device *i2c_dev = device_get_binding(DT_LABEL(I2C2_NODE));
it used to be "__syscall struct device *device_get_binding(const char *name);" and work well in zephyr-2.3
Please also mention any information which could help others to understand
the problem you're facing:
What target platform are you using? STM32F030
What have you tried to diagnose or workaround this issue? compare with before building
...
To Reproduce
Steps to reproduce the behavior:
west build
Expected behavior
A clear and concise description of what you expected to happen.
pass the building
Impact
What impact does this issue have on your progress (e.g., annoyance, showstopper)
Can't continue
Logs and console output
If applicable, add console logs or other types of debug information
e.g Wireshark capture or Logic analyzer capture (upload in zip archive).
copy-and-paste text and put a code fence (```) before and after, to help
explain the issue. (if unable to obtain text log, add a screenshot)
warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
37 | struct device *i2c_dev = device_get_binding(DT_LABEL(I2C2_NODE));
Environment (please complete the following information):
OS: (e.g. Linux, MacOS, Windows) Linux
Toolchain (e.g Zephyr SDK, ...) Zephyr SDK
Commit SHA or Version used zephyr-3.99
Additional context
Add any other context that could be relevant to your issue, such as pin setting,
target configuration, ...
The text was updated successfully, but these errors were encountered:
zzzh
added
the
bug
The issue is a bug, or the PR is fixing a bug
label
Mar 9, 2022
This is not a bug, you need to use const struct device *dev = device_get_binding(...); now (devices were constified a few releases ago). You can also make use of i2c_dt_spec facilities for I2C devices in particular, as well as take a look at DEVICE_DT_GET(). You'll find many in-tree examples.
Describe the bug
the definition is now "__syscall const struct device *device_get_binding(const char *name);",
which bring many compile warnings as below, and at last, program can't link
warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
37 | struct device *i2c_dev = device_get_binding(DT_LABEL(I2C2_NODE));
it used to be "__syscall struct device *device_get_binding(const char *name);" and work well in zephyr-2.3
Please also mention any information which could help others to understand
the problem you're facing:
To Reproduce
Steps to reproduce the behavior:
west build
Expected behavior
A clear and concise description of what you expected to happen.
pass the building
Impact
What impact does this issue have on your progress (e.g., annoyance, showstopper)
Can't continue
Logs and console output
If applicable, add console logs or other types of debug information
e.g Wireshark capture or Logic analyzer capture (upload in zip archive).
copy-and-paste text and put a code fence (```) before and after, to help
explain the issue. (if unable to obtain text log, add a screenshot)
warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
37 | struct device *i2c_dev = device_get_binding(DT_LABEL(I2C2_NODE));
Environment (please complete the following information):
Additional context
Add any other context that could be relevant to your issue, such as pin setting,
target configuration, ...
The text was updated successfully, but these errors were encountered: