Is it possible that a library conflicts with Serial.println("Hello World") in setup()?

Hi,

I have an Arduino UNO board and am testing with PlatformIO. The code is pretty straightforward:

#include <Arduino.h>

void setup()
{
  Serial.begin(9600);
  Serial.println("Hello World");
}

void loop()
{
}

platformio.ini

[env:uno]
platform = atmelavr
board = uno
framework = arduino

Upload then I get:

 *  Executing task: platformio device monitor 

--- Terminal on /dev/cu.wchusbserial1120 | 9600 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
Hello World

But with the library daknuett/cryptosuite2@^0.2.5 in platformio.ini like this:

[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps = 
	daknuett/cryptosuite2@^0.2.5

No code seems to be running and the serial monitor outputs no “Hello World”:

 *  Executing task: platformio device monitor 

--- Terminal on /dev/cu.wchusbserial1120 | 9600 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H

Any ideas? Thank you!

I have recreated the same problem as your’s on my own Uno. So yes, it appears that the library might be doing something untoward.

I note that the wrapper class inherits from the Arduino Print class, which means that it can use the write() function. It appears to use this to add a new byte of data to the hash. I can’t see, yet, why it is affecting Serial output though. If I have time – I’m editing my second Arduino book – I’ll have a deeper look.

For now, it appears that the crypto library and Serial output are not compatible. You might want to try this in the Arduino IDE and if it shows the same problem, log an issue with the library developer(s) at GitHub - daknuett/cryptosuite2: Cryptographic suite for Arduino (SHA, HMAC-SHA).

Cheers,
Norm.

1 Like

According to this issue, 0.2.7 fixed the bug.

1 Like

Excellent. Thanks for the update. That was a weird one.

Cheers,
Norm.