http://dwelch.s3.amazonaws.com/proglpc20100225a.tar.gz
http://dwelch.s3.amazonaws.com/proglpc20101205a.tar.gz
I dont know why I though that the bootloader protocol, which I now know as ISP (In-System Programming) was a corporate secret and the one or two open source tools had some magic to them. Turns out it is well documented, well, maybe not WELL documented, but pretty good. As good as anything else in an LPC users manual (better than most).
So I have one of the Coridium ARMMITE pro boards that I bought from Sparkfun along with one of their usb to serial widgets that plugs in to power the board and provide serial access.
The code is ugly by many folks standards right now but I will work on it over time. But it does function on linux, is not tied to any libraries other than the basic serial access (termios?) that has been there for a decade as my serial port code is that old. command line, compiles easily with gcc. I have also included a couple of blink the led programs, one very simple and one very simple plus a few extra lines of code to speed the processor up to 60MHz from 20MHz.
The ARMMITE pro comes with some Code Read Protected (CRP) code for interpreting basic. Short the load C programming pins, and I had to then (after the power was on) press the reset button to get it into ISP mode. The only way around the CRP problem is to erase all of the flash blocks on one shot. Referring to the manual the Sector numbers table shows sectors 0 to 7. To erase the shipped with software (nope, its gone, cant recover, if you want to use this board as a basic interpreter stop reading this blog now) you need to use the P 0 7 then the E 0 7 command. Then you can write and read ram and flash and whatever.
2010-02-25 proglpc now reads a .bin file and programs it to flash.
short the loadc pins
power on
press the reset button
proglpc filename.bin
release loadc pins
press reset to see your program run
Ahh, this doesnt quite work, not sure how it did before, dtr needs to be down for this to program
change ser.c to add the drop dtr
unsigned char ser_open ( void )
{
struct termios options;
int status;
ser_hand=open("/dev/ttyUSB1",O_RDWR|O_NOCTTY|O_NDELAY);
if(ser_hand==-1)
{
fprintf(stderr,"open: error - %s\n",strerror(errno));
return(1);
}
fcntl(ser_hand,F_SETFL,FNDELAY);
bzero(&options,sizeof(options));
options.c_cflag=B19200|CS8|CLOCAL|CREAD;
options.c_iflag=IGNPAR;
tcflush(ser_hand,TCIFLUSH);
tcsetattr(ser_hand,TCSANOW,&options);
ser_maincnt=ser_buffcnt=0;
ioctl(ser_hand, TIOCMGET, &status);
status &= ~TIOCM_DTR;
ioctl(ser_hand, TIOCMSET, &status);
return(0);
}
20101205a version has the DTR fixed. Added blinker3 example which uses a 32 bit timer to blink the led instead of just a timed loop. Also blinker3 configures and sends bytes out the uart.
1 comment:
thanks for your post! I was looking around to find a way to program my armmite from my linux station and found you post. I`ll try it .... thanks again for sharing your knowledge.
regards,
Roberto
Post a Comment