cancel
Showing results for 
Search instead for 
Did you mean: 

BSP example - Configuration - Ressources

Nour
Associate III

Hello everyone,

I am working on a STM32WB5MMDK. I already posted a question about the BSP example.

I have few other questions about it.

I wanted to replace the Button 1 by the Button 2 so I changed it in the main file (even the CallBack). I checked the other files and the configuration was the same for the two buttons, so i didn't think i should change anything, but it doesn't work.

Moreover, I also wanted to test the Humidity and Pressure Sensors (I think it is included with the Temperature Sensor since it is written as a comment), but I can't make them work (i used the same program as the one for the temperature test and just change the parameters).


So, I wanted to know if someone knew how to fix those issues but mostly if there were ressources to help understand the configuration (i prefer not to use a .ioc) because i don't really find the answers to my questions online.

Thank you,

Nour

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @Nour 

First, for the Switching between B1 and B2. ensure before everything that B2 is really enabled, and it generate an interrupt. Then, switch all the functions related to B1 to B2. The temperature sensor, it is just a temperature sensor and does not include any capability for measurement for both humidity and pression.

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.

View solution in original post

6 REPLIES 6
STTwo-32
ST Employee

Hello @Nour 

First, for the Switching between B1 and B2. ensure before everything that B2 is really enabled, and it generate an interrupt. Then, switch all the functions related to B1 to B2. The temperature sensor, it is just a temperature sensor and does not include any capability for measurement for both humidity and pression.

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.

Nour
Associate III

Hello @STTwo-32 ,

 

Thank you for your answer !

I don't see where the buttons are enabled, i thought that the configuration was enough because the interruptions lines were correct. However, I think that the interrupt is not generated, but even for the button 1, i don't know where it is enabled.

 

Nour
Associate III

I mean that the activation seem to be generalised to all buttons, so both buttons could be used.

No, each used peripheral or GPIO Pin need to be activated and set corectly so it can work.

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.

Nour
Associate III
 

 

int32_t BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
{
  GPIO_InitTypeDef gpio_init_structure = {0};
  static BSP_EXTI_LineCallback button_callback[BUTTONn] = {BUTTON_USER1_EXTI_Callback, BUTTON_USER2_EXTI_Callback};
  static uint32_t button_interrupt_priority[BUTTONn] = {BSP_BUTTON_USERx_IT_PRIORITY, BSP_BUTTON_USERx_IT_PRIORITY};
  static const uint32_t button_exti_line[BUTTONn] = {BUTTON_USER1_EXTI_LINE, BUTTON_USER2_EXTI_LINE};

  /* Enable the BUTTON Clock */
  BUTTON_USERx_GPIO_CLK_ENABLE(Button);

 

I understand that, but I can only find this for the activation of the buttons. I searched

in every file of the project but that's the only part that looks like to enable the buttons.

 

Best regards,

Nour

Nour

Nour
Associate III

I finally was able to change the interruption. It was a file where the interrupt was only for the button 1 and I didn't see it.

 

Thank you again for your help @STTwo-32  and have a nice day !