Forum: ARM programming with GCC/GNU tools S3C2440 on WINARM

Author: Andrew (Guest)
Posted on:

Rate this post
0 useful
not useful
How do I configure WINARM to compile code for Samsung S3C2440?
Any example project is welcome.


Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful
GCC is agnostic to any particular ARM microcontroller implementation; 
what you specify is the ARM core in use.  For the Samsumg S3C2440 that 
is ARM920T, so -mcpu=arm920t is the required compiler option.  Other ARM 
specific options that you may find useful are detailed in the user 

I do not believe that WinARM provides any ARM9 run-time start-up code 
examples, so you will have to work on that yourself.  ARM9 is 
considerably more complex that ARM7.  You will have to configure the 
PLL, cache, MMU, and SDRAM controller as well as the normal C runtime 
start-up of initialising the vector table, establishing a stack, static 
data initialisation, static constructors (for C++), and invoking main(). 
Some of this will be board specific; specifically SDRAM timing 

I have used WinARM successfully on a custom S3C2440X board, so it can be 
done, but you will need to understand the hardware and at least a little 
assembler to develop your own start-up code.

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful

If you use an off-the-shelf bootloader, you may find that it performs 
much of the core initialisation for you so you will then only need a 
fairly conventional C runtime start-up.

Also to get the most out of an ARM9 you will want to run from RAM; this 
means that your runtime code will need to be linked to run from RAM, but 
load from Flash.  There are a number of ways to achieve this, but again 
you are largely on your own, or an existing bootloader may well help. 
When I used it we had our own bootloader that decompressed the 
application from Flash to RAM using zlib.  The RAM application image was 
compressed at build time and a utility to generate an assembler data 
array from a binary image was used the output from which was then 
assembled and linked to a start-up stub that ran from flash and 
performed the decompression then jumped to the start address.  During 
the boot process, three separate C run-time environments were 
established; bootloader; application decompression stub, then the 
application itself.  It is simplest if the core initialisation is 
performed once by the bootloader, although that need not be the case.

I also recommend that you have a JTAG hardware debugger of some kind. A 
degree of GDB gymnastics are required if you have a multistage bootstrap 
such as I described, since the debugger treats each one as separate 


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.