Building Braids fw from source

I’m at a point now where I had to flip the path variables back to get the Braids code to compile and now I get the entry error again when trying to compile oscillator test. My head hurts. I’ll have to figure out how to get things setup so I can compile both without having to flip Path variables, that just seems weird, I seem to have conflicting installations of “stuff”. Then I’ll try to rebuild oscillator_test.

My last build of oscillator test was using:
osc.set_shape(MACRO_OSC_SHAPE_STRUCK_DRUM);
osc.set_parameters(16000, 24000);
In the for loop:
osc.set_parameters(16000, 0); (I guess that was osc.set_parameters(16384, 0) so this would be the only difference from the code that I downloaded.)
osc.set_pitch((0 << 7));

osc.set_pitch(0 << 7);

MIDI note 0, 8 Hz or so. Change that.

I haven’t drilled down into the code yet to see what the the values represent, OK, that might help. :slight_smile: Thanks!

To solve the unused temp variable error mentioned above, remove -Werror from CFLAGS in makefile.inc. It will disable reporting warnings as errors.

VCC out : 3.3V ; Logic level : 3.3V ; Pin 6 : not used anyway.

Problem:
python stm_audio_bootloader/qpsk/encoder.py \\
-s 48000 -b 12000 -c 6000 -p 256 \\
build/braids/braids.bin
Traceback (most recent call last):
File “stm_audio_bootloader/qpsk/encoder.py”, line 35, in
from stm_audio_bootloader import audio_stream_writer
ImportError: No module named stm_audio_bootloader
make: ***** [wav] Error 1

Edit: Answer is above.

Now I try to install the firmware on my braids via ftdi. I have the ftdi friends. It has several options via solder jumpers. Which one is right? :slight_smile:
VCC Out: 5v (default) vs 3v
Signal logic level: 5v vs 3v (default)
Pin 6 signal: DTR vs RTS (default)

Also if I try to compile it with make -f braids/makefile upload_combo_serial I get the error:
ImportError: No module named serial

Do I need to download anything serial related?
Edit: Yep, I need. To install braids firmware via ftdi, you need to install pyserial

Hi,

I can build the code and upload it to the Olimex STM32-H103 without ADC/DAC or buttoms.
How far will it go without the other devices?
Will add the serial port level converter next.

Still trying to follow the boot code path to the main control loop.
I see JumpTo kStartAddress (8004000) in bootloader.cc but not sure where System.Init is or main.
The make file in braids/bootloader and stmlib/makefile.inc almost look recursive…

Also don’t see where the startup code jumps to the bootloader code.

–Mitch

> How far will it go without the other devices?

The code will not block even if all peripherals are missing. There’s no point at which it blocks and expects something from peripherals.

The bootloader main is in bootloader.cc ; the application main is in braids.cc. System::Init is in drivers/system.cc

> The make file in braids/bootloader and stmlib/makefile.inc almost look recursive…

stmlib/makefile.inc is not project specific. braids/makefile and braids/bootloader/makefile are specializations of it for the “braids bootloader” and “braids application” projects.

There are two instances of the startup code. One that starts after 0x8000000 and that jumps into the bootloader’s main() ; and one that starts after 8004000 and that jumps into the application’s main().

Thanks, now it’s obvious…

Where’s the code that calls UartLogger and writes data on the Tx pin?

Could the UI code be directed to a serial port?

–Mitch

> Where’s the code that calls UartLogger and writes data on the Tx pin?

Nowhere :slight_smile: I used it for a while for troubleshooting.

> Could the UI code be directed to a serial port?

For output:

You could create a class “ExternalSerialDisplay” that has the same public interface as the Display class, and just replace Display by ExternalSerialDisplay in the display_ declaration in ui.h

For input:

Rework Ui::Poll to poll the serial input and post fake events in the UI queue depending on what it reads on the input.

Haaa, nice exercise for the student…

How best to call UartLogger for debugging?

Thanks, Mitch

Any C++ book suggestions?

Thanks, Mitch

Create an instance at the scope that suits you (Globally in braids.cc ; or as a member of the UI class). Let’s say your instance is named logger.

Call logger.Init(9600); once during initialization (9600 is the baud rate)
logger.Trace(1/* some value */);

I’m trying to get the oscillator test to work. I try the following command:

make -f braids/test/makefile

and get this output:

braids/test/makefile:40: build/braids_test/depends.mk: No such file or directory
g++ -MM -DTEST -I. braids/analog_oscillator.cc -MF build/braids_test/analog_oscillator.d -MT build/braids_test/analog_oscillator.o
g++ -MM -DTEST -I. braids/digital_oscillator.cc -MF build/braids_test/digital_oscillator.d -MT build/braids_test/digital_oscillator.o
g++ -MM -DTEST -I. braids/macro_oscillator.cc -MF build/braids_test/macro_oscillator.d -MT build/braids_test/macro_oscillator.o
g++ -MM -DTEST -I. braids/test/braids_test.cc -MF build/braids_test/braids_test.d -MT build/braids_test/braids_test.o
g++ -MM -DTEST -I. braids/quantizer.cc -MF build/braids_test/quantizer.d -MT build/braids_test/quantizer.o
g++ -MM -DTEST -I. braids/resources.cc -MF build/braids_test/resources.d -MT build/braids_test/resources.o
g++ -MM -DTEST -I. stmlib/utils/random.cc -MF build/braids_test/random.d -MT build/braids_test/random.o
cat build/braids_test/analog_oscillator.d build/braids_test/digital_oscillator.d build/braids_test/macro_oscillator.d build/braids_test/braids_test.d build/braids_test/quantizer.d build/braids_test/resources.d build/braids_test/random.d > build/braids_test/depends.mk
g++ -c -DTEST -g -Wall -Werror -Wno-unused-variable -I. braids/analog_oscillator.cc -o build/braids_test/analog_oscillator.o
g++ -c -DTEST -g -Wall -Werror -Wno-unused-variable -I. braids/digital_oscillator.cc -o build/braids_test/digital_oscillator.o
g++ -c -DTEST -g -Wall -Werror -Wno-unused-variable -I. braids/macro_oscillator.cc -o build/braids_test/macro_oscillator.o
g++ -c -DTEST -g -Wall -Werror -Wno-unused-variable -I. braids/test/braids_test.cc -o build/braids_test/braids_test.o
g++ -c -DTEST -g -Wall -Werror -Wno-unused-variable -I. braids/quantizer.cc -o build/braids_test/quantizer.o
g++ -c -DTEST -g -Wall -Werror -Wno-unused-variable -I. braids/resources.cc -o build/braids_test/resources.o
g++ -c -DTEST -g -Wall -Werror -Wno-unused-variable -I. stmlib/utils/random.cc -o build/braids_test/random.o
g++ -o braids_test build/braids_test/analog_oscillator.o build/braids_test/digital_oscillator.o build/braids_test/macro_oscillator.o build/braids_test/braids_test.o build/braids_test/quantizer.o build/braids_test/resources.o build/braids_test/random.o

A file is created called “braids_test” in the eurorack directory. But I cannot find any .wav file.

Ahhh I get it… the file “braids_test” is an executable…