Post Go back to editing

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?


  • Hi, have you considered running Linux on the ARM core?
    By having Linux running on the ARM core you can make use of the ethernet support that is enabled and built into the OS.
    If you add a bluetooth/Wifi USB dongle you can also plug that in and make your solution more portable.

    You can download the Linux software for the SAM board from here:

    There's a user guide included in the product that walks you through getting Linux installed on the SHARC Audio Module board.

    Once you have that up and running you can simply develop a standard Linux TCP/IP application.

    There are also lots of Linux ported applications that you can get running on the SHARC Audio Module such as Open Stage Control which might be of use to you:


  • Hi Dave,

    First of all, I would like to thank you for your fast reply.

    I hadn't considered running Linux on the ARM core, but in my case I'm not really sure that this would be the best option.

    In fact, for convenience I've been developing my entire project with Windows OS, and perhaps this was my newbie mistake, but if there's no other way to inetgrate TCP protocol into SAM, your contribution will be highly valued.

    The app "Open Stage Control" seems to be quite reliable, but I already developed my own custom GUI with Projucer. Thanks again for your contribution!

    These days, I've been searching for any possible solution in ADI EngineerZone, and I found out the Lightweight TCP/IP Stack. Unfortunately, lwIP requires uC/OS-III soft, and according to AD, uC/OS-III must be licensed or could be evaluated for 90 days. However, I've just discovered on Micrium web page that it is possible to obtain a free version of uC/OS-III for hobbyists, but, as they report in their web, a free license request could be significantly delayed due to an overload of requests.

    So, for the time being, I will work with lwIP stack and the evaluation version of uC/OS-III, until they grant me the free license.


  • Hi, 

    Finally, I am forced to discard uC/OS-III. Although I got the Micrium hobbyist license, they don't provide me a serial number to freely use uC/OS-III in CCES.
    As alternative, I've been taking a look to the FreeRTOS Add-on and, as you proposed me, to the Linux Add-in, but in both cases I have some doubts...
    The FreeRTOS Add-on supports the ADSP-SC589 Ez-Kit board, but it supports the Sharc Audio Module board too? This option would make my work easier, since it would allow me to still working in the same OS.
    The Linux Add-in have to be run into CCES version 2.8.3, and the latter in Ubuntu 14.04, but these soft versions are not avalaible in their respective web pages. In Ubuntu web page, the Ubuntu OS  is only avalaible until version 16.04, and in Analog Devices web page, CCES Rev. 2.9.0 is the older version avalaible. Where can I get the version 2.8.3 of CCES? CCES v2.8.3 is fully supported by Ubuntu 16.04?
  • Hi XEsteve, yes FreeRTOS does support the SHARC Audio Module. We just don't provide an example for it. You can probably try the SC589 EZ-KIT example, I'm sure that will work.

    As for Linux, the legacy version of Ubuntu can be downloaded from here:

    For the legacy version of CrossCore Embedded Studio, there is a link on the Linux Add-In page in the downloads section explicitly for that version:



  • 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.

  • 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?