This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM263P4-Q1: Ethernet

Part Number: AM263P4-Q1
Other Parts Discussed in Thread: AM263P4, SYSBIOS, SYSCONFIG

Tool/software:

Hi Team,

I am working on the AM263P4 controller and would like to implement Ethernet communication in a baremetal (No-RTOS) environment using the CPSW interface.

Specifically, I am looking for:
- A simple example that performs Ethernet packet transmission and reception.
- Baremetal (no FreeRTOS/SYSBIOS) setup.


I have already referred to the Ethernet example provided in the SDK, but it is based on FreeRTOS. Could you please provide a minimal example or guide to adapt it for No-RTOS?

Environment:
- Device: AM263P4
- SDK Version: [e.g., 10.02.00.15]
- CCS Version: [e.g., 12.8.0]
- No RTOS (baremetal)

Any help, example, or pointer to relevant documentation would be appreciated.

Thanks & Regards,  
Sravanthi R.

  • Hi Sravanthi,

    The out of box bare metal example in the SDK can be found below.

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM263PX/10_02_00_15/exports/docs/api_guide_am263px/EXAMPLES_ENET_LWIP_CPSW_HTTPSERVER.html

    The above one is the only example which MCU PLUS SDK supports.

    Also, there is an ethernet example in the MCAL SDK that is nortos based.

    Let me know if you need any further assistance.

    Regards,

    Aswin

  • Hi Aswin,

    The use of this example involves ,connecting to  a server which is not be possible for us.

    so that is the reason i have asked for No Rtos ethernet example.

    Also, there is an ethernet example in the MCAL SDK that is nortos based.

    Use of this MCAL SDK is same like MCU plus SDK ? Does it involves system configuration?

    Regards

    Sravanthi R.

  • Hi Sravanthi,

    The example in the SDK is already configured. You can import/open the example in CCS and run it. No additional configuration would be required.

    Regards,

    Aswin

  • Hi Aswin,

    Actually till now, we have configured other peripherals using  MCU+SDK in our project. So using again another SDK will be difficult for us to configure the peripherals . So that is the reason i have asked for a NORTOS project of ETHERNET which does simple transmission and reception of frames.

    Regards

    Sravanthi R.

  • Hi Sravanthi,

    Unfortunately we do no have such a nortos example.

    If the goal is to understand the packet reception and transmission logic, then, In enet_layer2_cpsw example, there are some tasks which does packet reception, transmission and so on. I can give a brief overview of the same.

    1. Rx task

    2 . Phy state handler task

    The Rx task is triggered from the EnetApp_rxIsrFxn function. A semaphore is posted from this ISR function to trigger the Rx task.

    The packet transmission is done by submitting the tx packets into the queue. This is done inside the rx task itself. You can visit this logic to see how transmission of packets are done.

    Then there is the EnetApp_phyStateHandler task which is responsible for checking the PHY status. This is task which works periodically because of a timer ISR which posts its semaphore.

    For using them in your application, you can visit these tasks/functions. The logic should remain the same.

    Hope this was useful for you. Do let me know if you need any more details.

    Regards,

    Aswin

  • Hi Sravanethi,

    I just mentioned the MCAL SDK to check the logic of packet transmission and reception as it is an SDK that has the OOB nortos example.

    Regards,

    Aswin

  • Hi Aswin,

    The Rx task is triggered from the EnetApp_rxIsrFxn function

    Is there any particular Enet reception start function or any other function that continously triggers the ISR Fxn.

    EnetApp_phyStateHandler task which is responsible for checking the PHY status.

    Are there any other functions that need to be called periodically?

    Can I change the enet_layer2_cpsw example to NORTOS in system configuration and remove all the task creations to work as a NO RTOS code.

    Regards

    Sravanthi R.

  • Hi Sravanthi,

    Is there any particular Enet reception start function or any other function that continously triggers the ISR Fxn.

    The ISR it not triggered by SW, it will be triggered once data is available in DMA.

    Are there any other functions that need to be called periodically?

    Not more as per my analysis.

    Let me discuss with the dev team to prepare a methodology to port the sample to nortos. I will let you know once I have the information.

    Regards,

    Aswin

  • Hi Aswin,

    Let me discuss with the dev team to prepare a methodology to port the sample to nortos. I will let you know once I have the information.

    It will be more helpful for me. Please let me know as soon as possible.

    Regards

    Sravanthi R.

  • Hi Sravanathi,

    Apologies for the delay as I was OOO. Please expect a reply mid next week.

    According to my initial analysis, the PHY handler task's nortos based implementation should be in SDK.

    Rest of the tasks (rxTask) can be ported easily since it is based on the ISR.

    Regards,

    Aswin

  • Hi Aswin,

    According to my initial analysis, the PHY handler task's nortos based implementation should be in SDK.

    Could you please mention the particular func or .c file where the PHY handler will happen in NORTOS.

    Please expect a reply mid next week.

    Ok. Please reply as soon as possible.

    Regards

    Sravanthi R.

  • Hi Sravanthi,

    The PHY state handler support for nortos function is present in the sysconfig itself. You can edit the rtos version option in sysconfig and see the code phy state handler code being regenerated for nortos.

    The option is present here.

    Sysconfig > TI NETWORKING > Enet(Cpsw)

    After making this change, please check the diff in ti_enet_open_close.c file.

    Regards,

    Aswin

  • Hi Aswin,

    The PHY state handler support for nortos function is present in the sysconfig itself. You can edit the rtos version option in sysconfig and see the code phy state handler code being regenerated for nortos.

    So, after enabling NORTOS in SysConfig, do I need to remove the EnetApp_phyStateHandler task (which is responsible for monitoring PHY status) from the example code?

    Also, regarding packet reception: when data is received, the EnetApp_rxIsrFxn function is triggered, which in turn schedules the EnetApp_rxTask function. Instead of creating a separate rxtask , can I directly call the EnetApp_rxTask function from inside the ISR, so that whenever data is received, the ISR immediately executes EnetApp_rxTask ?

    Regards

    Sravanthi R.

  • Hi Sravanthi,

    Also, regarding packet reception: when data is received, the EnetApp_rxIsrFxn function is triggered, which in turn schedules the EnetApp_rxTask function. Instead of creating a separate rxtask , can I directly call the EnetApp_rxTask function from inside the ISR, so that whenever data is received, the ISR immediately executes EnetApp_rxTask ?

    The rxTask is a heavy task. There is packet reception and transmission logic inside this function/task.Th tasks receives the packets and sends the same packet back.

    I think it will be better to execute them from the main loop. 

    So, after enabling NORTOS in SysConfig, do I need to remove the EnetApp_phyStateHandler task (which is responsible for monitoring PHY status) from the example code?

    Sorry, I am a bit unclear with this. Once the os based change is made to nortos, won't the function be there in the example itself. What is the requirement to move it ?

    Regards,

    Aswin

  • Hi Ashwin,

    I think it will be better to execute them from the main loop. 

    I couldn’t quite understand this statement, could you please clarify a bit more?

    Sorry, I am a bit unclear with this. Once the os based change is made to nortos, won't the function be there in the example itself. What is the requirement to move it ?

    Yes, I got it sorry for the earlier misinterpretation.

    Regards

    Sravanthi R.

  • Hi Sravanthi,

    I couldn’t quite understand this statement, could you please clarify a bit more?

    What I mean was that, in the freertos example, the reception logic is not executed from ISR. It is a task which wakes up because of a semaphore being posted from the ISR.

    In this case, I was suggesting that, a flag can be raised from the ISR and by polling the flag from the main loop the reception logic can be executed

    Regards,

    Aswin