cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx + STM32F411+ SPIFLASH

DVill
Associate II

Hi guys,

I'm working on custom board with STM32F411 + spiflash for a project with Touchgfx (partial buffer).

At the moment I got spiflash and STM32F411 working via SP1 + DMA and that's fine.

I'm using IAR 9.70 for this project and I'm facing an issue with external flash loader when I do a debugging session.

When I start a debugging session, flash is programmed and the external loader programs the spiflash too.

But on the end of the programming the procedure fails with:  

Sun Mar 29, 2026 21:45:19: Initial reset was performed
Sun Mar 29, 2026 21:45:19: Loaded debugee: C:\Program Files\IAR Systems\Embedded Workbench 9.2_3\arm/config/flashloader/ST/FlashSTM32F4xxxRAM128K.out
Sun Mar 29, 2026 21:45:19: Target reset
Sun Mar 29, 2026 21:45:26: Unloaded macro file: C:\Program Files\IAR Systems\Embedded Workbench 9.2_3\arm/config/flashloader/ST/FlashSTM32F4xxx.mac
Sun Mar 29, 2026 21:45:26: Loaded macro file: D:\ARM\STM32F411\AlphaTui\CubeMx\AlphaTui\EWARM/icf/ExtSPIFLd.mac
Sun Mar 29, 2026 21:45:26: Loaded debugee: D:\ARM\STM32F411\AlphaTui\CubeMx\AlphaTui\EWARM/icf/ExtSPIFLd.out
Sun Mar 29, 2026 21:45:26: Target reset
Sun Mar 29, 2026 21:45:26: Unloaded macro file: D:\ARM\STM32F411\AlphaTui\CubeMx\AlphaTui\EWARM/icf/ExtSPIFLd.mac
Sun Mar 29, 2026 21:45:26: Downloaded D:\ARM\STM32F411\AlphaTui\CubeMx\AlphaTui\EWARM\AlphaTui\Exe\AlphaTui.out to flash memory.
Sun Mar 29, 2026 21:45:26: 227026 bytes downloaded into FLASH (28.38 Kbytes/sec)
Sun Mar 29, 2026 21:45:27: ELF/DWARF Error: Unknown
Sun Mar 29, 2026 21:45:27: Failed to load debugee: D:\ARM\STM32F411\AlphaTui\CubeMx\AlphaTui\EWARM\AlphaTui\Exe\AlphaTui.out
Sun Mar 29, 2026 21:45:27: Unloaded macro file: C:\Program Files\IAR Systems\Embedded Workbench 9.2_3\arm/config/debugger/ST/STM32F4xx.dmac
Sun Mar 29, 2026 21:45:28: Loading the ST-LINK Driver driver

the debugging session is aborted and it seems that the debugger is unable to retrieve symbols.

If I put my spisflash data temporarly in flash and not in (0x90000000...0x907FFFFF) everything is ok and I can debug.

I'm sure that spiflash is programmed because I read it and the data are the desidered

Have you any idea what is going wrong?

Attached here I put my .board/flash/icf.
Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
DVill
Associate II

Hi,

at the end, the idea comes.

I override the default .ddf file (STM32F411RE.ddf) adding this new line (missing because STM32F411 hasn't any module mapped here) 

Memory = ExtDev Memory 0x60000000 0x9FFFFFFF W 

and I restarted IAR.

When I fire a debug session now C-SPY flashes the app with its default flash loader then does it for external spi with my custom loader, after that it can  retrieve symbols for this interval range (the line added above works here) and the debugger session place the breakpoint at main and everything goes as usual.

Obviously now when the app tries to access data in spiflash range gives hard fault.... I have to implement the wrapper for that but it's a further step ahead.....

Thanks guys.

 

 

 

View solution in original post

1 REPLY 1
DVill
Associate II

Hi,

at the end, the idea comes.

I override the default .ddf file (STM32F411RE.ddf) adding this new line (missing because STM32F411 hasn't any module mapped here) 

Memory = ExtDev Memory 0x60000000 0x9FFFFFFF W 

and I restarted IAR.

When I fire a debug session now C-SPY flashes the app with its default flash loader then does it for external spi with my custom loader, after that it can  retrieve symbols for this interval range (the line added above works here) and the debugger session place the breakpoint at main and everything goes as usual.

Obviously now when the app tries to access data in spiflash range gives hard fault.... I have to implement the wrapper for that but it's a further step ahead.....

Thanks guys.