Page 1 of 1

Usb Serial

Posted: Mon May 11, 2015 2:35 pm
by ZARCOV
Hi:

For unknown reasons my usb-serial arduino project executes normally on the simulator but I could not get it compiled, issuing the error messages:

Licence key: KFK24B
C:\Program Files (x86)\Flowcode 6\compilers\avr\batchfiles\avra.bat atmega328 "C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.elf" "C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.c" "C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.lst"
C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo>"C:\PROGRA~2\FLOWCO~1\COMPIL~1\avr\BATCHF~1\..\bin\avr-gcc.exe" -mmcu=atmega328 -Os -funsigned-char -o "C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.elf" "C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.c" -lm

C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.c: In function 'FCD_056e1_USB_Serial1__Initialise':
C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.c:812: error: 'USB_BUS_SENSE' undeclared (first use in this function)


C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.c:812: error: (Each undeclared identifier is reported only once
C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.c:812: error: for each function it appears in.)


C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.c:812: error: 'DETACHED_STATE' undeclared (first use in this function)
C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.c:824: error: 'USBDeviceState' undeclared (first use in this function)
C:\Users\MARCUS~1\DOCUME~1\PUC\SIMULA~1\flowcode\servo\rem_servo.c:824: error: 'CONFIGURED_STATE' undeclared (first use in this function)

Error returned from [avr-gcc.exe]
Completed compilation, return = 1

I have another doubt regarding time over parameter. I was said at the function reference (regarding the rs232-serial) that a parameter = 255 would 'wait forever'. In the usb-serial I would like to know if there is some alternative to get the port waiting until a byte is available to read.

Regards

M. Brunetta

Re: Usb Serial

Posted: Mon May 11, 2015 2:43 pm
by Benj
Hello Zarcov,

The USB Serial component will currently only work with the PIC and dsPIC range of devices with USB peripherals.

Depending on your Arduino you can use the RS232 component to transfer data using the FTDI USB connection.

We have looked at adding the USB components for targets such as the Arduino Leonardo which uses a USB enabled AVR rather than a FTDI chip, however it proved to be fairly difficult technically to do in the same way as the PIC versions and so we have left it on the list but parked it for now.