2017-02-21 05:54 AM
Hi ,
We are using Cortex-M4(STM32F429IIH6) processor for our IOT project. We are seeing a data corruption when memcpy used, the corruption pattern was identified by feeding a Fixed pattern of size 512 Bytes from Src to Dest using memcpy, and it is not happening in all the iterations.
If you see the image attached below that Data '6 N 7 O' is replaced with 2 Bytes('Highlighted with orange color' 4L).
Can any one tells that what can be the reason for this wired behavior? We are in a critical phase of our project.
Regards,
Krishna Prasad
2017-02-21 06:11 AM
Do the source and destination field overlap?
JW
2017-02-21 07:18 AM
Some more info about the memcpy() routine (where from ?) and the call parameter would be helpful.
...the corruption pattern was identified by feeding a Fixed pattern ...
In this case a data watchpoint (i.e. breakpoint on data change) cames in handy.
2017-02-21 08:05 AM
Provide a complete test case, ideally explaining the exact compiler and version of tools being used, optimization settings, etc. Present the problem in a fashion that can be replicated, exactly.
>>Can any one tells that what can be the reason for this weird behavior?
Some kind of logic failure, in either the implementation or execution. You'd need to review the specific code sequences generated. You'd want to make sure the clocking or power specs are not being violated.
>>We are in a critical phase of our project.
I'm not sure this is a cause or factor in the issue, but understand no one here is responsible for your project.
http://www.catb.org/~esr/faqs/smart-questions.html#urgent
2017-06-15 09:27 PM
Thank you for all thevaluable suggestions and comments,
We have resolvedthis issue by Setting RBURST bit in theSDCR Register of SDRAMas per the errata,
Screenshot- 1
But after the fix we saw that the above fix will can introduce SDRAM bank address corruption
Screenshot- 2
Can any one suggest the steps to do the Second or third work around mentioned in the Screenshot- 2 without affecting the Previous fix.
/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fccc%2Fresource%2Ftechnical%2Fdocument%2Ferrata_sheet%2F38%2Fe6%2F37%2F64%2F08%2F38%2F45%2F67%2FDM000686pdf%2Ffiles%2FDM000686pdf%2Fjcr%3Acontent%2Ftranslations%2Fen.DM000686pdf
Our queries:
1. What happens if an interrupt occurs during an CPU AHB burst read access to one SDRAM internal bank, and a different SDRAM bank is read from within the interrupt? Will the issue be applicable here? If the issue is applicable, would a write to a dummy SDRAM location in some arbitrary bank at the beginning of the interrupt service routine be a safe work around?
2. Is the issue valid for burst and not burst types of read for the 'second read to another SDRAM internal bank' ?
3. Should we take care of any thing else if there are nested interrupts and there is a chance of burst reads to different banks being interrupted in a nested manner? i.e., say the following occurs:
interrupt-1 interrupts a burst read to SDRAM bank-1 and
in interrupt-1 service routine a burst read to SDRAM bank-2 is interrupted by interrupt-2 and
in interrupt-2 service routine a burst read to SDRAM bank-3 is performed and finally it returns to interrupt-1 service routine and then back to non-interrupt level
4. If we do a dummy write to some fixed SDRAM location after all burst reads that are followed by a read to another SDRAM bank in all interruptible contexts (including lower priority interrupt routines), can we be assured that there will be no corrupted data durung SDRAM read?
5. If consequtive burst reads from a particular SDRAM bank is of size greater than the SDRAM read FIFO (all different addresses), can we be sure that there will be no data in the SDRAM read FIFO that is from a different bank, and thereby the subsequent read to a different SDRAM bank will not be corrupted?
NOTE: The workaround to 'disable the SDRAM read FIFO' cannot be used in our project as our SDRAM uses a 16-bit data interface and due to errata clause 2.5 titled 'Interruption of CPU read burst access to an end of SDRAM row', as a workaround we are forced to enable SDRAM read FIFO.
Regards,
Krishna Prasad