Open Source Synth Update: A Firmware Revelation

My God, we’ve done it!

Will put together the final piece that allows us to finally put this project in to the sunset phase.

He confirmed by rolling back the compiler to GCC 4.3.3 (the original compiled version) we could get the unit to actually work as it is supposed to. Apparently, AVR-GCC is available usually through microchip or some various locations and older versions are not available readily. So Will ended up snooping He did it through this GitHub repository (https://github.com/smeshlink/Arduino-Plus/tree/master) a fork of the Arduino main line development from 2013 (11 years ago now!). That repo happened to upload the old AVR-GCC version and will pulled it down and started the compile.

Now, I was warned about this over by the original developer. See the post I read once or twice back when I had all those issues with what ended up being the AVR fuses…

Found wisdom of the comments

I suppose until you have gone down the rabbit hole you don’t really understand what not guaranteed to work really means.

I’ve yet to recompile on my end, but using Will’s compiled build removes all of the chaotic behavior the synthesizer was showing before. One of the points of code that is likely quite dependent on this compiler version is a snippet that occurs in the editor.cc file.

void Editor::OnProgrammerSwitch(const Event& event) {
uint8_t id = event.control_id - SWITCH_OSC_2_MINUS;
uint8_t parameter_index = pgm_read_byte(programmer_switch_mapping + id);
if (parameter_index != 0xff) {
int8_t increment = parameter_index & 0x80 ? -1 : 1;
parameter_index = parameter_index & 0x7f;

}

else {
OnLongClick();
}
};

Note that this function does a direct read of program memory via the pgm_read_byte() function. This function is used to directly read pgm memory. In this case, the code works to reading flash out into memory at a specific address as command. Now this could work but the method of using “programmer_switch_mapping + that index means at some point the compiler (no matter how good it is) is not aware of this memory location. The call in this case requires foreknowledge of where this given piece of information resides in active memory. The compiler is unable to check for any sort of error condition in the way it is written. For all it cares, the compiler is presented with a sum of two numbers before passing up to pgm_read_byte. No checks can be done on whether the memory is valid or not or if there is anything at the target address.

I can imagine something like this was done to same memory usage in a constrained design (to do: is there a linker output report?) if you aren’t going to use up these things as much in the code space. But again this is mere speculation. At least at the moment we have functioning products.

New PWBs and manufacturing errors

I received a new set of PWBS this week. I was excited to build and started soldering them up when I saw this

Note those cuts in the PWB

Traces broken in multiple sections of the board from what looks like a razor blade or something run across the board. Whats odd is its just one out of the group of boards so I didn’t lose my entire $230 on these from OSH park. I emailed them out and received a very quick response. They let me know this board should have been screened out of my order as a test sample and I’ve gotten the extra boards as a show of good faith.

I do like the aesthetic of the clear solder mask style, but with so much of the copper plane covering each side I think I’ve lost the cool factor that would have come with more black.

“It’s possible the fab was attempting to indicate an etching failure on that one copy. During AOI testing they’ll scratch the traces, which lets someone else down the line know to mark it with a big silver “X” so we can notice it and get a replacement started.

Onward to soldering up this round of boards and getting prototypes out to my friends. Will is still on the enclosure part then we can start packing this project up.

Roadmap

  • Build the remainder of analog and digital units
  • Send them to friends!
  • Design and fab cases for these synths
  • Create a lessons learned

Random Observations

Until this point my head was so deep in the design I never questioned the original name of this synth the Shruthi. I happened to mis type a google search and I learned that this is an accordion like drone instrument out of India. Some links below.

https://en.wikipedia.org/wiki/Shruti_box

Shruti Box 3 Octave 39 Keys C to C Brass Handle Large size Yellow Color | eBay

https://gcc.gnu.org/releases.html
I’m not quite sure about my AVR-GCC comments any more or even whether or not AVR-GCC is just standard GCC wrapped with some libraries. I have gotten turned around on this on. Something to report back on in another post.

Leave a Comment