Am 23.02.22 um 18:15 schrieb Jon Nicoll:
Hi there - I am trying to check that my understanding of the openOCD 
'architecture' is correct.

I want to program, via openOCD, some SPI flash connected to a Synopsys ARC Eval 
board.
The SPI flash is connected to the ARC CPU via a Synopsys SPI peripheral.

If I understand correctly, in order to do this I would have to write a 'flash 
driver' which runs on
the ARC
CPU and interfaces to the SPI peripheral (although openOCD has ARC CPU support 
there is no support
for SPI Flash according to the ARC Readme)

Yes. You need some sort of driver. There are following variants:
- all access are done from OpenOCD directly. Easy to review and maintain, no 
need for working RAM.
Slow performance.
- everything done on the CPU agent. High performance. Some sort of RAM is 
needed. Can be harder to
maintain.
- mixed variant. worst or best of both worlds :D


In past lives I have used a 'Software Agent' which sits on a CPU and acts as a 
sort of proxy; this
was using
Coldfire and an Macraigor-style 'wiggler'. It seems that the Flash loader is 
the openOCD equivalent
of this -
am I correct here please?

yes.

I am not very clear about how the small 'loader' code fits into this scheme; 
can anyone explain that
or point me
towards a document which gives an overview of the various parts of this?

Here is one of driver using this kind of agent:
https://review.openocd.org/gitweb?p=openocd.git;a=blob;f=src/flash/nor/stm32f1x.c;h=90cee641206a3c792601096e5bdb8e985dfbe98b;hb=HEAD#l462

Here is driver without agent:
https://review.openocd.org/gitweb?p=openocd.git;a=blob;f=src/flash/nor/ath79.c;h=394b6dda06e8f7ae9241f8a1fb2758b2a3ae14d6;hb=HEAD

And here are supported agents, loaders:
https://review.openocd.org/gitweb?p=openocd.git;a=tree;f=contrib/loaders/flash;h=40920c16f7f26287698a32f8e79a46e2be3bd12c;hb=HEAD

If I do end up developing such a flash driver then I will be happy to donate it 
to the openOCD project.

It will be nice :)

--
Regards,
Oleksij

Reply via email to