BlinkyPendant bare metal programming

This discussion was created from comments split from: BlinkyPendant.

Comments

  • Hi there. After playing around with PatternPaint for a while, I wanted to start hacking the firmware to try and load more than one custom image on my BlinkyPendant.
    I installed the ARM toolchain and dfu-utils, and was able to build the firmware (without making any changes to any of the files). When I ran make install, the pendant blinked and then nothing. Nothing happens when I turn it on and press the button. When I try using PatternPaint with the pendant connected, it displays the "live" image from PatternPaint, but the "save to device" doesn't work. Is there something else that needs to be loaded on the pendant beside the firmware for it to work? Was there another error? I've noticed that dfu-utils says it's unable to read DFU status after completion.

    Sorry, I'm new to ARM programming. Any help welcome.

    Thanks!

    Here's the output I get after running make install:

    $ make install
    dfu-util -d 1209 -D pendant-firmware.dfu
    dfu-util 0.8

    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2014 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to [email protected]

    Deducing device DFU version from functional descriptor length
    Opening DFU capable USB device...
    ID 1209:8888
    Run-time device DFU version 0101
    Claiming USB DFU Runtime Interface...
    Determining device status: state = appIDLE, status = 0
    Device really in Runtime Mode, send DFU detach request...
    Device will detach and reattach...
    Deducing device DFU version from functional descriptor length
    Opening DFU USB Device...
    Claiming USB DFU Interface...
    Setting Alternate Setting #0 ...
    Determining device status: state = dfuIDLE, status = 0
    dfuIDLE, continuing
    DFU mode device DFU version 0101
    Device returned transfer size 1024
    Copying data from PC to DFU device
    Download [=========================] 100% 34372 bytes
    Download done.
    state(7) = dfuMANIFEST, status(0) = No error condition is present
    dfu-util: unable to read DFU status after completion
  • Hi timtom,

    Just split this into a new discussion. First- awesome! It looks like you're doing everything with DFU. That warning message can be safely ignored.

    I think I might know the answer to this- the latest BlinkyPendant firmware in github has partial support for loading multiple images, but PatternPaint doesn't save the right image format to it by default. To make sure your setup is working, try this:

    1. Check out this commit: 3e3f490a19 (git checkout 3e3f490a19), and re-build/install the firmware- that version should work with the current release of PatternPaint.

    2. Once that works, you can either:
    a. set up the build environment for PatternPaint and run it (the latest code autodetects the Pendant firmware version, and writes either a single pattern for pendant firmware v1 or multiple patterns for the new firmware)
    b. let me know what platform you are on and I'll make a build of the latest patternpaint that works with this.

    This should let you load multiple images, however there's a bug in I think either the upload or playback code, that messes up some of the pixels on playback- I'm not entirely sure where.

    If there's stuff I can help document about this, please let me know!

    Cheers,
    Matt
  • Hi Matt
    Thanks for the response! I want to try what you suggest, however I'm confused: commit 3ef490a19 is the latest one on GitHub? "Latest commit 3e3f49 on Jul 19." In any case, that's the one I'm using. Should I be building from another commit?

    I haven't started looking in the firmware code yet, I wanted to first make sure I was able to replicate a working toolchain. If the new version of PatternPaint supports multiple images that's great! This will solve my first use case :) I'm on Mac OS X.

    Thanks again,
    Thomas
  • Oh, sorry about that! The correct commit is: ba5ef393d7

    If the BlinkyPendant isn't showing up as a USB device, turn it off and disconnect from USB, then hold down the pattern selection button when plugging it back into USB- that should make it stay it bootloader mode so that you can update to a working firmware.
  • Hi Matt. Sorry it took me so long. Yes, compiling from that commit reverts the pendant to a state that works with PatternPaint 1.8.0. So my setup seems to be working, yay!

    I haven't been able to build the latest PatternPaint yet because I need to upgrade Xcode in order to enable QT and I'm scared this will mess up my dev setup, so taking it easy.
  • I finally got round to find a version of Xcode that works with my system and was able to install Qt and build the latest PatterPaint (46cb4e2391 - Oct 23). However, it looks like the version I'm building is unable to open existing patterns (throws 'warning unknown: QImage::scaled: Image is a null image'). The error is also thrown when I try to load some patterns from the example menu, e.g. 'pendant/heart.png'.

    Will try and investigate more when I have more time.
    Thanks for all the help! :)
  • Oh! I just deleted my preferences file (~/Library/Preferences/com.blinkinlabs.PatternPaint.plist), and am seeing a similar crash. It looks like one of the preferences isn't being set correctly by default. I haven't done a test on a clean system recently (really need to get an automated build test set up...).
Sign In or Register to comment.