First encounter with S3CEV40

Esden

Some time ago I got the S3CEV40 evaluation board from Embest. This is a nice board featuring an S3C44B0X ARM7TDMI microcontroller, ROM, RAM, RS232, USB, Sound, Ethernet, Keypad and a Display. A nice starting point for THC work. The decision why I picked that board are described in the previous post.

As I got the board I found out that there is a test software already flashed on the board. I tested it and everything seemed ok. It took some months till I really took the challenge to get everything working. First I wanted to flash linux on the board. To do that I needed a JTAG device and flash software.

On the site of Embest there is a description how to build a JTAG cable by yourself. I soldiered one and installed a demo version of the flash software on a machine. Sadly I had to find out that the device I soldiered did not work as it should. Next step was to find a different device. I had a development kit for ARM devices from Keil available with a matching JTAG device. I connected it up and after calling Keil two times for help I managed it to flash the board with the binaries that were supplied on the CD for the evaluation board.

The problems I had were the following. The binaries on the CD were flat binaries. (the raw binary data) The Keil software can not read binary files so I had to convert them to something Keil would understand. I got a very nice open source program called srecord from the internet and converted the binaries with some offset to intel hex files. Strange thing was that Tasking reported that the files are broken. I called Keil and they told me that I should call the file not .hex but .h86 . I did that and !bam! it worked. I really do not understand why they do not have a propper parser that could distinguish the file format by the content of a file.

After these fights I could flash the board.

Now the next step was to get the uClinux distribution contained on the supplied CD to compile. It also did not work from the beginning but the only thing I had to do was to make sure all files in the uClinux distribution have 'n' ending and not 'rn' and !bam! it worked too.

Now I had my selfcompiled linux kernel + userspace that I could flash.

The last thing that was not in my hands was the bootloader. The bootloader on the CD was only in binary format and the sources were missing. I looked in the binary and found out that it is the common ARM bootloader called blob that was patched by Embest. So I called BSM-Technik and got some sources. These were wrong at first (not matching the binary) but after I asked once more I got the right sources and after some hacking I got them to compile too.

The problem was that when I compiled the bootloader and flashed it on the board I got no response. So I fired up Keil debugger and read the disassembled code. Stepped through and looked what was wrong. After some hours stepping through the pure assembler I found out that the drivers the bootloader needs were not in the binary. After some more hours I found out that because I used GCC 4.0 and not 2.95 the driver stuff got optimized out from the binary. I only had to remove the -Os command line switch for GCC and !bam! the bootloader worked.

So now I have my own linux kernel + userspace + bootloader all compiled by myself. So now I have a good starting point for writing my own software.

I still have a dream... I would like to have the 2.6.x linux kernel working on this board but that still is a big problem. I compiled the kernel but it throws a kernel panic... but for now I will work on other things before I invest my time in that.