Skip to content

Allow compilation in absence of RS485 library #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,16 @@ This limitation only affects Portenta C33 boards.
## 📖 Documentation

For more information about this library please read the documentation [here](./docs).

## 🐛 Debugging

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
One of two methods are typically used to debug programs:
- Adding code to print program status information to the serial port (e.g., `Serial.print` calls), which can be viewed in [Serial Monitor](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-serial-monitor)
- "[In-circuit emulation](https://en.wikipedia.org/wiki/In-circuit_emulation)" using a debug probe and [debugger](https://en.wikipedia.org/wiki/Debugger)

Add an introductory overview. This will make it easier for the reader to understand the nature of the dilemma presented in the subsequent sentences.

Printing debug messages over the USB Serial port is not possible when the USB port is used for data storage operations. On Arduino Opta this is the only accessible option however, since no JTAG connector is exposed. Therefore you need to resort to the RS485 connector to see the output of your messages. To do so you can use the `debugPrint` function from this library. In order to make it work you will have to install the `ArduinoRS485` library beforehand and add the corresponding header in your sketch above the include for this library. e.g.
Copy link
Contributor

@per1234 per1234 Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Printing debug messages over the USB Serial port is not possible when the USB port is used for data storage operations. On Arduino Opta this is the only accessible option however, since no JTAG connector is exposed. Therefore you need to resort to the RS485 connector to see the output of your messages. To do so you can use the `debugPrint` function from this library. In order to make it work you will have to install the `ArduinoRS485` library beforehand and add the corresponding header in your sketch above the include for this library. e.g.
Printing debug messages over the USB Serial port is not possible when the USB port is used for data storage operations. When using Arduino Opta, the alternative "in-circuit emulation" approach is also unavailable due to not having an exposed JTAG connector. Therefore in order to debug programs on the Opta you must resort to using the RS485 connector to see the output of your messages. To do so you can use the `debugPrint` function from this library. In order to make it work you will have to install the `ArduinoRS485` library beforehand and add an `#include` directive for that library in your sketch above the include for this library. e.g.
  • Reference information provided by the overview I proposed.
  • Make it more clear that the information re: RS-485 is specific to Opta.
  • Minor improvements to wording.


```cpp
#include <ArduinoRS485.h>
#include <Arduino_UnifiedStorage.h>

void setup(){
debugPrint("I'm alive!");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
debugPrint("I'm alive!");
Arduino_UnifiedStorage::debugPrint("I'm alive!");

}
```
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ paragraph=With this versatile library, you can seamlessly handle various storage
category=Data Storage
url=https://github.com/arduino-libraries/Arduino_UnifiedStorage
architectures=renesas_portenta,mbed_portenta,mbed_opta
depends=Arduino_POSIXStorage,ArduinoRS485
depends=Arduino_POSIXStorage
includes=Arduino_UnifiedStorage.h
2 changes: 1 addition & 1 deletion src/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "Arduino_POSIXStorage.h"
#include <iostream>

#if !defined(HAS_SERIAL) && defined(HAS_RS485)
#if !defined(HAS_SERIAL) && defined(HAS_RS485) && __has_include(<ArduinoRS485.h>)
#include <ArduinoRS485.h>


Expand Down
Loading