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

is there a way to build a UV2 project from command prompt?

for my current work, I wanna know if there is a way to build one UV2 project from command prompt.
with my experience on using other embedded development tools, I know some provider ships particular tools for this target with its development kit. such as some tool can generate a makefile for your project, then you can build the project from command prompt just with calling of make tools.
now, I wanna know if there is a way to work with UV2 project just like this?

  • Yes - it is described in the manual!

    See "µVision 2 Command Line Invocation" in the uVision Getting Started guide

  • yes, I read the information, only one page for building a particular project, right?
    but I failed.
    I failed to build both my working project and keil's sample project (such as Hello project).
    I just call uv2 like this:

    uv2 -b hello.uv2
    then it will launch uVision2 GUI interface, but a bad news report following. it display:
    Can't read project file "hello.uv2"
    I do not know why.
    (but in GUI interface, I can open hello.uv2 and build this project without any trouble)

    and according to the mannual, if there is no project file specified, uVision2 will open the last project file used.
    I tried for this, hello project can be opened. but no matter I put the argument "-b" followed or not, uVision2 will not do anything for building, only open hello project.

    why?

  • "yes, I read the information"

    So why didn't you say so?! ;-)

    It does work - I've tried it!
    (I've added items to my Explorer Context menu, so I get options to 'Build' or 'Make' as well as 'Open' when I right-click a .uv2 file)

    uv2 -b hello.uv2
    Where do you type that command?
    For uVision to find your hello.uv2 Project, when you specify only the name, it must be in the current default drive & folder - otherwise you'll need to specify the full path!
    (the same applies to any application).

  • Where do you type that command?

    I just type it in the hello project's directory. and I have reset my PATH environment variable, then I can call uv2.exe anywhere.

    as what I said, after I opened hello.uv2 project from UV2 GUI, I can open hello project from command prompt with this line:

    uv2 hello.uv2

    but if I add "-b" argument into this line, it still can not build this project automatically. :(

    am I unfortunate?

  • in truth, I do not think I do wrong usage. I just run it following the mannual strictly.

    I think maybe there is something wrong with the software product or my environment settings.

    I use uVision2 V2.20a, and I only installed C51 Compiler Tools on my local PC (I think it should be enough).

    how do you think about it?

  • and I just installed a fresh copy of uVision2 on another test PC of my team, I got the same result.
    both these two PCs are running window2000 professional (English version). same version of uVision2.

  • "if I add '-b' argument into this line, it still can not build this project"

    Try this instead:

    uv2 -b .\hello.uv2
    Yes - that looks like a bug in the command-line operation!
    uVision appears to be using the wrong default folder.

  • Great! It WORKS now!
    :)
    thank you very much! =)