Hello I’m running Arduino IDE on Windows with mbed lib 2.9.1, and I am using Seeed Xiao expansion board with Xiao BLE Sense.
I need to read the adc value of PIN_VBAT, and I also need IMU, SD, RTC, and QSPI flash. I updated the local library files according to the following git repo commit. After update, the “mbed.h” will not compile with “SdFat.h”, though each of them will compile individually. The code and error message are attached below. Interestingly, the <SD.h> works just fine with “mbed.h”.
In addition, the qspi block device no longer work after that pin update. The initialization is ok, but read and write would fail.
Code and error message.
// #include <Arduino.h>
//#include "SD.h"
#include "SdFat.h"
//#include "SPI.h"
#include "mbed.h"
// #include "BlockDevice.h"
// #include "QSPIFBlockDevice.h"
void setup() {
}
void loop() {
// nothing happens after setup
}
In file included from c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\spidriver\sdspidriver.h:31:0,
from c:\Users\yang.x.30\OneDrive - Procter and Gamble\Documents\Arduino\libraries\SdFat\src/SdCard/SdSpiCard.h:33,
from c:\Users\yang.x.30\OneDrive - Procter and Gamble\Documents\Arduino\libraries\SdFat\src/SdCard/SdCard.h:31,
from c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\fsblockdevice.h:27,
from c:\Users\yang.x.30\OneDrive - Procter and Gamble\Documents\Arduino\libraries\SdFat\src/ExFatLib/ExFatFormatter.h:27,
from c:\Users\yang.x.30\OneDrive - Procter and Gamble\Documents\Arduino\libraries\SdFat\src/ExFatLib/ExFatLib.h:27,
from c:\Users\yang.x.30\OneDrive - Procter and Gamble\Documents\Arduino\libraries\SdFat\src/SdFat.h:31,
from C:\Users\yang.x.30\AppData\Local\Temp\.arduinoIDE-unsaved2023317-13544-sf2kxr.y4gda\sketch_apr17a\sketch_apr17a.ino:4:
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h: In member function 'int events::EventQueue::call(F)':
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h:781:26: error: expected type-specifier
F *e = new (p) F(std::move(f));
^
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:17: note: in definition of macro 'F'
#define F(str) (str)
^~~
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h:781:26: error: expected ')'
F *e = new (p) F(std::move(f));
^
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:17: note: in definition of macro 'F'
#define F(str) (str)
^~~
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h: In member function 'int events::EventQueue::call_in(events::EventQueue::duration, F)':
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h:856:26: error: expected type-specifier
F *e = new (p) F(std::move(f));
^
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:17: note: in definition of macro 'F'
#define F(str) (str)
^~~
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h:856:26: error: expected ')'
F *e = new (p) F(std::move(f));
^
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:17: note: in definition of macro 'F'
#define F(str) (str)
^~~
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h: In member function 'int events::EventQueue::call_every(events::EventQueue::duration, F)':
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h:1009:26: error: expected type-specifier
F *e = new (p) F(std::move(f));
^
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:17: note: in definition of macro 'F'
#define F(str) (str)
^~~
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h:1009:26: error: expected ')'
F *e = new (p) F(std::move(f));
^
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:17: note: in definition of macro 'F'
#define F(str) (str)
^~~
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h: In static member function 'static void events::EventQueue::function_dtor(void*)':
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:16: error: expected identifier before '(' token
#define F(str) (str)
^
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/EventQueue.h:1419:20: note: in expansion of macro 'F'
((F *)p)->~F();
^
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/Event.h: In constructor 'events::Event<void(ArgTs ...)>::Event(events::EventQueue*, F)':
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/Event.h:78:32: error: expected type-specifier
new (_event + 1) F(std::move(f));
^
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:17: note: in definition of macro 'F'
#define F(str) (str)
^~~
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/Event.h:78:32: error: expected ')'
new (_event + 1) F(std::move(f));
^
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:17: note: in definition of macro 'F'
#define F(str) (str)
^~~
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/Event.h: In static member function 'static void events::Event<void(ArgTs ...)>::event_dtor(events::Event<void(ArgTs ...)>::event*)':
c:\users\yang.x.30\onedrive - procter and gamble\documents\arduino\libraries\sdfat\src\common\syscall.h:53:16: error: expected identifier before '(' token
#define F(str) (str)
^
C:\Users\yang.x.30\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.1\cores\arduino/mbed/events/include/events/Event.h:282:26: note: in expansion of macro 'F'
((F *)(e + 1))->~F();
^
exit status 1
Compilation error: exit status 1
Regarding how to make qspi work with mbed 2.9.1.