Post Go back to editing

HW FS error in SPORT driver

Hi,

I use 21565 in an audio product, all the system work pretty good except sometimes when 21565 is running for some minutes, the SPORT callback may return a ADI_SPORT_HW_ERR_FS event.

After the error occur, the SPORT seems that it can't return to normal work. All the datas from that SPORT would be error. Do I need to close the SPORT and reopen it?

I met this event in several SPORTs use the same FS clocks, and the other SPORTs is good. I would like to know in what situations the ADI_SPORT_HW_ERR_FS will occur so that I can analyze and locate my problems. 

Thanks!

  • Hi Foster,

    The SPORTs are capable of detecting underflow and overflow buffer errors as well as frame sync errors. They can detect frame syncs that occur before the last transmission or reception completes.

    When a serial port is receiving or transmitting, it's bit count is set to a word length (for example SLEN = 32 bits). After each clock edge the bit count is decremented. After the word is received/transmitted the bit count reaches zero, and on next frame sync it is set to 32.

    When active transmission or reception is occurring, the bit count value is non-zero. When a frame sync with a bit count of non-zero is detected, a frame sync error occurs.

    Can you share the details about your application if possible please explain it with block diagram. This would be helpful for us to replicate the issue in our side.

    From your query, we understand that the issue is happening when you provide clock and framesync to multiple sports and the issue is occurring randomly.

    Could you please generate clock and frame from PCG instead of sport clock. Please refer the content "Support for Edge-Detected and Level-Sensitive Frame Syncs" from HRM. Here you can get more details about FSERRSTAT error bit

    Can you please share the screenshot of the corresponding SPORT register browser window when the issue is observed and also please share us SPORT static config file

    Best Regards,
    Santhakumari.K

  • Hi Santha,

    The error always occurs when I use one clock to drive several SPORTS. Maybe the driver strength is the matters, however I don't know how to resolve it.

    I find something maybe useful. When I use DAI pins as clock input, it's easy to occur. If I use PCG output or SPORT clock output as clock input, it's better than from DAI pins. 

    I would like to know how to catch the register values that indicate the bit count when the error occur since it's real time change.

    Thanks.

  • Hi Foster,

    You can get the details from corresponding SPORT's error(Ex: SPORT_ERR_A) register. But we cannot catch the bit count values.

    Could you please help us to simulate the issue in our test environment. This would be helpful for us to assist you further

    Best Regards,
    Santhakumari.K

  • Hi Santha,

    In the Debugger, after my application running, I can't get the register values which is all zeros, after I suspend it, the register values changed as the picture.

    registers

    sru_config.rar

    However the register value wil never changed when running again. I print the values in the SPORT callback, and find that when the error occur,  SPORT_ERR_A register changed from 0x00000007 to 0x00000047. After the error frame it will return to 0x00000007.

    By the way, I find another question, I defined a buf in l2 memory as below.

    section("seg_l2")
    float BufDelay[16][15408];

    If I use debug mode to compile, link finished with error. But if I use release mode to compile, no error occur. What's the difference? I don't know if it's important to solve the error since there's nothing happened when I running the ldf made in release mode.

    error in debug mode

    Thanks!

  • Hi Foster,

    As defaults of Debug and Release differ in that Debug generates Debug information and does not perform optimization, while the Release version does not generate debug information but does enable optimization.

    we would expect to see differences in the time taken to execute the code between Debug and Release modes, the size of the differences depends on the code.

    As you are hitting the 'li1040' error,we would first recommend ensuring two Linker Optimization options are enabled.

    The first is to enable Linker Elimination via Project->Properties->C/C++ Build->Settings->CrossCore Blackfin Linker->Elimination->Eliminate Unused Objects.When elimination is enabled, the Linker discards any objects (*.doj) within the library that do not contain any relevant code or data (i.e. the application makes no reference to any of the data or code symbols within that object). The linker can then examine the objects that are required for the link, and extract only those symbols required to resolve references from the application code, further stripping out unused data.

    Another option is enabling 'Individually map functions and data items' via 'General' tab of the CrossCore Blackfin Linker options.When enabled, directs the linker to fill in fragmented memory with individual data objects that fit. When this option is selected, the default behavior of the linker (to place data blocks in consecutive memory addresses) is overridden.

    By enabling the 'Generate symbol Map' option under the 'General' options for the Linker. This will produce a "project_name.map.xml" file in 'debug' folder the project that can be opened in Internet Explorer. It will show all your memory sections, and how much free/unused space there is.

    Should you eventually exhaust the available internal memory, you would need to look at making use of SDRAM - if your target has external memory.Select Use external memory (SDRAM) to enable the size and partitioning controls under system.svc > Startupcode/LDF > LDF > External Memory

    Best Regards,
    Santhakumari.K

  • Hi Santha,

    In the map.xml, there is still words unused in L2 memory, so you mean the release mode optimize my memory, it doesn't matter even it's error in debug mode, am I right?

    map.xml

    Then let's return to the FS error. I find that if I touch the DAI lines on my PCB, it's easy to occur the error. I can see the error in several SPORTs if I touch it.

    I will go on my testing.

    Thanks!

  • Hi Foster,

    The remaining of unused words in "mem_l2_bw" is 0x4f48,but the code needs 0xf0c00 words to occupy. This is the reason you got the linker error.

    Please enable Linker Elimination via Project->Properties->C/C++ Build->Settings->CrossCore Blackfin Linker->Elimination->Eliminate Unused Objects. When elimination is enabled, the Linker discards any objects (*.doj) within the library that do not contain any relevant code or data (i.e. the application makes no reference to any of the data or code symbols within that object).

    Also you can make use of SDRAM - if your target has external memory. Select Use external memory (SDRAM) to enable the size and partitioning controls under system.svc > Startupcode/LDF > LDF > External Memory

    Please try and let us know how you are getting on.

    Regarding framesync error, can you please explain in more detail about your analysis. We have to look into your SRU file.

    Best Regards,
    Santhakumari.K

  • Hi Santha,

    You may misunderstand something. In release mode, the used words of mem_L2_bw is 0xf50b8, it's already contain the buf I need which is 0xf0c00 size. So it's enough for me in release mode and there is nothing error when compile.

    I use ADSP-21565, which is not able to use external SDRAM, only 21569 series are available in my understand. Is there any way to make it if I don't change DSP?

    I may guess some directions which caused FS error, however I can't make sure. It's a hard work for me.

    First is the PCB layout, I am new about SHARC dsp, and layout is important in TDM16 format.

    Another is the jitter of clocks may cause samples mismatch.

    Also external noise may be the issue since when I touch the DAI line will make the error.

    Thanks!  

  • Hi Foster,

    Regarding I use ADSP-21565, which is not able to use external SDRAM, only 21569 series are available in my understand. Is there any way to make it if I don't change DSP?

    >>>Yes. DDR3 controller is not available. So you cannot use external SDRAM here.

    Could you please try to eliminate unused objects in your application. 

    Best Regards,
    Santhakumari.K

  • Hi Santha,

    I notice that there is memory map mode example in the SPI folder. So I could use the boot SPI flash to extend memory, can I? Does the SPI driver fastly enough since I would like to use as real time audio delay buffer?

    Thanks.