Memory corruption

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Memory corruption

656 Views
salman83
Contributor II

Hi,

I am working on MCF52259 microcontroller. The modules i am using are QSPI, USB and some pins. Basically, I am reading some stuff from QSPI and storing it and finally sending it out on USB Isochronous endpoint. The problem is that my memory gets overwritten by unknown reason.

 

I looked into the docs and found out about the dual ported SRAM. Is that causing the problem.

 

Thanks in advance.

 

Regards.

Labels (1)
0 Kudos
4 Replies

466 Views
salman83
Contributor II

Hi,

I further debugged the program and it looks like there is memory overlapping.

Let me explain the whole scenario.

Total RAM is 64K. I am using 60K for storage of data from QSPI. I sent the data via USB on isochronous endpoint.

The problem I think is that whenever I pass the buffer pointers to buffer descriptor, the DMA copies the data to another memory location for transfer. I do not know if it is copying it in the same RAM which i am using.

My RAM address is 0x20000000 and my RAMBAR register value is pointing to 0x20000000

Any help will be highly appreciated.

Regards.

0 Kudos

466 Views
salman83
Contributor II

I further looked into the problem and found out that as soon as the usb is in configured state, it overwrites the memory. Can somebody put some light on it. I do not understand it what is causing this problem.

Regards.

0 Kudos

466 Views
Monica
Senior Contributor III

Salman, is that working for you?

Please keep us posted, we'd like to know :smileywink:

Best regards,

Monica

0 Kudos

466 Views
TomE
Specialist II

"Overwrites the memory". I assume you're meaning the USB is overwriting the last 4k that you're using for something else.

Are you sure you're following the "The BDT resides on a 512 byte boundary in system memory" rules?

Try configuring a smaller USB buffer size.

Try configuring the USB from 4k to 64k and put your other memory at the BOTTOM. That may give a different error that lets you keep investigating.

You had an incorrectly set up PACR causing you trouble, so check the rest of them and also check the MPR register.

Tom

0 Kudos