EmbDev.net

Forum: ARM programming with GCC/GNU tools Cortex-M3 External SRAM and Flash Programming


Author: Paul Agadjanov (mpefareo)
Posted on:

Rate this post
0 useful
not useful
Hello,
I'm just starting with cortex-m3 and with gnu arm toolchain. My
question may be stupid.
What I wanted to ask:

1.I know that during the development it is posible to keep everything
code and data in SRAM and not to program FLASH.
Because the internal SRAM in the Cortex-m3 is 64KB max it may not be
big enough.
Is it posible to program External SRAM connected to cortex-m3 with
data or program through OpenOCD and GDB?

2. Is it posible to program internal Flash with OpenOCD and GDB? And
how to do that if yes? What is the sequence of commands in GDB?

3.Is it posible to program external FLASH connected to cortex-m3 with
OpenOCD and GDB?

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Paul Agadjanov wrote:

>...
> What I wanted to ask:
>
> 1.I know that during the development it is posible to keep everything
> code and data in SRAM and not to program FLASH.
> Because the internal SRAM in the Cortex-m3 is 64KB max it may not be
> big enough.
> Is it posible to program External SRAM connected to cortex-m3 with
> data or program through OpenOCD and GDB?
Should be possible. Have not tested this with a controller with CM3-core
but with AT91SAM7SE (ARM7TDMI). You may have to enable the external
memory-bus before it can be used to transfer the load-image into the
external RAM. This can be done from OpenOCD by writing to registers
during initialization. Check the controller's manual.

> 2. Is it posible to program internal Flash with OpenOCD and GDB? And
> how to do that if yes? What is the sequence of commands in GDB?
Depends on target. STM32 should be fully supported (Spen?). I don't know
if all LM3 are supported but at least some of them are. The OpenOCD
manual (pdf) has some information on flash programming from gdb
("load").

> 3.Is it posible to program external FLASH connected to cortex-m3 with
> OpenOCD and GDB?
OpenOCD offers some infrastructure for this (i.e. for CFI) but the
question can not be answered without more information (controller,
external flash memory type/interface).

You may ask in the OpenOCD developer-mailing-list but you should at
least give the exact name of the used controller (the name of the ARM
core is not enough) and the used external flash memory.

Author: Spencer Oliver (ntfreak)
Posted on:

Rate this post
0 useful
not useful
Martin Thomas wrote:
> Paul Agadjanov wrote:
>
>>...
>> What I wanted to ask:
>>
>> 1.I know that during the development it is posible to keep everything
>> code and data in SRAM and not to program FLASH.
>> Because the internal SRAM in the Cortex-m3 is 64KB max it may not be
>> big enough.
>> Is it posible to program External SRAM connected to cortex-m3 with
>> data or program through OpenOCD and GDB?
> Should be possible. Have not tested this with a controller with CM3-core
> but with AT91SAM7SE (ARM7TDMI). You may have to enable the external
> memory-bus before it can be used to transfer the load-image into the
> external RAM. This can be done from OpenOCD by writing to registers
> during initialization. Check the controller's manual.
>
>> 2. Is it posible to program internal Flash with OpenOCD and GDB? And
>> how to do that if yes? What is the sequence of commands in GDB?
> Depends on target. STM32 should be fully supported (Spen?). I don't know
> if all LM3 are supported but at least some of them are. The OpenOCD
> manual (pdf) has some information on flash programming from gdb
> ("load").
>

the latest openocd svn supports all low/medium and high density stm32
flash types.
as Martin mentioned all the info is in the docs - the latest docs can
always be found at: http://openocd.berlios.de/web/?page_id=54
simply the gdb load cmd is used.

>> 3.Is it posible to program external FLASH connected to cortex-m3 with
>> OpenOCD and GDB?
> OpenOCD offers some infrastructure for this (i.e. for CFI) but the
> question can not be answered without more information (controller,
> external flash memory type/interface).
>
> You may ask in the OpenOCD developer-mailing-list but you should at
> least give the exact name of the used controller (the name of the ARM
> core is not enough) and the used external flash memory.

Cheers
Spen

Author: Jack Peacock (jakbird)
Posted on:

Rate this post
0 useful
not useful
Paul Agadjanov wrote:
> Is it posible to program External SRAM connected to cortex-m3 with
> data or program through OpenOCD and GDB?
> 3.Is it posible to program external FLASH connected to cortex-m3 with
> OpenOCD and GDB?

In general this may not be a good idea due to the speed of external
memory access.  For example, the STM32 external bus is only 16-bit and
access time is significantly slower than for internal SRAM or Flash.
Running code from external memory may be as much as 10 times slower.
  Jack Peacock

Reply

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.