Hi Øyvind,

On 02.01.2011 20:29, Øyvind Harboe wrote:
>> Hiho,
>>
>> I was just trying to port the netX scripts to the new target script
>> structure with the "setup_target" proc. I remarked that the script
>> changes seem to be fitted to "real" embedded processors with all
>> peripherals on the die. But this chip does not own an internal flash
>> memory and the flash / ram configuration is board dependent.
>>
>> So what to do in this case? Is the number of parameters for the proc
>> "setup_target" set in stone, or am I free to adjust it?
> I presume you mean init_targets.
>
> init_targets takes no arguments. It is a procedure that sets up the
> configuration for the config script that is loaded.
>
> init_targets invokes a target/board/architecture specific procedure
> with fixed default arguments. The arguments to the procedure that
> init_targets calls have no defined structure. It is entirely up to the
> configuration script for the target/PCB family.
>
> If someone wants to set up a different pcb/target, they load the config
> file in question, then define a new init_targets proc specific to their
> PCB.

Ok. Hope I got that right.
"init_targets" is the default function to initialize the chip on the
JTAG interface and resides in the target scripts.
"setup_<chipname>" is also an exported function of this script and is
called by "init_targets".

I still have the problem now that my target script doesn't know anything
about the external connected peripherals. So I could completely
intialize the CPU within this script, but needed SDRAM / Flash
initialization cannot be done, as the target does not know about it
(it's board specific). So I would just use init_targets to intialize the
basic JTAG chain (Chip Type / Id, etc.).
For the external peripherals i would then either write an additional
function inside the target scripts (e.g. add_flash / add_sdram) or place
this configuration in my board script. Or maybe I can force my board
scripts to contain a proc "init_board" which is called from targets like
a callback (if it exists).

Or do you mean I should move the "init_targets" to my board script then?
This would make it easier for sure, as every option is available here.


Hope I made myself clear where my problem is. Maybe I just think too
complicated on this issue and just got stuck somewhere and need a push
to the right lane ;)

Cheers,
Michael
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to