UART DMA works as intended when debugging, but doesn't when not?

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

UART DMA works as intended when debugging, but doesn't when not?

1,512 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jackandrews on Tue Oct 22 11:39:42 MST 2013
Hi,

I have a strange problem.  I am reading data over UART and placing into memory using DMA, with data being alternatively written to two different buffers after 1000 bytes have been read (ping-pong).  When debugging the target, the software works fine - data goes into each buffer correctly.  However, if I reset the target and no longer debug, data is getting corrupted.  Are there any registers which change behaviour when debugging?  E.g. changes the timing of DMA or something else to ease debugging?

Any thoughts on what could be changing the behaviour greatly appreciated!

Thanks,

Jack
Labels (1)
0 Kudos
7 Replies

1,317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by errepi on Sun Apr 10 23:48:36 MST 2016
Hi, I solved it by moving the memory buffer in RAM2 (at address 0x1007c000): why?
0 Kudos

1,317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by errepi on Thu Apr 07 06:23:40 MST 2016

Quote: hno-msc
i have the same problem with SSP and DMA

Im using a release build, with a connected debugger it is all fine but without the transfer doesnt work

when i start the board with a debugger and deplug it during running all is fine, even after reset is fine, only with a complete power down this happens



Hi, I have same problem with LPC1754, also.
Dma transfers a memory data buffer to ssp0, with bus width 16 or 32 bit: with debugger the system run ok (I can disconnect the debugger and to reset the board, and this continue to run), but at power up without debugger the system not works correctly: it seems that the dma lose data. I checked that the source buffer remains uncorrupted.

How did you solve your problem?
Thanks.
0 Kudos

1,317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jeanguerard on Fri Sep 19 03:59:55 MST 2014
Hello,

I also have this problem when writing data frames to my PC with the UART under DMA:
...
sprintf(TXbuffer, "0ABCDEFGHIJKLMNOPQRSTUVWXYZ789012abcdefghijklmnopqrstuvwxyz789012\r\n");
TXbuffer[0] = '.';
SYS_puts(TXbuffer);     --> uses LPCOpen UART libraries --> Chip_UART_SendByte()
TXbuffer[0] = '*';
SYS_puts_dma(TXbuffer); --> uses LPCOpen DMA libraries --> Chip_GPDMA_Transfer()
...

ALL IS FINE under debugger : received data frames are identical :
.ABCDEFGHIJKLMNOPQRSTUVWXYZ789012abcdefghijklmnopqrstuvwxyz789012 \CR \LF
*ABCDEFGHIJKLMNOPQRSTUVWXYZ789012abcdefghijklmnopqrstuvwxyz789012 \CR \LF

BUT, when booting alone without debugger (the LPCXpresso debugger part has been separated), the DMA frames are corrupted :
.ABCDEFGHIJKLMNOPQRSTUVWXYZ789012abcdefghijklmnopqrstuvwxyz789012 \CR \LF   --> UART frame OK
*ABCDEFGHIJKLMNOP__________Y____0_2____e____j_l____q____v______9__2 _ \LF     --> DMA frames BAD
The _ (underscore) character stands for ASCII \NUL (0x00). The \NUL positions change randomly with time.
However the number of transmitted characters is correct.

I am following all LPCOpen examples for initialization ( LPCXpresso 7.3 and LPCOpen 2.10)
What's wrong ?
0 Kudos

1,317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hno-msc on Tue Aug 05 09:06:53 MST 2014
i have the same problem with SSP and DMA

Im using a release build, with a connected debugger it is all fine but without the transfer doesnt work

when i start the board with a debugger and deplug it during running all is fine, even after reset is fine, only with a complete power down this happens
0 Kudos

1,317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Thu Oct 24 06:02:21 MST 2013
You are right of course. It was a typo, i did correct it in mean time. Sorry i am not a native english speaking person so i overlooked it. Thanks for correcting me. By the way i asume that it is a really fat hammer  :bigsmile:
0 Kudos

1,317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Oct 24 05:03:12 MST 2013

Quote: serge
- - * When all you have is a hamer then everything looks like a nail * - -



Serge, what is a hamer? Someone who is living in Ham ? Or eating a lot of ham ? Or a really fat tool    ;-)
0 Kudos

1,317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Thu Oct 24 03:35:33 MST 2013
do you use a debug- or a release build after the reset? Code optimization can be different between a debug- and a release build.
0 Kudos