Integrate TCP protocol into SAM


I am working in my final degree project, which consists of implementing a DSP module into SAM to process audio signals just like professional audio mixers do. Up to now, I have my equalizer and dynamic sections ready to roll, and now I am working on the development of a GUI that allows me to modify the different parameters via WiFi and see the level and the magnitude frequency response of the audio signal. I chose TCP protocol for that work, but I am a newbie in programming embedded systems and also in TCP sockets. So I tried to find on SAM Wiki page any example or tutorial that could help me, but I didn't succeed.

From what I've been able to find out, the first step is to enable the EMAC peripheral through the Pin Multiplexing tab of the system.svc file located in my core0's folder. First, I tried to enable the EMAC0 peripheral, but CCES indicated me that PTPAUXIN0 and PTPCLKIN0 “(mux: 0) had a mux group conflict with UART1 [UART]-RX (mux: 1)”. So, I enabled the EMAC1 peripheral since the CCES didn't show me any hardware's conflict. Did I do the right thing? Can I work with the EMAC1 peripheral instead of the EMAC0?

The second step should be programming TCP sockets. As far as I know, the related code should be implemented in my core0's src folder, but I'm not sure if I should create its respective 'c' and 'h' files in the drivers folder, since I wasn't able to find any file that managed the EMAC ports.

Could someone provide me a basic guideline about how to integrate TCP protocol into SAM platform?


Parents Reply Children
  • Hi Dave,

    I am trying to run the FreeRTOS LwIP example for ARM on my SAM board. I have followed each of the steps indicated in the user guide, but when I build the project, the CCES console shows an error message related with the redefinition of 'struct timeval'. This is what it display:

    17:17:31 **** Incremental Build of configuration Release for project RTOSDemo_CORTEX_A5_SC589_CCES_LwlP ****
    make all
    'Building file: ../system/lwIP/AppSources/lwip_sysboot_task.c'
    'Invoking: CrossCore ARM Bare Metal C Compiler'
    arm-none-eabi-gcc -O2 -ffunction-sections -fdata-sections -DCORE0 -D__ADI_FREERTOS -DNDEBUG @includes-6362bb799ec7e8d7908d7a81766d74d7.txt -Wall -c -mproc=ADSP-SC589 -msi-revision=any -MMD -MP -MF"system/lwIP/AppSources/lwip_sysboot_task.d" -o  "system/lwIP/AppSources/lwip_sysboot_task.o" "../system/lwIP/AppSources/lwip_sysboot_task.c"
    In file included from ../system/lwIP/AppSources/lwip_sysboot_task.h:10:0,
                     from ../system/lwIP/AppSources/lwip_sysboot_task.c:6:
    C:/Analog Devices/lwIP_Stack-Rel2.6.0/lwip/ARM/include/lwip/sockets.h:308:8: error: redefinition of 'struct timeval'
     struct timeval {
    In file included from c:\analog devices\crosscore embedded studio 2.9.0\arm\arm-none-eabi\arm-none-eabi\include\sys\select.h:26:0,
                     from c:\analog devices\crosscore embedded studio 2.9.0\arm\arm-none-eabi\arm-none-eabi\include\sys\types.h:68,
                     from c:\analog devices\crosscore embedded studio 2.9.0\arm\arm-none-eabi\arm-none-eabi\include\stdio.h:61,
                     from C:/Analog Devices/lwIP_Stack-Rel2.6.0/lwip/ARM/include/lwip/cc.h:44,
                     from C:/Analog Devices/lwIP_Stack-Rel2.6.0/lwip/ARM/include/lwip/lwipifce.h:21,
                     from ../system/lwIP/AppSources/lwip_sysboot_task.h:9,
                     from ../system/lwIP/AppSources/lwip_sysboot_task.c:6:
    c:\analog devices\crosscore embedded studio 2.9.0\arm\arm-none-eabi\arm-none-eabi\include\sys\_timeval.h:52:8: note: originally defined here
     struct timeval {
    make: *** [system/lwIP/AppSources/lwip_sysboot_task.o] Error 1
    17:17:31 Build Finished (took 440ms)

    Thanks again!!



  • oops... one more thing...

    In the project explorer window, there's an exclamation mark in the adi_osal.h file, and when I click twice on it, it shows:

    File not found: /RTOSDemo_CORTEX_A5_SC589_CCES_LwlP/system/osal/adi_osal.h.

  • 0
    •  Analog Employees 
    on Mar 27, 2020 11:39 AM in reply to XEsteve

    Hi unfortunately the timeval issue is a known issue. The LWIP example for FreeRTOS was supposed to be removed while we look into this. Apologies.

    The non-lwip example for FreeRTOS on SHARC Audio Module is not affected by this problem.

  • Has the issue with LwIP running on FreeRTOS been resolved?