cancel
Showing results for 
Search instead for 
Did you mean: 

Initializing the HDP on STM32N6

pdemeter
Associate

I wanted to use the HDP (Hardware Debug Port) peripheral on the STM32N6 MCU (Nucleo N6 board), but CubeMX does not generate the MX_HDP_Init() function for it and does not initialize the peripheral either.

Based on the reference manual, I tried configuring the peripheral at the register level but was unsuccessful.
My example:

LL_APB4_GRP1_EnableClock(LL_APB4_GRP1_PERIPH_HDP);
*(uint32_t*)(HDP_BASE_NS + HDP_MUX) = 0xffffffffUL;
*(uint32_t*)(HDP_BASE_NS) |= 0x1UL;
*(uint32_t*)(HDP_BASE_NS + HDP_GPOSET) = 0xff;

uint32_t hdpval = *(uint32_t*)(HDP_BASE_NS + HDP_VAL); // read back the HDP_VAL register

My question is: how can I enable the "(from BSEC) HDPEN" signal shown in the diagram below?

 

Thanks:

Peter

 

 

hdp1-issue.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hello @pdemeter and welcome to the community;

 

First of all I apologize for my late reply.

Which STM32CubeMX version are you using? 

I enabled HDP with STM32CubeMX 6.14.1 version and I can see the MX_HDP_Init() function in the generated code.

In addition, I got the GPIO configuration.

  /* set up GPIO configuration */
  /* GPIOC Non Secure Ports Clock Enable */
  __HAL_RCC_GPIOC_CLK_ENABLE();
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_1,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_6,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_7,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_11,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_12,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  /* GPIOD Non Secure Ports Clock Enable */
  __HAL_RCC_GPIOD_CLK_ENABLE();
  HAL_GPIO_ConfigPinAttributes(GPIOD,GPIO_PIN_6,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOD,GPIO_PIN_12,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  /* GPIOH Non Secure Ports Clock Enable */
  __HAL_RCC_GPIOH_CLK_ENABLE();
  HAL_GPIO_ConfigPinAttributes(GPIOH,GPIO_PIN_9,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);

Thank you.

Kaouthar

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
KDJEM.1
ST Employee

Hello @pdemeter and welcome to the community;

 

First of all I apologize for my late reply.

Which STM32CubeMX version are you using? 

I enabled HDP with STM32CubeMX 6.14.1 version and I can see the MX_HDP_Init() function in the generated code.

In addition, I got the GPIO configuration.

  /* set up GPIO configuration */
  /* GPIOC Non Secure Ports Clock Enable */
  __HAL_RCC_GPIOC_CLK_ENABLE();
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_1,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_6,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_7,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_11,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOC,GPIO_PIN_12,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  /* GPIOD Non Secure Ports Clock Enable */
  __HAL_RCC_GPIOD_CLK_ENABLE();
  HAL_GPIO_ConfigPinAttributes(GPIOD,GPIO_PIN_6,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  HAL_GPIO_ConfigPinAttributes(GPIOD,GPIO_PIN_12,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);
  /* GPIOH Non Secure Ports Clock Enable */
  __HAL_RCC_GPIOH_CLK_ENABLE();
  HAL_GPIO_ConfigPinAttributes(GPIOH,GPIO_PIN_9,GPIO_PIN_NSEC|GPIO_PIN_NPRIV);

Thank you.

Kaouthar

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.