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

Zephyr SYSCALL_INCLUDE_DIRS doesn't take effect #2

Open
1 of 5 tasks
andung07 opened this issue Jun 20, 2020 · 1 comment
Open
1 of 5 tasks

Zephyr SYSCALL_INCLUDE_DIRS doesn't take effect #2

andung07 opened this issue Jun 20, 2020 · 1 comment

Comments

@andung07
Copy link

What kind of issue is this?

  • Question.
    This issue tracker is not the place for questions. If you want to ask how to do something,
    or to understand why something isn't working the way you expect it to,
    use Community Forums or Premium Support

  • PlatformIO IDE.
    All issues related to PlatformIO IDE should be reported to appropriate repository:
    PlatformIO IDE for Atom or
    PlatformIO IDE for VSCode

  • Development Platform or Board.
    All issues (building, uploading, adding new boards, etc.) related to PlatformIO development platforms
    should be reported to appropriate repository related to your hardware
    https://github.com/topics/platformio-platform

  • Feature Request.
    Start by telling us what problem you’re trying to solve. Often a solution
    already exists! Don’t send pull requests to implement new features without first getting our
    support. Sometimes we leave features out on purpose to keep the project small.

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: Mac OS 10.15.5

PlatformIO Version (platformio --version): 4.3.4

Description of problem

I am developing a custom out-of-tree driver with __syscall definition. As described here, I need to append the path containing my header definition to SYSCALL_INCLUDE_DIRS list CMake variables. But the scripts/gen_syscalls.py doesn't aware this additional path.

Steps to Reproduce

  1. Create the header file containing some __syscall functions. Let's say uwb.h
__syscall void uwb_configure(struct device *dev, uwb_config_t *config);

static inline void z_impl_uwb_configure(struct device *dev, uwb_config_t *config)
{
    const struct uwb_driver_api *api = (const struct uwb_driver_api *)dev->driver_api;
    return api->configure(dev, config);
}

#include <syscalls/uwb.h>
  1. Add the path in step 1, to zephyr/CMakeLists.txt
list(APPEND SYSCALL_INCLUDE_DIRS
    ${CMAKE_CURRENT_SOURCE_DIR}/include/drivers
)

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)

zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/drivers
  1. Refer the uwb.h in one of user source files in src
  2. Run the build

Actual Results

In file included from src/main.c:31:
zephyr/include/drivers/uwb.h:89:10: fatal error: syscalls/uwb.h: No such file or directory
 #include <syscalls/uwb.h>

Expected Results

Build successfully

Additional info

The additional SYSCALL_INCLUDE_DIRS doesn't take effect. It misses the appointed directory. There is no uwb.h generated in .pio\build\zephyr\include\generated\syscalls

@valeros valeros transferred this issue from platformio/platformio-core Jun 22, 2020
@th-fischer2020
Copy link

I run in a similar Problem. Have a look at your boards directory inside your platform-repo. There you can see many .json-Files. There you have to add "syscall_include_dirs": "zephyr" like this:

{
  "build": {
    "core": "stm32",
    "cpu": "cortex-m4",
    "extra_flags": "-DSTM32F412Vx -DSTM32F4xx",
    "f_cpu": "100000000L",
    "mcu": "stm32f412vet6",
    "product_line": "STM32F412Vx",
    "variant": "my_board_xyz",
    "zepyhr": {
      "variant": "my_board_xyz",
      "syscall_include_dirs": "zephyr"         <<===
    }
  },
  "debug": {
    "default_tools": [
      "stlink"
    ],
    "jlink_device": "STM32F412VE",
    "onboard_tools": [
      "stlink"
    ],

...

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

No branches or pull requests

2 participants