C++ code compiles, uploads, but doesn't make the board do anything (works in Arduino)

I spent last week writing some simple code using DaisyDuino to program the Daisy Patch Submodule, testing various panel components/interactions with a custom control board I’ve designed.

I’ve had success with this, but the end goal is to move to C++ and make proper use of the DaisySP and libDaisy libraries. I ported my Arduino code over and changed the syntax for all the necessary declarations etc. The code builds successfully, with no errors, and I can use make program-dfu to flash it to the Patch SM - again, no errors. However - once it’s on the board, nothing happens.

I’m really only declaring objects and setting the state of some LEDs to on, and it works exactly as expected via Arduino, but not in C++. Is it possible for code to compile and upload, but not actually work?

Best thing to do is to post some source code, so we might figure this out.

I assume you’ve verified your installation works, but building and running some example programs?

Yep, I’ve verified the functionality with the example sketches. I’ve narrowed it down to daisy::patch_sm::DaisyPatchSM::PrintLine(). I am printing every 500ms so as not to block the while loop.

I managed to verify that the below works without affecting functionality:


[Console Output: char]

I then found this post: Using Log to print variables?. The solution doesn’t work as suggested, since the variable part of the output is blank:

float myFloat = 1.234f;
hw.PrintLine("Print a float value:%.3f", myfloat);

[Console Output: Print a float value:       ]

If I go one step further and regularly update myFloat as part of a loop, that’s when the hardware crashes and the serial console doesn’t print anything at all, which is what prompted me to post the question. Apologies, the extra detail would have been useful - I should have waited until I had done the testing to pin down the issue!