Minimus progress

I’ve got avr-libc stdio working with the Minimus, so if you have a
FTDI board you can wire it up to PORTD2 & PORTD3 and use it for
printf-style debugging:

start_serial_baud(SERIAL_TEXT);
char buf[IBUFSZ];
while (1) {
    fgets(buf, sizeof(buf), stdin);
    printf("you typed %s", buf);
}

Alan Burlison

How much code space does it use?On Sep 30, 2012 12:09 AM, “Alan Burlison” alan.burlison@gmail.com wrote:

I’ve got avr-libc stdio working with the Minimus, so if you have a
FTDI board you can wire it up to PORTD2 & PORTD3 and use it for
printf-style debugging:

start_serial_baud(SERIAL_TEXT);
char buf[IBUFSZ];
while (1) {
    fgets(buf, sizeof(buf), stdin);
    printf("you typed %s", buf);
}

Alan Burlison

You received this message because you are subscribed to the Google Groups
"HAC:Manchester" group.
To post to this group, send an email to hacman@googlegroups.com.
To unsubscribe from this group, send email to
hacman+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/hacman?hl=en-GB.

How much code space does it use?

About 4k of flash and 240 bytes of sram. Most of the code space is
taken up with the printf implementation from avr-libc, you can cut that
back if you just use puts/gets etc. Most of the sram is the 160 bytes
used to hold the input and output line buffers, you can tune that back
as well.

If you are getting short of space there are a load of #defines you can
use to crank back the space the LUFA library uses by reducing menory
requirements and not compiling unneeded code (e.g. host-mode bits), see
http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__token_summary.html

Also, when I looked at the link Kimball sent out I noticed the USB
descriptors were being allocated in sram, I think you can move them into
flash using the PROGMEM attribute and setting the USE_FLASH_DESCRIPTORS
#define, I think I’ve seen that in some of the LUFA demos.

Alan Burlison

How much code space does it use?

I’ve restructured the code and I have some more accurate numbers on just
the serial part. It uses 1060 bytes of flash and 210 bytes of sram.
the sram requirement can be reduced by using smaller IO buffers, the 210
includes 162 bytes of IO buffers (2 x 80+1 char buffers), that can be
adjusted down drastically if required.

I’ve put the code on SourceForge, https://sourceforge.net/p/abavr/lib
under the utils subdirectory.

Alan Burlison