Open dzalf opened 6 months ago
Memory usage change @ e5a92b21937c42cf4768f10850247d8c730e35b1
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:avr:mega |
:small_red_triangle: 0 - +164 | 0.0 - +0.06 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:nano |
:small_red_triangle: 0 - +164 | 0.0 - +0.53 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_nano:nano33ble |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_nano:nanorp2040connect |
:small_red_triangle: 0 - +6 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_portenta:envie_m7:target_core=cm4 |
N/A | N/A | N/A | N/A |
arduino:mbed_portenta:envie_m7 |
N/A | N/A | N/A | N/A |
arduino:megaavr:nona4809 |
:small_red_triangle: 0 - +164 | 0.0 - +0.33 | 0 - 0 | 0.0 - 0.0 |
arduino:sam:arduino_due_x_dbg |
:small_red_triangle: 0 - +8 | 0.0 - 0.0 | N/A | N/A |
arduino:samd:mkrzero |
:small_red_triangle: 0 - +4 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
Dear @per1234
Do you have any idea why the tests failed on the Leonardo board?
Cheers
@dzalf have you looked at the logs:
https://github.com/arduino-libraries/SD/actions/runs/8148913387/job/22272654075?pr=148#step:3:170
/home/runner/Arduino/libraries/SD/src/utility/SdFat.h:281:73: error: could not convert '& Serial' from 'Serial_*' to 'HardwareSerial*'
void ls(uint8_t flags = 0, uint8_t indent = 0, HardwareSerial *port = &Serial);
^~~~~~~
/home/runner/Arduino/libraries/SD/src/utility/SdFat.h:287:84: error: could not convert '& Serial' from 'Serial_*' to 'HardwareSerial*'
static void printDirName(const dir_t &dir, uint8_t width, HardwareSerial *port = &Serial);
^~~~~~~
/home/runner/Arduino/libraries/SD/src/utility/SdFat.h:288:69: error: could not convert '& Serial' from 'Serial_*' to 'HardwareSerial*'
static void printFatDate(uint16_t fatDate, HardwareSerial *port = &Serial);
^~~~~~~
/home/runner/Arduino/libraries/SD/src/utility/SdFat.h:289:69: error: could not convert '& Serial' from 'Serial_*' to 'HardwareSerial*'
static void printFatTime(uint16_t fatTime, HardwareSerial *port = &Serial);
^~~~~~~
/home/runner/Arduino/libraries/SD/src/utility/SdFat.h:290:64: error: could not convert '& Serial' from 'Serial_*' to 'HardwareSerial*'
static void printTwoDigits(uint8_t v, HardwareSerial *port = &Serial);
^~~~~~~
/home/runner/work/SD/SD/examples/CardInfo/CardInfo.ino: In function 'void setup()':
/home/runner/work/SD/SD/examples/CardInfo/CardInfo.ino:113:35: error: cannot convert 'Serial_*' to 'HardwareSerial*' for argument '3' to 'void SdFile::ls(uint8_t, uint8_t, HardwareSerial*)'
You can reproduce it locally by installing the version of the library from this PR, selecting Tools > Board > Arduino AVR Boards > Arduino Leonardo from the Arduino IDE menus, and then compiling a sketch sketch that uses the SD library.
Note this:
https://github.com/arduino/ArduinoCore-avr/blob/1.8.6/cores/arduino/USBAPI.h#L154
extern Serial_ Serial;
Dear @per1234
Apologies, I had not seen those.
It makes sense to me now. I wasn't aware of the extern Serial object declaration on the Leonardo API.
Any workaround ideas to integrate this enhancement?
Memory usage change @ 03b49f038eebe053d3c25c3584523d8e02538dcb
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:avr:mega |
:small_red_triangle: 0 - +164 | 0.0 - +0.06 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:nano |
:small_red_triangle: 0 - +164 | 0.0 - +0.53 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_nano:nano33ble |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_nano:nanorp2040connect |
:small_red_triangle: 0 - +2 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_portenta:envie_m7 |
N/A | N/A | N/A | N/A |
arduino:mbed_portenta:envie_m7:target_core=cm4 |
N/A | N/A | N/A | N/A |
arduino:megaavr:nona4809 |
:small_red_triangle: 0 - +164 | 0.0 - +0.33 | 0 - 0 | 0.0 - 0.0 |
arduino:sam:arduino_due_x_dbg |
:small_red_triangle: 0 - +8 | 0.0 - 0.0 | N/A | N/A |
arduino:samd:mkrzero |
0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
The library currently prints information from the SD Card like filenames, and file sizes to the Serial port (connected to USB in most cases) by default.
By assigning a pointer to a
HardwareSerial
object it is possible to print such information to any port selected by the user.This becomes relevant when working with chips that have multiple UART ports: e.g. when debugging code on a separate serial port.