Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QBS Install: run commands to program into mictrocontroller
Forum Update on Monday, May 27th 2025

QBS Install: run commands to program into mictrocontroller

Scheduled Pinned Locked Moved Qt Creator and other tools
qbs
1 Posts 1 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    halfgaar
    wrote on 20 Sept 2015, 16:13 last edited by
    #1

    I've managed to setup qbs to build my microcontroller project using avr-gcc and the desired flags, but now comes the deployment part of running avr-objcopy and avrdude (to upload it).

    I tried using the custom build steps, but that's hard for two reasons:

    1. That config is saved in a .user file, and is generaly kept out of version control.
    2. There is a variable %{buildDir}, but the actual files are stored in a semi-random dir named %{buildDir}/qtc_AVR_GCC_2bcb96b3-debug. Putting that in the build steps is not portable.

    Currently, my qbs test project is this:

      CppApplication {
    type: "application" // To suppress bundle generation on Mac
    consoleApplication: true
    cpp.architecture: "attiny85" // Does nothing, but I had to set it
    cpp.optimization: "small"
    cpp.cFlags: ["-mmcu=attiny85", "-fpack-struct", "-fshort-enums", "-funsigned-bitfields", "-funsigned-char", "-Wstrict-prototypes"]
    
    files: [
        "main.c",
        "piet.c",
    ]
    
    Group {     // Properties for the produced executable
        fileTagsFilter: product.type
        qbs.install: false
    }
    }
    

    I looked through the reference documentation, but I can't seem to define install commands. I need it to run:

    avr-objcopy -j .text -j .data -O ihex MainsBuffer.out MainsBuffer.hex
    avr-objcopy -j .eeprom  --change-section-lma .eeprom=0 -O ihex MainsBuffer.out MainsBuffer.ee.hex
    avrdude -c avrispmkii -p attiny85 -P usb -e -U flash:w:MainsBuffer.hex
    

    Does qbs provide scripting/variables to define this in the .qbs file? I can't seem to find anything. The only thing I can seem to find, is related to installing in a directory or starting the built executable directly. I don't even seem to have access to the output ELF filename in a variable?

    1 Reply Last reply
    0

    1/1

    20 Sept 2015, 16:13

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved