Accessing external QSPI memory in C-SPY

기술노트 200211






2020-03-16 오후 2:48


This is a description of how to make C-SPY access external QSPI flash memory. It applies when using the flash loader for external QSPI memory that we deliver for some boards, for example the IAR-STM32F746xx-SK board. In these setups, memory mapping is needed to make download verification and the C-SPY memory window work as expected.


With the IAR-STM32F746xx-SK board, you can use the flash loader $TOOLKIT_DIR$\config\flashloader\ST\FlashSTM32F7xx_STM32F746xx-SK.board.

The complete source code for this flash loader can be found in $TOOLKIT_DIR$\ src\flashloader\ST\FlashSTM32F7xx_QSPI.

This flash loader works as intended, but after the flash loading process is done there is a final CPU reset, as described in the C-SPY Debugging Guide, chapter Debugging code in flash. After the reset, the QSPI memory is no longer accessible, because it is not memory mapped.

Enabling the Project > Options > Debugger > Download > Verify Download option may cause errors in the Debug log, similar to:

Verify error at address 0x90000000, target byte: 0x00, byte in file: 0x01

Also, the C-SPY Memory window may not show the correct contents inside the QSPI memory range.

Memory mapping QSPI memory

To make it possible for C-SPY to access the external QSPI memory, it needs to be memory mapped. An example on how to do this for STM32F746xx can be found in the C-SPY macro file enable_qspi.mac in the following example project:

ST > STM32F7xx > IAR-STM32F746xx-SK > Audio Demo

When enable_qspi.mac is selected in Project > Options > Debugger > Setup > Setup macros, download verification will work as expected, and the Memory window will show the correct contents inside the QSPI memory range.

Note that the enable_qspi.mac file implements the execUserPreload C-SPY macro. See the C-SPY Debugging Guide, chapter Debugging code in flash, for information on how this works.


For the C-SPY debugger to be able to verify or read external QSPI memory, it has to be memory mapped. This can be done with C-SPY macros, as demonstrated in our example projects.


죄송하지만, 이 콘텐츠는 한국어로 제공되지 않습니다.

당사 웹 사이트 중 한국어가 제공되는 않는 페이지는 기본적으로 영어로 제공됩니다. 보다 정확한 정보를 위해 영어로 제공되는 글로벌 웹 사이트를 방문하실 것을 권장합니다.

죄송하지만, 당사 사이트에서는 Internet Explorer를 지원하지 않습니다.보다 편안한 사이트를 위해 Chrome, Edge, Firefox 등과 같은 최신 브라우저를 사용해 주시길 부탁드립니다.