Question
H7: DTCM variables strange behaviour
Heyho,
H723..H735, using DTCM a lot, also ITCM for some functions.
Recently I found some strange behaviour:
- the global pointer sFlashIntCtl.pu8WrBuf to the buffer u8FlashIntPageBuf (global) is set in function A
- setting the pointer is working, printf via UART
- later on function A calls function B
- pointer sFlashIntCtl.pu8WrBuf is not changed anywhere, no IRQ or anywhere
- first thing function B is doing:
- check if pointer sFlashIntCtl.pu8WrBuf != NULL
- check fails, because sFlashIntCtl.pu8WrBuf = 0 (checked via UART, see below)
Here’s the UART output:
function A UART output:
*** start *** wr SPI flash to APP flash
&u8FlashIntPageBuf[0] 20000800
sFlashIntCtl.pu8WrBuf 20000800 <- this OKAY
sOspiFlashCtl.pu8RdBuf 20000800
sFlashIntCtl.u32WrAddr 08040000
sFlashIntCtl.u32ChkAddr 08040000
sOspiFlashCtl.u32RdAddr 00000100
sOspiFlashCtl.u32RdLen 32
...
function A calls function B
function B UART output:
#E FlashIntWrPage(): pu8WrBuf = NULL
sFlashIntCtl.pu8WrBuf 00000000 <- WTF ?
&u8FlashIntPageBuf[0] 20000800
Any ideas?
