Reading characters from Serial1

@armor @nrobinson2000 Thanks for the response. I’m using OpenLog instead of SDFat because we only have access to UART, not txrx. OP on this thread is part of the same project, if you want more details. It might end up being more stable to using SDFat, but we have limited options at this time.

As for the issue that I’m trying to solve. First, I’ll be more clear about what we are doing:

  1. On our app, we are allowing users to download a firmware file, which we will encode the hexadecimal to base64 to make reading the characters from Serial more reliable. The file will go onto an SD card.
  2. Read characters from SD card using OpenLog, Serial1.
  3. Decode base64 and store as uint8_t
  4. flash 512 byte chunks using the system_update API.

The issue that we are having is at #2 reading the Serial1 from the SD card reliably. The rest is working.

As for char array vs String, I’m open to both options. Basically I need to be able to read only ASCII-safe characters and save to a char array or uint8_t byte array without null characters. The example above is to illustrate that we are storing null characters. I’m not quite sure how to remove those. Any ideas?