![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Sample USBserial project that compiles OK on Web Compiler, but breaks for GCC ARM
This code compiles on the online MBED compiler.
When Exported to GCC ARM it fails.
//when compiled with GCC_ARM we get the following issues which result in unresolved symbols /* - The type 'USBSerial' must implement the inherited pure virtual method 'mbed::FileHandle::write' - The type 'USBSerial' must implement the inherited pure virtual method 'mbed::FileHandle::lseek' - The type 'USBSerial' must implement the inherited pure virtual method 'mbed::FileHandle::read' */
Revision 0:6cdfc5265dfe, committed 2014-10-05
- Comitter:
- sbts
- Date:
- Sun Oct 05 11:54:37 2014 +0000
- Commit message:
- Sample Code that works for online compiler but doesn't work for GCC ARM
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Sun Oct 05 11:54:37 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/USBDevice/#5bf05f9b3c7b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Oct 05 11:54:37 2014 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" +#include "USBSerial.h" + +DigitalOut myled(LED1); + +//Virtual serial port over USB +USBSerial serial; + +int i=0; +int main() { + while(1) { + serial.printf("I am a virtual serial port %u \r", i++); + serial.write("asdf"); + FileHandle::write("asdf") + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + } +} + +//when compiled with GCC_ARM we get the following issues which result in unresolved symbols +/* + - The type 'USBSerial' must implement the inherited pure virtual method + 'mbed::FileHandle::write' + - The type 'USBSerial' must implement the inherited pure virtual method + 'mbed::FileHandle::lseek' + - The type 'USBSerial' must implement the inherited pure virtual method + 'mbed::FileHandle::read' +*/ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Oct 05 11:54:37 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1 \ No newline at end of file