cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding TSN Support in STM32N657x boards

Aks
Associate III
Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code

Hello
 
We would like to inquire whether the STM32N6570-DK board and the NUCLEO-N657X0-Q board support Ethernet TSN (Time-Sensitive Networking). Additionally, we would like to know if there are any STM-provided drivers or libraries for Ethernet TSN for these boards. If such resources are available, we would appreciate it if you could share them with us.
Currently, we are working on Ethernet transmit and receive functionality on the NUCLEO-N657X0-Q board using the driver generated from STM32CubeMX. However, we are encountering a HardFault when attempting to transmit in interrupt mode. The code execution jumps to the HardFault handler at the following segment in ETH_Prepare_Tx_Descriptors:
if (txbuffer->next != NULL)
{
txbuffer = txbuffer->next;
/* Set buffer 2 address */
WRITE_REG(dmatxdesc->DESC1, (uint32_t)txbuffer->buffer);
/* Set buffer 2 Length */
MODIFY_REG(dmatxdesc->DESC2, ETH_DMATXNDESCRF_B2L, (txbuffer->len << 16));
}.
We have attached our code files for your reference and would greatly appreciate any guidance or suggestions to resolve this issue.
 
Thanks & regards
Akshitha Pattem
4 REPLIES 4
STackPointer64
ST Employee

Hello @Aks,

To assist you better, could you please answer the following questions:

  • Is your application running in Secure, Non-Secure, or FSBL mode?
  • Where are your descriptors located in your Ethernet configuration?
  • Are you using an Ethernet stack like NetXDuo, or are you handling everything using HAL?
  • Could you provide a screenshot of the call stack when the hard fault occurs?
  • Finally, if possible, please provide your STM32CubeMX IOC configuration so I can review it.

Best regards,

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.
STackPointer64
ST Employee

As for TSN, it is supported by the hardware; however, unfortunately, there is currently no driver provided by ST. You can check the reference manual for more details.

Additionally, you may find the following knowledge base article helpful for running a bare-metal Ethernet application, as it provides useful tips:

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.

Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code

Hello @STackPointer64 

 

Thank you for your response.
Please find my answers to your queries below:

  1. We are currently running in Non-Secure mode. However, we are still facing some issues in this mode. I will address the additional observations after answering all your queries.

  2. Our Ethernet DMA descriptors are located in AXI SRAM 2.

  3. We are not using any external Ethernet stack such as NetXDuo — all Ethernet operations are handled directly through the HAL libraries.

  4. We encountered a HardFault when running in FSBL mode, whereas in Non-Secure mode, we are facing an OWN bit clearing issue.

while ((dmatxdesc -> DESC3 & ETH_DMATXNDESCWBF_OWN) != (uint32_t) RESET)
{
  if ((heth -> Instance -> DMA_CH[ch].DMACSR & ETH_DMACxSR_FBE) != (uint32_t) RESET)
  {
    heth -> ErrorCode |= (uint32_t) HAL_ETH_ERROR_DMA;
    heth -> DMAErrorCode = heth -> Instance -> DMA_CH[ch].DMACSR;
    /* Return function status */
    return HAL_ERROR;
  }

  /* Check for the Timeout */
  if (Timeout != HAL_MAX_DELAY)
  {
    if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0 U))
    {
      heth -> ErrorCode |= HAL_ETH_ERROR_TIMEOUT;
      /* Clear TX descriptor so that we can proceed */
      dmatxdesc -> DESC3 = (ETH_DMATXNDESCWBF_FD | ETH_DMATXNDESCWBF_LD);

      return HAL_ERROR;
    }
  }
}
 

I have also attached the call stack screenshot, IOC file, and code snippet for your reference.

 

Thanks & Regards

Akshitha Pattem

Hello @STackPointer64 

 

Thank you for the clarification.

As you mentioned, TSN is supported by the hardware but no driver is currently provided by ST. We would like to know how we can test TSN functionality on this controller in that case. Could you please share any recommended sequence, procedure, or reference for testing TSN features?

 

Thanks & regards

Akshitha Pattem