Post Go back to editing

printf while using UART in DMA mode

Category: Software
Product Number: ADSP-BF592

Hi,

silly question

i am playing with a ADZS-BF592-EZLITE board. I imported CharECHO_UART example but, after activating DMA mode with:

eResult = adi_uart_EnableDMAMode(hDevice, true);

the first printf method generates this error:

A non-recoverable error or exception has occurred.
Description: An illegal data memory access has occurred.
General Type: RunTimeError
Specific Type: DCPLBProtectionViolation
Error PC: 0xffa01440

This error does not happens if i do not use DMA mode.

It looks like printf is writing something into memory instead of printing on console

  • maybe that adi_uart_EnableDMAMode in some way is trying to write directly on UART instead of writing to console?

    i need a way to have debug info on console while receiving data from serial port in DMA mode...

  • Hi,

    Can you please confirm whether the issue got solved now. Because in the following thread

    ez.analog.com/.../simple-example-on-using-uart-interrupt-to-receive-buffer-from-serial, you mentioned that your application works fine in DMA mode.

    Best Regards,
    Santhakumari.K

  • Hi,

    sadly i cannot say the issue is solved.
    Yes, my application works in DMA mode, but printf won’t work after i enable it.
    In the base CharEchoUART the instruction on line 87:
    printf(“Setup terminal on PC as described in Readme file.\n\n); 
    raise a 
    A non-recoverable error or exception has occurred.
    Description: An illegal data memory access has occurred.
    General Type: RunTimeError
    Specific Type: DCPLBProtectionViolation
    Error PC: 0xffa01440
     
     
    This is the first problem i had to face.
    Guessing the previous problem is caused by DMA (but i am not sure. still learning) i tried to change from DMA mode to Interrupt mode (that’s my second post)
    but in interrupt mode, i can only read the last char (even if i am sending a string).
    I am confused and do not know how to proceed. i have very few examples and learning is difficult.
    Really need help
    thanks
  • Hi,

    Could you please let us know which version of CCES you are using?

    We are unable to replicate your issue. We are able to run CharEcho_Uart example project in CCES 10.0.1 version. Here printf instruction on line 87 is working fine. Please refer the attached screenshot for reference.

    Can you please copy the example from BSP path and place it in other drive and try again in a new workspace.

    If issue still persist means, please share your test project to us.

    This would be helpful for us to assist you further.

    Best Regards,
    Santhakumari

  • Hi,

    reported CrossCore Embedded Studio is: 2.11.0.0

    I attach a couple of screenshot

  • Hi,

    We have identified the root cause of the issue. In the driver source code, A non-recoverable error error throws because of mismatch between ADI_UART_BIDIR_INT_MEMORY_SIZE and (sizeof(ADI_UART_DEVICE)+sizeof (UART_DATA_CHANNEL)*2u) values in CCES 2.11.0. So we need to increase the ADI_UART_BIDIR_INT_MEMORY_SIZE value from 416 to 446 inside the adi_uart_bf5xx.h file. Please refer the attached image for your reference. After this change we can run the CharEcho_Uart example project in CCES 2.11.0.

    We will fix this in future release of CCES.

    Best Regards,
    Santhakumari.K