Idiots Guide to Flashing Firmware?

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, luketeaford, Joe.

proonjooce
Learning to Wiggle
Posts: 22
Joined: Wed Sep 04, 2019 2:41 am

Idiots Guide to Flashing Firmware?

Post by proonjooce » Tue Oct 08, 2019 3:14 am

Hey all,

So I am embarking on a long journey to try and assemble all the Mutable modules (that can be done without expensive hotplate/hot air type deals).

First project will be a Ripples and then will move on to Branches and hopefully Braids or Peaks after that if all goes well and I haven't thrown everything in the bin in a fit of rage. :ripbanana:

For the majority of modules it seems flashing the firmware onto a microcontroller is required. I have to admit I'm a bit confused about this process, have tried a lot of googling but am quickly swamped by a ton of acronyms I don't understand and could do with maybe just a small nudge in the right direction.

So there's the following, fairly cryptic text on the amazingsynth.com site - "You can also use an STM32 discovery board to flash these IC's, though will need to solder a custom cable to do this. The Olimex AVRISP Mk2 is a good ISP for AVR parts, ISP is short for in sytem programmer."

I guess I have the following questions:

1. Branches has a ATMega88p chip and Braids has a STM32F103CBT6 MCU. Will these require different flashing methods? From what I can gather the Branches chip is an AVR so needs an AVR ISP? Would this work - USBTinyISP - Trying to keep things fairly cheap and the Olimex AVRISP is 20 quid.

2. Would something like this - Do the job for Braids, Peaks etc? I'm not sure how relevant all the numbers after STM32 are exactly...

3. amazingsynth mentions soldering a custom cable for using the Discovery boards... what exactly does this entail?

4. I imagine you connect the Disco board or ISP to your computer via USB and then to the module via ribbon cable, but then what software do I need to be running to upload the firmware and what is the general process for this? Is there a guide anywhere?

Sorry for all the questions, grateful for any help.

Any other tips, info, links, things to google, insults, insinuations about my personal life etc. highly welcome and appreciated

Thanks :)

MalphasWats
Learning to Wiggle
Posts: 8
Joined: Mon Sep 30, 2019 2:37 pm
Location: UK

Post by MalphasWats » Tue Oct 08, 2019 3:35 am

Hi,

First off, disclaimer: I'm new to modular synths etc and don't have one (yet), however, I've done a lot of microcontroller stuff!

For the AVR, there are lots of handy options - I'm not sure what kind of connection your Branches offers, but I'd expect to see a 2x3 pin header somewhere on there with labels like MISO, MOSI, CLK. It *might* have a 10 pin one, but it's ultimately the same pins needed:

https://telecnatron.com/reference/pinou ... t-345x.png

You can program that easily with a USBTinyISP, or a regular Arduino Uno board if you already have one of those.

The STM32 *can* be done with the thing you linked (in the same way you can use a bare Arduino board for the AVR chip), however, cheaper and easier to use something like this:

https://www.ebay.co.uk/itm/ST-Link-V2-P ... 2865543980

Again, I'm not sure what connector the Braids board has - but possibly something labelled SWDIO / SWCLK? I *think*. That's what I use my ST-Link for :) These headers are sometimes less standard than the AVR ones and might just be a couple of test points somewhere on the board.

If you have any pictures of the boards, I can probably be a little bit clearer.

Also, what computer are you using to do the programming? Win/OSX/Linux?

proonjooce
Learning to Wiggle
Posts: 22
Joined: Wed Sep 04, 2019 2:41 am

Post by proonjooce » Tue Oct 08, 2019 4:09 am

Hey, thanks for reply.

Got pics of the boards in eagle here attached.

Branches - Has a 2x3 connector bottom left. Seems like what you described. So USBTinyISP should be good to go for this? I have no equipment of this kind already and this is my first time working with stuff like this.

Braids - Top right there's a small 2x5 pin connector or a larger 1x6, so I'm guessing it's one of these?

I'll be using Windows for this also.
Attachments
braidsboard.jpg
braidsboard.jpg (366.11 KiB) Viewed 1014 times
branchesboard.jpg
branchesboard.jpg (228.62 KiB) Viewed 1015 times

MalphasWats
Learning to Wiggle
Posts: 8
Joined: Mon Sep 30, 2019 2:37 pm
Location: UK

Post by MalphasWats » Tue Oct 08, 2019 4:50 am

proonjooce wrote:Hey, thanks for reply.

Got pics of the boards in eagle here attached.

I'll be using Windows for this also.
Huh, I'm learning that modular folk *really* don't like putting labels on their silkscreen layers! The 2x6 definitely looks like an ISP programming header, and my guess would be the larger 1x6 on the other board, but I'm not sure and I've been looking at PCBs online since I posted my first reply and I can't find any that label these connectors!

Hopefully someone who has done it before can fill in that gap. Sorry!

Edited:

Ok, I found the schematics for Branches and Braids.

The 2x3 header on Branches is the programming header, so you should be able to plug that straight into the USBtinyISP, no problem.

Getting AVRDude running on windows can be a bit tricky, but you can probably use the ArduinoIDE to compile and upload the code for this.

With Braids, the 1x6 pin header is the programming header, however, it doesn't appear to break out the actual programming pins, instead it breaks out the Serial TX/RX pins which means your STM32 needs to have a bootloader on it, so make sure that when you buy the chip, you find one that comes pre-loaded with a bootloader (I've not used STM devices, so I'm not sure how common this is).

Updated again:

Reading a bit more about the Braids module, they DO break out the full programming headers on the small 2x5 connector (JP2), which would allow you to program the STM32 without having a 'bootloader' already on the chip (or indeed program a bootloader onto a blank chip!). Mutable Instruments recommend you use a little adapter to bridge the connection to the STLink (or whatever your chosen programmer is). You could just solder wires to the holes though.

Getting the tools to be able to do this working on Windows has proven to be a challenge, but it is possible, but they also provide a pre-built system you can install into a Virtual Machine which would take a lot of the headaches away

User avatar
fuzzbass
Super Deluxe Wiggler
Posts: 2089
Joined: Thu Feb 06, 2014 6:08 pm
Location: Florida, USA

Post by fuzzbass » Tue Oct 08, 2019 10:12 am

Wired for weird

proonjooce
Learning to Wiggle
Posts: 22
Joined: Wed Sep 04, 2019 2:41 am

Post by proonjooce » Tue Oct 08, 2019 10:46 am

ok cool thanks guys, i think i know what i need hardware wise for now at least, will try struggle through the software side of things once i get there. need to put the damn things together first, pcbs and components arrived today, yep they're pretty tiny... i've watched about 100 youtube videos on smd soldering now though so should be ok i hope.

one more question though, is there really any difference between a genuine STLink for £20 or a cheapo £4.50 one like what Malphas linked? surely they do basically the same thing?

User avatar
forestcaver
Ultra Wiggler
Posts: 925
Joined: Tue Mar 14, 2017 4:41 pm
Location: UK
Contact:

Post by forestcaver » Tue Oct 08, 2019 10:48 am

This may help - look in modular-> notes, modular-> tools and modular -> diy modules

http://batguitars.co.uk/

User avatar
synthetek
Veteran Wiggler
Posts: 550
Joined: Fri Jun 05, 2015 3:32 am
Location: Orange County, California
Contact:

Post by synthetek » Tue Oct 08, 2019 4:03 pm

proonjooce wrote: one more question though, is there really any difference between a genuine STLink for £20 or a cheapo £4.50 one like what Malphas linked? surely they do basically the same thing?
For the atmega stuff the cheap usbasp / usbisp is fine but if you want things to go smoothly with the STM stuff I highly recommend a real STLink and the jtag adapter and the ST-Link software.

User avatar
AlanP
Super Deluxe Wiggler
Posts: 1028
Joined: Fri Mar 14, 2014 8:37 pm
Location: New Zealand

Post by AlanP » Tue Oct 08, 2019 4:58 pm

For STM32, use the JTAG header, not the six pin serial header. The ST-Link software is much, much nicer to use than command-line stuff, and a lot smoother.

User avatar
fuzzbass
Super Deluxe Wiggler
Posts: 2089
Joined: Thu Feb 06, 2014 6:08 pm
Location: Florida, USA

Post by fuzzbass » Thu Oct 10, 2019 5:54 pm

My recollections for getting virtual box up and running on a windows 7 machine (~ six years old). Maybe this stuff is more seamless in windows 10 or newer mobos.

1. Go into CMOS and turn on virtualization.
2. Install Virtual Box
3. Go into control panel and configure the virtual interface that is created. I think I had to enable DHCP on it before it would work. (or static IP configuration)

Also, respect length limitations for USB cables, I had some that were too long leading to comm failures. If you have a hub connected to a hub, that is too long. Bring the work over to your machine, don't try to do this across the room.
Wired for weird

User avatar
rafyc
Common Wiggler
Posts: 224
Joined: Fri Feb 14, 2020 12:01 pm
Location: Paris

Re: Idiots Guide to Flashing Firmware?

Post by rafyc » Thu Feb 11, 2021 2:39 pm

Hi,

Followed the steps but have an issue here :
- Unable to match requested speed 2000 kHz, using 1800 kHz
- target halted due to debug-request, current mode: Handler External Interrupt(14)

STlink V2
Adafruit adapter and cable

Code: Select all

openocd -s /opt/local/share/openocd/scripts/ -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c "init" -c "halt" -c "sleep 200" \
				-c "flash erase_address 0x08000000 32768" \
				-c "reset halt" \
				-c "flash write_image erase build/rings/rings_bootloader_combo.bin 0x08000000" \
				-c "verify_image build/rings/rings_bootloader_combo.bin 0x08000000" \
				-c "sleep 200" -c "reset run" -c "shutdown"
Open On-Chip Debugger 0.9.0 (2021-02-11-17:22)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.217357
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
target state: halted
target halted due to debug-request, current mode: Handler External Interrupt(14)
xPSR: 0x2100001e pc: 0x080112ca msp: 0x2001fe68
Info : device id = 0x10076413
Info : flash size = 1024kbytes
erased address 0x08000000 (length 32768) in 0.930281s (34.398 KiB/s)
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
auto erase enabled
wrote 131072 bytes from file build/rings/rings_bootloader_combo.bin in 7.602121s (16.837 KiB/s)
target state: halted
target halted due to breakpoint, current mode: Thread 
xPSR: 0x61000000 pc: 0x2000002e msp: 0xfffffffc
verified 122432 bytes in 2.260276s (52.897 KiB/s)
shutdown command invoked
vagrant@vagrant-ubuntu-trusty-64:/vagrant/eurorack-modules$

steviet
Wiggling with Experience
Posts: 435
Joined: Wed Oct 17, 2018 9:47 am
Location: Montréal
Contact:

Re: Idiots Guide to Flashing Firmware?

Post by steviet » Thu Feb 11, 2021 3:11 pm

rafyc wrote:
Thu Feb 11, 2021 2:39 pm
Hi,

Followed the steps but have an issue here :
- Unable to match requested speed 2000 kHz, using 1800 kHz
- target halted due to debug-request, current mode: Handler External Interrupt(14)

STlink V2
Adafruit adapter and cable

Code: Select all

openocd -s /opt/local/share/openocd/scripts/ -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c "init" -c "halt" -c "sleep 200" \
				-c "flash erase_address 0x08000000 32768" \
				-c "reset halt" \
				-c "flash write_image erase build/rings/rings_bootloader_combo.bin 0x08000000" \
				-c "verify_image build/rings/rings_bootloader_combo.bin 0x08000000" \
				-c "sleep 200" -c "reset run" -c "shutdown"
Open On-Chip Debugger 0.9.0 (2021-02-11-17:22)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.217357
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
target state: halted
target halted due to debug-request, current mode: Handler External Interrupt(14)
xPSR: 0x2100001e pc: 0x080112ca msp: 0x2001fe68
Info : device id = 0x10076413
Info : flash size = 1024kbytes
erased address 0x08000000 (length 32768) in 0.930281s (34.398 KiB/s)
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
auto erase enabled
wrote 131072 bytes from file build/rings/rings_bootloader_combo.bin in 7.602121s (16.837 KiB/s)
target state: halted
target halted due to breakpoint, current mode: Thread 
xPSR: 0x61000000 pc: 0x2000002e msp: 0xfffffffc
verified 122432 bytes in 2.260276s (52.897 KiB/s)
shutdown command invoked
vagrant@vagrant-ubuntu-trusty-64:/vagrant/eurorack-modules$
That looks like a successful flash!



Also, there is the DEV environment guide that would be helpful in these endeavors. It is posted elsewhere, but I will link here as well:

https://github.com/pichenettes/mutable-dev-environment

There is also this spreadsheet, posted on the mutable forum by member "amycatass"



There is also a great post by squarewavesurfer I will quote here.
squarewavesurfer wrote:
Sun Aug 07, 2016 4:24 pm
I have decided to write a long post to help others using windows 10 to program DIY mutable modules.

Background:

Over the last couple months I have started doing DIY mutable instruments builds. To date, with the help from muffwigglers users, I have successfully built and programmed Braids, Branches, Tides (sheep), and Rings.

Start by following the instructions here to install what you need to get started with the virtual machine:
https://github.com/pichenettes/mutable-dev-environment

other great resources:
- Tom Whitwell's blog on writing mutable code
https://medium.com/music-thing-modular- ... .opdlmydjr
- DIY unsuccessful builds forum
viewtopic.php?t=143366&start=575&postda ... highlight=
- DIY successful builds forum
viewtopic.php?t=138926&start=0&postdays ... highlight=


Problem 1: If unable to get the mutable dev vagrant environment working in windows follow these instructions:
  • If Guest Additions for Virtual Machine crash during install, follow these instructions:
    • Thanks to sunlover on virtualbox.org forums (https://forums.virtualbox.org/viewtopic.php?f=2&t=64251)

      To fix the guest and install additions you have to enable 3D in the VM settings and then either:
      a) reinstall W10 and install 4.3.18 guest additions from scratch;
      or
      b) run
      VBoxWindowsAdditions-x86.exe /uninstall
      in the guest. Reboot the guest (this is important). And then install additions again.

      Generally to use W10 guest with VirtualBox 4.3.18:
      1) use 'Windows 8.1' guest type when the VM is created;
      2) enable 3D acceleration in the VM settings;
      3) install 4.3.18 guest additions.
Problem 2: ssh commands don't work in command prompt for windows 1
  • To use ssh commands in windows 10:

    - Install git: http://git-scm.com/download/win

    - Open Command Prompt (Run as Administrator)

    - type: PATH=%PATH%;C:\Program Files\Git\usr\bin
    - this has to be typed each time you open the command prompt
Problem 3: After "vagrant up" (step 4 below), if mounting fails try this:
  • - if mounting fails, go to Oracle and remove the mutable dev master virtual machine and restart your computer (not sure why, but this seems to help) and return to step 1 (below)

After the above (and every time I want to compile or upload code), I am able to get the environment up and running by:
  • 1. Open Command Prompt (Run as Administrator)

    2. type: set PATH=%PATH%;C:\Program Files\Git\usr\bin

    3. type: cd c:\Users\your user name here\.vagrant.d\mutable-dev-environment-master\

    4. type: vagrant up
    • - wait for command prompt to return to "c:\Users\your user name here\.vagrant.d\mutable-dev-environment-master\"


    5. type: vagrant ssh
    • - wait for command prompt to show "vagrant@vagrant-ubuntu-trusty-64:/vagrant/eurorack-modules$"


    6. type: git submodule update --init

    7. type: make -f braids/bootloader/makefile hex
    type: make -f braids/makefile

    8. type: make -f braids/makefile upload_combo_jtag



step 7 and 8 will vary depending on the module and the interface you are using.

Look on the mutable site's open source section of each module for info: http://mutable-instruments.net/modules/braids/open

For ARM modules (e.g. Braids, Rings):
I am using the recommended Olimex ARM-USB-OCD-H (note: you also need adapter ARM-JTAG 20-10 from Olimex)

For AVR modules (e.g. Branches):
I am using the Olimex AVR-ISP-MK2 (note: you need an adapter to go from the 10-pin ICSP10 to the 6-pin mini jtag - I made my own).



Problem 4: Errors received when trying to upload firmware to module using the mutable vagrant environment using the Olimex AVR-ISP-MKII:
  • Note: the instructions for code compiling may not be 100% correct as I compiled it weeks ago. It was the uploading of the code I couldn't do until today.

    Here is how I got it to work with some help from muffwiggler user adam:


    1. Use mutable vagrant environment to compile the bootloader and code. This will create the build folders: Branches and Branches_Bootloader in \.vagrant.d\mutable-dev-environment-master\eurorack-modules\build
    - make -f branches/bootloader/makefile hex
    - make -f branches/makefile

    2. Install Atmel Studio 7.0 (may not be able to detech Olimex avr isp mkii at first): To fix this error (thanks to Ant2N on the Olimex forums) https://www.olimex.com/forum/index.php?topic=4065.0):

    - Download Zadig: http://zadig.akeo.ie/. Zadig is a USB driver manager for Windows, and saved me a hundred times this year. The last version comes with the libusb-win32 (v1.2.6.0) driver embedded.

    - Open Zadig, Options, List All Devices. The AVRISP mkII device should appear in the list.
    - Replace its current driver by libusb-win32 (v1.2.6.0)

    3. Use Atmel Studio 7.0 to flash the chip:

    - Select Tools -> device programmer
    - Select IVR isp mkii from Tool list
    - select device (select the exact chip: ATmega88PA)
    - select apply
    - program fuses:
    - extended fuse: 0xF8
    - high fuse: 0xDD
    - low fuse: 0xE2
    - program lock bit:
    - lockbit: 0x2F
    - under program file, program device from ELF production file: open bootloader ELF file: /builds/branches_bootloader/branches_bootloader.elf, check flash, then select program
    - under program file, program device from ELF production file: open firmware ELF file: /builds/branches/branches.elf, check flash, then select program


    DONE!
Hopefully this compiled post helps a bit :tu:
Soundcloud
Website - DIY/Euro/Gear Blog updated every Sunday

User avatar
rafyc
Common Wiggler
Posts: 224
Joined: Fri Feb 14, 2020 12:01 pm
Location: Paris

Re: Idiots Guide to Flashing Firmware?

Post by rafyc » Thu Feb 11, 2021 3:21 pm

Really great !!!
Haha it's working thanks so much ! my first module

steviet
Wiggling with Experience
Posts: 435
Joined: Wed Oct 17, 2018 9:47 am
Location: Montréal
Contact:

Re: Idiots Guide to Flashing Firmware?

Post by steviet » Thu Feb 11, 2021 4:40 pm

rafyc wrote:
Thu Feb 11, 2021 3:21 pm
Really great !!!
Haha it's working thanks so much ! my first module
:sb: stoked to hear that, enjoy!
Soundcloud
Website - DIY/Euro/Gear Blog updated every Sunday

User avatar
rafyc
Common Wiggler
Posts: 224
Joined: Fri Feb 14, 2020 12:01 pm
Location: Paris

Re: Idiots Guide to Flashing Firmware?

Post by rafyc » Thu Feb 11, 2021 7:05 pm

steviet wrote:
Thu Feb 11, 2021 4:40 pm
rafyc wrote:
Thu Feb 11, 2021 3:21 pm
Really great !!!
Haha it's working thanks so much ! my first module
:sb: stoked to hear that, enjoy!
Thanks ! but Just one knob not working :doh:

User avatar
rafyc
Common Wiggler
Posts: 224
Joined: Fri Feb 14, 2020 12:01 pm
Location: Paris

Re: Idiots Guide to Flashing Firmware?

Post by rafyc » Sat Mar 06, 2021 5:49 pm

Could i flash Plaits with STM8 port on ST-Link V2 ?
An adaptator was provide with the STV2 and fit with Plaits.

User avatar
Altitude909
Super Deluxe Wiggler
Posts: 3684
Joined: Wed Aug 24, 2011 5:13 pm
Location: Meesheegan

Re: Idiots Guide to Flashing Firmware?

Post by Altitude909 » Sat Mar 06, 2021 9:15 pm

rafyc wrote:
Sat Mar 06, 2021 5:49 pm
Could i flash Plaits with STM8 port on ST-Link V2 ?
An adaptator was provide with the STV2 and fit with Plaits.
no. You need to wire up the Stlink for SWD

User avatar
rafyc
Common Wiggler
Posts: 224
Joined: Fri Feb 14, 2020 12:01 pm
Location: Paris

Re: Idiots Guide to Flashing Firmware?

Post by rafyc » Mon Mar 08, 2021 2:38 pm

Altitude909 wrote:
Sat Mar 06, 2021 9:15 pm
rafyc wrote:
Sat Mar 06, 2021 5:49 pm
Could i flash Plaits with STM8 port on ST-Link V2 ?
An adaptator was provide with the STV2 and fit with Plaits.


no. You need to wire up the Stlink for SWD


Ok thanks just grab the adaptor and liked the jumper cable to the SWD port.
But when i try to upload it return me this : init mode failed (unable to connect to the target)

Code: Select all

openocd -s /opt/local/share/openocd/scripts/ -f interface/stlink-v2.cfg -f target/stm32f3x.cfg -c "init" -c "halt" -c "sleep 200" \
				-c "flash erase_address 0x08000000 32768" \
				-c "reset halt" \
				-c "flash write_image erase build/plaits/plaits_bootloader_combo.bin 0x08000000" \
				-c "verify_image build/plaits/plaits_bootloader_combo.bin 0x08000000" \
				-c "sleep 200" -c "reset run" -c "shutdown"
Open On-Chip Debugger 0.9.0 (2021-02-11-17:22)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.215779
Error: init mode failed (unable to connect to the target)
in procedure 'init' 
in procedure 'ocd_bouncer'

make: *** [upload_combo_jtag_erase_first] Error 1
vagrant@vagrant-ubuntu-trusty-64:/vagrant/eurorack-modules$ 
Where to find stlink-v2.cfg ?

Maybe this auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
how the write this command line ?
[/s][/s]

Short somewhere due to poor pcb quality, psu verry hot..

thanks

User avatar
Bodo1967
Veteran Wiggler
Posts: 722
Joined: Wed Aug 10, 2016 2:27 pm
Location: Germany

Re: Idiots Guide to Flashing Firmware?

Post by Bodo1967 » Thu Mar 25, 2021 3:34 am

Is there any source for the pre-compiled MI Branches firmware? I searched but couldn't find any. Just source code that - to be honest - looks like Klingon language to me.

My Branches module is ready for firmware flashing (at least for trying to do so), and I do have a "USB ISP AVR programmer".
But I admit the idea of having to install a VM and compile software code myself really scares me, since I have absolutely no experience in that.

If there is anything like

- install and open this little software tool (something like the "Teensy loader" perhaps)
- connect the programmer to your computer via USB, do <this> in the above mentioned software tool to move the firmware onto the programmer
- connect the Branches PCB to the programmer
- press <this> button
- done, enjoy

I'd be really glad.

I mean, I have successfully flashed firmware onto an Arduino and a Teensy, but in both cases this was available as .ino files, and I didn't have to compile anything myself.
... why buy it for $100 when you can build it yourself for $150?

User avatar
Kelaifu
Common Wiggler
Posts: 74
Joined: Wed Jun 03, 2020 11:11 pm

Re: Idiots Guide to Flashing Firmware?

Post by Kelaifu » Thu Apr 01, 2021 8:57 pm

I've almost finished my 1U Apex / Peaks module, is it possible to flash this using the ST32 discovery board? I was told that I could, but googling doesnt seem to find me anything I can understand to tell me this is the case. I need to order some of the tiny pin headers and cables anyway, so do I need to buy a different programmer while I am at it?

the_laconic
Learning to Wiggle
Posts: 48
Joined: Tue Feb 02, 2021 12:50 pm

Re: Idiots Guide to Flashing Firmware?

Post by the_laconic » Fri Apr 02, 2021 11:16 am

Funny, I've almost finished my 1U Apex too. I'm using an STLinkv2 to flash the chip, but I'm getting these errors:

Open On-Chip Debugger 0.9.0 (2021-03-13-14:49)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 0.606697
Error: target voltage may be too low for reliable debugging
Error: init mode failed (unable to connect to the target)
in procedure 'init'
in procedure 'ocd_bouncer'

make: *** [upload_combo_jtag] Error 1


Is the problem simply that it can't connect to the chip at all? It is ever-so-slightly askew...

Edit: I think I had the connector backwards.

Edit 2: It's a success. At least, I'm getting out some sweet kicks and snares...

You know, reading about it gives you the impression that flashing firmware is really complicated. I just followed the instructions on the MI Github and it was waaaaaay more simple than I expected.

the_laconic
Learning to Wiggle
Posts: 48
Joined: Tue Feb 02, 2021 12:50 pm

Re: Idiots Guide to Flashing Firmware?

Post by the_laconic » Fri Apr 02, 2021 6:46 pm

Kelaifu wrote:
Thu Apr 01, 2021 8:57 pm
I've almost finished my 1U Apex / Peaks module, is it possible to flash this using the ST32 discovery board? I was told that I could, but googling doesnt seem to find me anything I can understand to tell me this is the case. I need to order some of the tiny pin headers and cables anyway, so do I need to buy a different programmer while I am at it?
FYI, I don't know whether you need a different programmer, but since I just built exactly the same thing, I'll tell you what worked for me: an ST-Link v2, using a Mac, and following the directions on the MI GitHub. You'd need a JTAG-SWD converter, which you can get for $5 from Digi-Key, and the wee SWD cable. It was so easy in the end, and (this isn't directed at you but) nobody should be thinking OMG I CAN'T COMMAND LINE, because there's very little you have to figure out for yourself.

User avatar
Bodo1967
Veteran Wiggler
Posts: 722
Joined: Wed Aug 10, 2016 2:27 pm
Location: Germany

Re: Idiots Guide to Flashing Firmware?

Post by Bodo1967 » Sat Apr 03, 2021 5:33 am

the_laconic wrote:
Fri Apr 02, 2021 6:46 pm
and (this isn't directed at you but) nobody should be thinking OMG I CAN'T COMMAND LINE
In case it was actually directed at me: That's perfectly OK since that is exactly how I feel 8-) :lol: .
... why buy it for $100 when you can build it yourself for $150?

User avatar
Bodo1967
Veteran Wiggler
Posts: 722
Joined: Wed Aug 10, 2016 2:27 pm
Location: Germany

Re: Idiots Guide to Flashing Firmware?

Post by Bodo1967 » Mon Apr 05, 2021 8:44 am

Bodo1967 wrote:
Sat Apr 03, 2021 5:33 am
the_laconic wrote:
Fri Apr 02, 2021 6:46 pm
and (this isn't directed at you but) nobody should be thinking OMG I CAN'T COMMAND LINE
In case it was actually directed at me: That's perfectly OK since that is exactly how I feel 8-) :lol: .
Well yes. I had a look into it today, and now officially have given up. So no Branches for me, I suppose.
... why buy it for $100 when you can build it yourself for $150?

the_laconic
Learning to Wiggle
Posts: 48
Joined: Tue Feb 02, 2021 12:50 pm

Re: Idiots Guide to Flashing Firmware?

Post by the_laconic » Mon Apr 05, 2021 8:41 pm

Bodo1967 wrote:
Mon Apr 05, 2021 8:44 am
Bodo1967 wrote:
Sat Apr 03, 2021 5:33 am
the_laconic wrote:
Fri Apr 02, 2021 6:46 pm
and (this isn't directed at you but) nobody should be thinking OMG I CAN'T COMMAND LINE
In case it was actually directed at me: That's perfectly OK since that is exactly how I feel 8-) :lol: .
Well yes. I had a look into it today, and now officially have given up. So no Branches for me, I suppose.
if you have a Mac and get the right programmer (I had originally written STLink-v2, but that's not the right one for Branches), I'll try to walk you through it.

Otherwise, you can always buy a flashed chip from Synthcube for about $25. That's what I did for the first few MI builds.

Either way, it's about a $25 investment -- the first might not work, but if it does, you're laughing mate. The second will work for sure (unless you fry the chip) but it's $25 again if you want to do another.

Then again, I see you're in Germany, so you might look for a closer source...

Post Reply

Return to “Music Tech DIY”