Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IDE 12, linker issue (works in IDE 11)
14-09-2016, 12:26 AM, (This post was last modified: 14-09-2016, 12:29 AM by mikronauts.)
#1
IDE 12, linker issue (works in IDE 11)
I am trying to get some CDC code running.

After compiling, I get:


0: (499) undefined symbol:
_CDCgets(Pinguino/v12/source/main.obj)

I am guessing a low level library is missing?
Reply
14-09-2016, 09:51 AM,
#2
RE: IDE 12, linker issue (works in IDE 11)
It looks like you use CDC.read(u8 *buffer) to read a string.The IDE converts CDC.read in CDCgets. Unfortunately CDCgets no longer exists in V12 (at least today !).
Would you try CDC.getString(u8 *buffer) instead CDC.read ?

André
Reply
14-09-2016, 06:02 PM,
#3
RE: IDE 12, linker issue (works in IDE 11)
Will try!

Basically, what I really need is some way to read / write N bytes, without any EOL or any other conversions - pure binary, to support USB/serial binary protocols.

ideal would be something like:

int CDC.rawread(u8 *buff, int n) - try to read n bytes, return number of bytes read, a timeout would be great as well, -1 if error
int CDC.rawwrite(u8 *buff, int n) - write n bytes, return number of bytes written, -1 if error

I can write my code with the Microchip libraries and MPLAB-X, however I find Pinguino great for quick prototyping Smile
Reply
15-09-2016, 08:08 AM,
#4
RE: IDE 12, linker issue (works in IDE 11)
Hi,
I updated the USB CDC lib and changed some functions :
- from void CDC.send(u8 len) to void CDC.send(u8 *buffer, u8 len)
- from void CDC.read() to void CDC.read(u8* buffer)
I'll test them today and maybe rename CDC.send to CDC.write
Stay tuned.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
15-09-2016, 07:34 PM, (This post was last modified: 15-09-2016, 07:35 PM by mikronauts.)
#5
RE: IDE 12, linker issue (works in IDE 11)
Much appreciated, and staying tuned!

Can I assume these are binary transparent? (ie no hidden conversions CR/LF to LF etc) - I work with a lot of old binary serial protocols.

if possible, a couple of minor tweaks: (basically returning error or bytes sent/received)

int CDC.send(u8 *buffer, u8 len) ... returns -1 if error, otherwise actual number of bytes written (usually would be len)

int CDC.read(u8 *buffer) ... returns -1 if error, otherwise number of bytes read

The reason I normally pass a len to read() calls is to avoid buffer overflows.... however if CDC.read() maxes at 64 bytes there is no need for len.
Reply
16-09-2016, 11:27 AM,
#6
RE: IDE 12, linker issue (works in IDE 11)
GitHub (pinguino-libraries v12-dev) updated.

The new functions are :


u8 CDC.write(u8 *buffer, u8 len)
u8 CDC.read(u8* buffer, u8 len)

They return the number of bytes read/written. 0 if error.
No hidden conversions.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
16-09-2016, 06:53 PM,
#7
RE: IDE 12, linker issue (works in IDE 11)
THANK YOU!

That is perfect!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)