STC89c52 on Linux

Now, I am trying to program my dev board from Linux, to avoid all of these chinese stuff.

The program for that is stcdude, which is available from github

stcdude

I followed the recipe on the above link, had some troubles on my installation of lua, but after some quick fixes I was able to compile it. I will now try to use it on my board, let’s see what will happen…

First I generated an test file from sdcc, the same program as before, but compiling in Linux. This is the command line.

sdcc -mmcs51 –model-small teste1.c

After that, let’s install stcdude….

The procedure to install stcdude is simple: ( first install git, in case you don have it…

git clone git://github.com/nekromant/stcdude.git
cd stcdude
autoreconf –install –force
./configure
make
sudo make install

Note: I had some problems to install stcdude, it did not accept lua5.2 instllation, and I had to fix the Makefile, to compile stcdude correctly

To program a compiled program
stcdude -p “/dev/ttyUSB0” -b 1200:57600 -a wflash -f teste1.ihx

Well, now I will check if it works… And let you know.

4 thoughts on “STC89c52 on Linux

  1. Hi, Andrew, thanks for the tip. Somehow I still can’t program with stcdude, looks like it cant start communicating with my controller.
    Could you use stcdude sucessfully?

    I used makebin to convert, is that ok?

    Thanks in advance!
    Ricardo

  2. Not sure about makebin, I used hex2bin. Try different baudrates, make sure no modemmanager’s running. I haven’t had any STC89* around, when I wrote stcdude, so these are untested – they may have different protocol. If so – send me some logic analyzer dumps from the win version, with different baudrates/crystals and I’ll see if I can add support.