[En-Nut-Discussion] STM32F756 strange effect

Holger Mai mai at gemac.info
Thu Apr 14 11:54:29 CEST 2016

Hi Uwe
thanks for your hints, they are helpful.
indeed, the problem was caused by SRAM1. If let start Nut RAM on DTCM, all works
fine. Sniffing the network packets of some Pings brings it up, that there is
some packet data corruption on the Network interface, if the NIF Buffers are
located in SRAM (> 0x20010000). But this looks like only a problem of the
ETH-DMA, even if DCache is enabled or disabled, the "normal" DMAs are not
touched from this effect (SD-Card and other drivers with standard DMAs works
well without any errors). 
DCache is on startup always disabled (by default, must explicit be enabled).
 There must be other reasons for the effect.
As first workaround to fix this effect:
in the Driver stm32_emac.h make shure, that the tx- and rx-Buffers and the
Buffer Descriptors are fully located in the DTCM Area. If they will be placed in
normal SRAM, the ETH corrupts packet Data, even if DCache is disabled or not!
Be aware, if youe place them manually with the section attribute to DTCM, and
also put the BufIdx vars into DTCM, then the initialisation of these two fails,
you must set them to 0 in the EmacInit function or create an own .data
equivalent section for DTCM. 
I dont can find out, if that is caused by the specialized ETH-DMA or other
mechanisms. It is possible, that similarly effects come up from other
peripherals with own DMAs (USB OTG HS,LCD-TFT, DMA2D)
Next i will do is to send a support request to STM.

P.S. Cache-functions are in core_cm7.h, check the cache status by reading the
SCB->CCR register (Startup value is 0x40200 = DCache disabled) 

mit freundlichen Grüßen /Best Regards

Holger Mai

mai at gemac-chemnitz.de

GEMAC - Gesellschaft für Mikroelektronik-
anwendung Chemnitz mbH
Zwickauer Straße 227
D-09116 Chemnitz
Tel. +49 371 3377 - 0
Fax +49 371 3377 272
UST-ID: DE140851265
HRB 6443 Chemnitz/Stadt
Geschäftsführer: Dirk Hübner / Karsten Grönwoldt

More information about the En-Nut-Discussion mailing list