cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMx 6.14.0 does not generate any code for PTA configuration

abansal22
Associate

Hello, 

I tried to enable the PTA peripheral on stm32WBA63. Seems like it's not generating any initializing code regarding the PTA. Neither any example is provided how to do so. 

It tried manually to enable the PTA, but its still not working. I still see the ble advertising. I am attaching the sample ioc file. 

What I tried manually, is 

#define PTA_ACTIVE_Pin GPIO_PIN_4
#define PTA_ACTIVE_GPIO_Port GPIOB
#define PTA_GRANT_Pin GPIO_PIN_15
#define PTA_GRANT_GPIO_Port GPIOB

 

GPIO_InitTypeDef GPIO_InitStruct = {0};
  GPIO_InitStruct.Pin              = PTA_ACTIVE_Pin;
  GPIO_InitStruct.Mode             = GPIO_MODE_AF_PP;
  GPIO_InitStruct.Pull             = GPIO_NOPULL;
  GPIO_InitStruct.Speed            = GPIO_SPEED_FREQ_LOW;
  GPIO_InitStruct.Alternate        = 0x0C; // AF for PTA_ACTIVE_Pin
  HAL_GPIO_Init(PTA_ACTIVE_GPIO_Port, &GPIO_InitStruct);

  GPIO_InitStruct.Pin              = PTA_GRANT_Pin;
  GPIO_InitStruct.Mode             = GPIO_MODE_AF_OD;
  GPIO_InitStruct.Pull             = GPIO_NOPULL;
  GPIO_InitStruct.Speed            = GPIO_SPEED_FREQ_LOW;
  GPIO_InitStruct.Alternate        = 0x0A; // AF for PTA_ACTIVE_Pin
  HAL_GPIO_Init(PTA_GRANT_GPIO_Port, &GPIO_InitStruct);

  //Initalize the PTA
  // According to RM0515, 10.5.1(PTACONV_ACTCR), register
  // TACTIVE value is 0x14 to 0x96
  pta_error err = pta_init(0x15);
  if (err != PTA_ERROR_SUCCESS)
  {
   
  }

  err = pta_enable(PTA_ENABLED);
  if (err != PTA_ERROR_SUCCESS)
  {
    
  }
 
Thanks
4 REPLIES 4
STTwo-32
ST Employee

Hello @abansal22 

For the PTA, I've attached a code to test the PTA. You can use it as a source of inspiration. To use PB15 for PTA_GRANT instead of PH3, You just need to change the config of PTA_GRANT in MX_GPIO_INIT():

 /// PTA_GRANT - PB15 CN4-26 
  GPIO_InitStruct.Pin = GPIO_PIN_15;
  GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  GPIO_InitStruct.Alternate = ((uint8_t)0x0A);
  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

 PS: Don't forget to change the connection cable.

This example is tested on the NUCLEO-WBA65RI. 

For the CubeMX configuration, that has been escalated internally (under internal ticket number 208024) to be added on the future.

Best Regards.

STTwo-32 

 

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.

Hello @STTwo-32 

As you can check in the original post, I already did this according to the mcu stm32WBA63 datasheet. I also initiated the pta, still I check ble transmit, what ever the value of pta active pin. 

Is there is any wrong with my initaition process?

As per you post, you donot initialize pta at all? is it not mandatory to enable the pta prior to use. Also the snippet is just a gpio initiation, what about rest of the code. Is it possible for you to provide a full example even for a Nucleo board. 

As per reply you mentioned that it is working for nucleo board. How do you test on nucleo board? Did you use ble/thread/zigbee to verify that? 

Thanks

I've uploaded the example. For details, you can have a look at the readme.html file of this testing example.

Best Regards.

STTwo-32

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.

_Joe_
ST Employee

Hi,
Actions are underway to support the generation of PTA initialization, via STM32CubeMX in future versions.
BR, Joé