This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil uvision-4 source file not found with gnu-arm-gcc

When I try compile my software, I have the following error :

arm-none-eabi-gcc: error: ..srckernelmutex.c: No such file or directory

There is no backslash in the path, normally is ..\src\kernel\mutex.c

why ? anyone can help me ?

  • Have you considered using / instead of \ as path separator, since C uses \ as break character in strings?

  • Under uvision, I created a target and a group, put in the file mutex.c
    In "components, environement, books" I select GCC
    I try to compile and get this error :
    arm-none-eabi-gcc: error: ..srckernelmutex.c: No such file or directory

  • So have you checked that a file named srckernelmutex.c does actually exist anywhere on (or accessible to) your machine?

    If the file does exist - is it in a place where you have configured the tools to find it?

  • Hi Andrew,

    My file is called mutex.c and it is in directory ..\src\kernel.
    gcc return an error srckernelmutex.c not found, it is like uvision remove separator slashes or backslashes (I don't know, I'm new in windows world)

  • gcc return an error srckernelmutex.c not found, it is like uvision remove separator slashes or backslashes (I don't know, I'm new in windows world)

    Close, but not quite. The problem is that your GCC (or possibly a Unix-style shell sitting between it and uVision) expects a Unix-like command line (with forward slashes as the directory separator), while uVision passes it a MS-style one (with backslashes filling that role). Backslashes mean a totally different thing to this GCC than uVision tried to use them for. They're for esacape sequences, e.g. for embedding special characters or blanks in file names.

    In short: this GCC doesn't behave like a Windows program, but uVision expect it to. This combination cannot work.

  • Thanks Hans,

    I change my GCC tools chain to code sourcery tools chain and I always have the same issue.
    I don't know why, keil says uvision is compatible with code sourcery tools chain and I have followed keil's installation guide.

  • You haven't still told us exactly where the tools pick up that path to your file. If it is the project file or part of a path somewhere in a setting or if you even play with #include.

  • You haven't still told us exactly where the tools pick up that path to your file. If it is the project file or part of a path somewhere in a setting or if you even play with #include.

  • You haven't still told us exactly where the tools pick up that path to your file. If it is the project file or part of a path somewhere in a setting or if you even play with #include.

  • Hi Per,

    I just create a target and a group under uvision, add existing files to group. My files are not at the root of my project folder (uvision project file here) but in sub folder.
    To resume, if my source files are all in the root of the project, all it is fine but if I place files in a sub folder I have this issue for the those files.
    It's like uvision want me to place all my files in the same folder where the uvision project is created and not elsewhere.
    I hope it is more clear, I have a limited english ;-)

  • OK - so in this case it is uvision itself that produces the path strings. Then you don't have much options. Some possible routes
    - move the source files to the project root directory
    - find a build of the gcc tool chain that has additional code for MS-DOS path separators (\) - I think some cygwin builds of the toolchain do add support for both / and \.
    - consider building the project using a hand-fixed makefile or script.
    - write a shell program/script that picks up the parameters from uvision and translates them before calling the compiler toolchain
    - switch to an IDE that is interacting well with the compiler toolchain.

  • Hi Per,

    When I try to compile directly by calling arm-none-eabi-gcc and give it the C file with slashes or backslashes it's fine. But when I try with uvision, I have the issue, it seems like uvision remove separator (slashes or backslashes) before calling gcc. I don't understand why ? I try code sourcery tools who are describe by keil to be comptatible with uvision. I followed keil's guide to install and I have always the same problem. My version of uvision is 4.72.1.0

  • At least other versions of uvision have correctly handled source files in sub directories - and with "correctly" I mean using \ which is the native path separator in Windows.

    But note that a unix program that receives a path with \ and then tries to print it is likely to drop the \ in the printout - this because the \ has special meaning when the text string is printed. It is, after all, specified in the C language standard as a break character intended to inform that the following character should be treated specially.

    So most likely, the tool is "correctly" called with a path containing \. It then fails to make use of subdirectories because it expects / as path separator. And it then finally prints an error message and that print strips the \ making you see all the elements of the path merged together as a single name.

  • Indeed.

    Why do you particularly want to use uVision?

  • Hi Andrew,

    Because I bought a Keil's evaluation board (MCB4357) and keil's tools are designed for this board, moreover, I can simulate my software without hardware.
    I don't want to use real view and I want to keep GCC.
    But now, I'm return to linux :-) and I use GCC to compile and my JLink edu to debug. All work like a charm.
    But if you have an idea to use uvision 4 with gcc, your are welcome !!!
    This issue is strange and I don't understand why ? Keil said they are compatible with code sourcery tools, I installed it and I have always the same issue.