stmqspi is a driver/patch for openOCD to program and read the QSPI 
flash, so it's to be build *into* openOCD executable only. For openOCD 
you need in addition a small script, the patch comes with some examples, 
e. g.
"stm32f769i-disco.cfg".

But for your board you have to write your own script, the GPIOs for the 
QSPI interface have to be configured: alternate function, very high 
speed. And the QSPI registers have to set up for memory-mapped mode, 
this has to be adapted to your particular flash chip. That's required 
because the driver retrieves some setup information from the current 
register settings! If it is a "well known" flash chip it will be 
autodetected upon openOCD probing the flash bank, otherwise some 
parameters must be set manually (cf. manual).

Some flash chips may require additional setup after each power-on like 
drive strength, write protect, 4-byte address mode and so on. For this 
the driver's "spicmd" command might be useful.

That was the openOCD side of the story. Now in your firmware the QSPI 
interface has to be initialized as well. The linker script must be 
adapted to place parts (not the initialization, of course) of the 
firmware into the QSPI address range (cf. reference manual). The code 
parts mapped into the QSPI address range will then automatically go to 
the QSPI flash when the firmware is programmed into your target device 
by openOCD.

For this, I'd suggest you have a look at "Demonstration" project sources 
supplied by ST for the discovery boards like f746, f769, you will find 
suitable sample linker scripts etc. to start with.

When your firmware has correctly initialized the QSPI interface, the 
external flash will almost exactly look like internal flash regarding 
program execution, debugging, breakpoints etc. Of course, this does 
*NOT* hold for programming/erasing the flash from within you firmware.

On 2018-10-02 14:51, Praveen wrote:
> Andreas, can we debug with breakpoints on QSPI NOR flash using the
> patch as normal internal flash?
> 
> stmqspi is a library that's built or do we need just the source code ?


---

** [tickets:#208] Open OCD for external qspi programming and debugging**

**Status:** closed
**Milestone:** 0.9.0
**Labels:** QSPI Flash 
**Created:** Sat Sep 29, 2018 08:58 PM UTC by Praveen
**Last Updated:** Tue Oct 02, 2018 01:37 PM UTC
**Owner:** nobody


Hi,

We want to use Open OCD + GDB to program and debug from external quad NAND 
flash for STM32H7xx micrcontroller. Till now we have been using internal flash.

Please share any reference documents or sample projects to develop the scripts 
or drivers to acheive our debug environment.

Thanks,
Praveen


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to