EmbDev.net

Forum: ARM programming with GCC/GNU tools Getting Started


von Andy S. (mindsail)


Rate this post
useful
not useful
Hi there

Background
I have a home brew board based around a Sharp LH7A404.  Unfortunatly it
isn't working (I am convinced that this is a hradware fault because I
have had code working on this platform before but broke my board), I
just need to find it.

I am happy with hardware design, and also happy coding with a working
tool chain in C, but am stuck when I need to write test code for a new
platform.

I am able to connect to the target using a simple JTAG Wiggler and have
confirmed that all Address Data and Control bus lines look good.  All
clock lines are running fine with no jitter :-), PSU lines are all
within tolerance and Reset is fine.

What doesn't work is my boot loader code (the same image has worked on
this platform but when I reflowed the PCB it hasn't worked since) - The
bootloader in question is APEX and I will eventuly run Linux on this
platform.


I want to test hardware outside of the JTAG environment.
To start with I want to wiggle a GPIO line in an endless loop.
I guess I can do this with code resident in FLASH so I don't need to set
up RAM access MMU or anything like that.

My problem is that I have no idea how to configure WinARM to do this...

I guess I need a simple assembly script to perform this.

Any Ideas?

I assume I simply write assembler to :
  - Jump from the reset vector (0x00000000) to an area of FLASH outside
the    vector table.
  - Set a GPIO line as output (set Data Direction register for given
port)
  - Loop
      > Set GPIO Line high
      > Set GPIO line Low

I don't think I need to set up a stack pointer for this nor do I think I
need to configure any oporation moded of the ARM core (as this is just
test code and the core will default to supervisor mode on reset)

What symbols and syntax do I need for my assembly file?

So now I can write my assembly but how do I genorate an image that I can
wiggle into my flash?  i.e what call do I need to make to the gnu
assembler (as?) I have no idea what the machine type will be (its a home
brew borad after all)

Would sombody be kind enough to walk me through this exersise?

Many, many thanks

Andy

von Andy S. (mindsail)


Attached files:

Rate this post
useful
not useful
OK Where am I today?

Since yesterdays post I have installed the WinARM site and am able to
compile some code.  steps taken to get there follow:

1) starting from the example code ledswitches...
2) Added some hardware definitions for my ASIC (Sharp LH7A404)
   These definition files come from APEX (and are hardware.h, lh7a40x.h
and
   lh7a404.h)  This should be enough to define any registers etc for
this chip
3) hacked about linker files changing memory configureation to match the
Sharp
   ASIC:
      FLASH at 0x00000000 for (in my case) 16meg 0x01000000 (FLASH is
external)
      SRAM  at 0x80000000 for 80k 0x00014000 (SRAM is in the ASIC)
4) Hacked about with the make file to enable it to see my header files
and
   output in binary format (I use the OpenWince JTAG tools with a
wiggler
   because this can be used to reprogram the FLASH on my platform)
5) Replaced main with code to simply wiggle a GPIO line - im my case
PC.4

I guess that is all I need to do, however once again I see NOTHING when
I load into FLASH and restart the system (I do not have a working memory
target, because at this stage I do not wish to configure the Synchronus
memory on my board)

I must be doing somthing fundementaly wrong.  can somone please point it
out to me as my forhead is getting brused from banging it against the
wall :-)

Attached is my project in case you need to look at any of the files.

Andy
Andy Simpkins wrote:
> Hi there
>
> Background
> I have a home brew board based around a Sharp LH7A404.  Unfortunatly it
> isn't working (I am convinced that this is a hradware fault because I
> have had code working on this platform before but broke my board), I
> just need to find it.
>
> I am happy with hardware design, and also happy coding with a working
> tool chain in C, but am stuck when I need to write test code for a new
> platform.
>
> I am able to connect to the target using a simple JTAG Wiggler and have
> confirmed that all Address Data and Control bus lines look good.  All
> clock lines are running fine with no jitter :-), PSU lines are all
> within tolerance and Reset is fine.
>
> What doesn't work is my boot loader code (the same image has worked on
> this platform but when I reflowed the PCB it hasn't worked since) - The
> bootloader in question is APEX and I will eventuly run Linux on this
> platform.
>
>
> I want to test hardware outside of the JTAG environment.
> To start with I want to wiggle a GPIO line in an endless loop.
> I guess I can do this with code resident in FLASH so I don't need to set
> up RAM access MMU or anything like that.
>
> My problem is that I have no idea how to configure WinARM to do this...
>
> I guess I need a simple assembly script to perform this.
>
> Any Ideas?
>
> I assume I simply write assembler to :
>   - Jump from the reset vector (0x00000000) to an area of FLASH outside
> the    vector table.
>   - Set a GPIO line as output (set Data Direction register for given
> port)
>   - Loop
>       > Set GPIO Line high
>       > Set GPIO line Low
>
> I don't think I need to set up a stack pointer for this nor do I think I
> need to configure any oporation moded of the ARM core (as this is just
> test code and the core will default to supervisor mode on reset)
>
> What symbols and syntax do I need for my assembly file?
>
> So now I can write my assembly but how do I genorate an image that I can
> wiggle into my flash?  i.e what call do I need to make to the gnu
> assembler (as?) I have no idea what the machine type will be (its a home
> brew borad after all)
>
> Would sombody be kind enough to walk me through this exersise?
>
> Many, many thanks
>
> Andy

von Andy S. (mindsail)


Rate this post
useful
not useful
> 3) hacked about linker files changing memory configureation to match the
> Sharp
>    ASIC:
>       FLASH at 0x00000000 for (in my case) 16meg 0x01000000 (FLASH is
> external)
>       SRAM  at 0x80000000 for 80k 0x00014000 (SRAM is in the ASIC)


SRAM base is at 0xB0000000 not 0x80000000.

That said it has made no differance!


My original plee still stands.

Andy

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.