Skip to main content
Michele G
Visitor II
April 23, 2018
Question

STM32H7 SCB_CleanInvalidateDCache ERROR

  • April 23, 2018
  • 4 replies
  • 1992 views
Posted on April 23, 2018 at 17:03

I'm using CubeMx to generate the basic configuration for NUCLEO-H743ZI board;

Default settings are used, FREERTOS and LWIP flags are enabled sys timebase source set to TIM1

as suggested by CubeMx. 

Project files are generated for SW4STM32 IDE.

When project is built and debugger is started the default application ends inside 'Default_Handler infinte Loop' after SCB_CleanInvalidateDCache inside LWIp initialization.

MX_LWIP_Init() ---- netif_add() ----low_level_init() which create the ethernetif_input() thread that uses ethernetif_input() ---- low_level_input() ---- SCB_CleanInvalidateDCache() 

which causes the unexpected interrupt.

if __DCACHE_PRESENT is set to 0  the 

SCB_CleanInvalidateDCache() is effectively skipped but 

at this point HAL_ETH_Transmit and  HAL_ETH_Receive return HAL_ETH_ERROR_DMA

Anyone has the same issue?

#nucleo-f743zi #stm32h7 #lwip
This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
April 27, 2018
Posted on April 27, 2018 at 16:49

>>Anyone has the same issue?

I just debug issues as I encounter them.

Perhaps flushing the cache and write-buffers can trash what you thought should be on the stack, definitely 32-byte alignment issues to be conscious of.

Are you sure it's not trying to get into the Hard Fault Handler, or one of the other MemManage, BusFault or UsageFault routines.

Or if you are missing an IRQ Handler for one of your peripherals.

Here we'd have the Hard Fault Handler outputting diagnostic data so we can see if things crash and die.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Roberto C
Associate II
June 14, 2018
Posted on June 14, 2018 at 11:16

>>Anyone has the same issue?

I had the same,

To resolve it simply i had to enable data and instr. cache, that wasn't enabled by default by ST-Cube generated project.

Then , now my main code start as follow:

....

....

int main(void)

{

/* USER CODE BEGIN 1 */

/* USER CODE END 1 */

/* Enable I-Cache-------------------------------------------------------------*/

SCB_EnableICache();

/* Enable D-Cache-------------------------------------------------------------*/

SCB_EnableDCache();

/* MCU Configuration----------------------------------------------------------*/

/* Reset of all peripherals, Initializes the Flash interface and the Systick. */

HAL_Init();

....

....

This seems to solve it.

Technical Moderator
July 4, 2018
Posted on July 04, 2018 at 17:46

Hello,

Thank you for reporting this issue. This is raised internally for fix.

We apologize for any inconvenience this may have caused you.

With Regards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Technical Moderator
July 5, 2018
Posted on July 05, 2018 at 10:16

Hello

,

To fix the Ethernet driver issue:

MX_LWIP_Init() ----netif_add() ----low_level_init()which create theethernetif_input() thread that uses ethernetif_input() ----low_level_input() ----SCB_CleanInvalidateDCache()which causes the unexpected interrupt.

Add a condition on the clean:

if( (SCB->CCR & SCB_CCR_DC_Msk) == SCB_CCR_DC_Msk){ /* Dcache is enabled, clean & invalidate the Dcache */SCB_CleanInvalidateDCache();}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

With Regards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Nawres GHARBI
Technical Moderator
July 5, 2018
Posted on July 05, 2018 at 10:35

Hi Michele, 

This issue has been fixed and will be in the next release, Thanks for reporting the bug