cancel
Showing results for 
Search instead for 
Did you mean: 

Hard Fault calling SCB_DisableDCache() or SCB_CleanDCache()

iTTy
Associate III

Hi there.

As usual, I'm there with a new issue... 😅

Developing a custom Bootloader, I'm trying to disable both Instruction and Data chaches.

As I read on the ST AN4839, before deactivating the DCache, I would also Clean it.

No problem with the Icache, but I'm experiencing Hard Fault adding Dcache cleaning and/or disabling.

void DoJump2App(u32t uiAPPaddress)
{
	/*.-.-.| Local Varibles |.-.-.*/

	/*.-.-.| Execution |.-.-.*/
	SCB_DisableICache();
	SCB_CleanDCache();
	SCB_DisableDCache();
	
	uiResetKey = RESET_DRV_BTL_KEY;							// Clear RESET key
	pJump2App = (pFunction)(*(volatile u32t*)(uiAPPaddress + 4));

	__set_MSP(*(volatile u32t*)uiAPPaddress);				// Initialize user application's Stack Pointer
	__ISB();												// Instruction Synchronization Barrier
	pJump2App();
}

Above the example of the routine I'm testing.

To be noticed that:

  1. This routine is called just once in the main program after peripheral initialization (inside a more complex wrapping function)
  2. Cache memories are enabled in the main (as usual)
  3. If I move SCB_DisableDCache() and/or SCB_CleanDCache() functions call directly in the main program, prior this function, there is no problem...

What I'm mistaking?

Context: I'm working on a custom board quipped with an STM32H755BIT MCU, using CubeIDE 1.13.2, CubeMX6.9.2 and Firmware package STM32Cube FW_H7 V1.11.0

Thanks in advance for your support!

iTTy

 

 

0 REPLIES 0