Skip to main content
Min-Kyoung Kim
Associate III
December 13, 2021
Solved

STM32L4Q5 GPIO hardware fault

I'm using STM32L4Q5CGUX on my project.

I found some gpio errors.

When I write on PB9, it's written on PB8.

And I can't write on PB11.

Could you guys check together, please?

This topic has been closed for replies.
Danish1
Danish1Best answer
Lead III
December 21, 2021

What _precisely_ is the entire part code on your device?

This is very important as it could explain the behaviour you are seeing.

I have had a quick look at the data-sheet, DS12902 Rev 3, and I find the comparison between figures 10 and 11 quite telling:

Figure 10 is the pin-out for stm32l4q5cxxx

Figure 11 is the pin-out for stm32l4q5cxxxP which is the version which allows you to use an external switch-mode power-supply to power the core of the processor for lowest-possible power consumption.

The difference?

Pin 22 is Vdd12 not PB11

Pin 45 is PB9 not PB8

Pin 46 is Vdd12

That seems to match the problems you are seeing. I guess in times of parts-shortage it is easy to order the wrong one. And maybe your supplier made the mistake not you.

Hope this helps,

Danish

8 replies

KnarfB
Super User
December 13, 2021

Strip down your code to a minimal example showing the effect, test that and post it. Do you really think the chip is broken? Are you using some known-good board?

hth

KnarfB

Min-Kyoung Kim
Associate III
December 21, 2021

Thank you for your kind comments.

I made simple example for this problem.

It happened same.

I checked other board and I checked hardware pin of STM32L4Q5UX directly by a oscilloscope.

Have you ever checked hardware pin of this board or used this board?

Didn't you have this kind problem?

If you could test this same board, could you check this port and pin?

Danish1
Danish1Best answer
Lead III
December 21, 2021

What _precisely_ is the entire part code on your device?

This is very important as it could explain the behaviour you are seeing.

I have had a quick look at the data-sheet, DS12902 Rev 3, and I find the comparison between figures 10 and 11 quite telling:

Figure 10 is the pin-out for stm32l4q5cxxx

Figure 11 is the pin-out for stm32l4q5cxxxP which is the version which allows you to use an external switch-mode power-supply to power the core of the processor for lowest-possible power consumption.

The difference?

Pin 22 is Vdd12 not PB11

Pin 45 is PB9 not PB8

Pin 46 is Vdd12

That seems to match the problems you are seeing. I guess in times of parts-shortage it is easy to order the wrong one. And maybe your supplier made the mistake not you.

Hope this helps,

Danish

ST Technical Moderator
December 13, 2021

Hello @Min-Kyoung Kim​ ,

I suggest you to start your own application using the latest release of CubeMX tool to initialize peripherals you need with the configuration you want.

Refer to the product datasheet to check the assignments for each pin.

You can try with other boards to confirm if the problem here seems related to the hardware or software environment.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
ST Technical Moderator
December 16, 2021

Hi @Min-Kyoung Kim​ ,

Were you able to resolve the issue?

Please share your update and mark the reply as Best answer.

Thanks

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Min-Kyoung Kim
Associate III
December 21, 2021

Thank you for your kind comments.

However I couldn't resolve this problem.

Have you ever checked this port and pin of STM32L4Q5UX_UFQPFN48?

I mean port B and pin 8&9.

I have updated to CubeIDE version 1.8.0. and CubeMX 6.4.0.202111222105

It also was same.

PB9 is always written on 1.6V. I can't change at all.

And I can write on PB8 by writing on PB9.

I checked it by a oscilloscope.

I made simple example for this problem.

I attached my main code.

int main(void)
{
 /* USER CODE BEGIN 1 */
	uint32_t pre_count=0;
 /* USER CODE END 1 */
 
 /* MCU Configuration--------------------------------------------------------*/
 
 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
 HAL_Init();
 
 /* USER CODE BEGIN Init */
 
 /* USER CODE END Init */
 
 /* Configure the system clock */
 SystemClock_Config();
 
 /* USER CODE BEGIN SysInit */
 
 /* USER CODE END SysInit */
 
 /* Initialize all configured peripherals */
 MX_GPIO_Init();
 MX_USART1_UART_Init();
 /* USER CODE BEGIN 2 */
 /* USER CODE END 2 */
 
 /* Infinite loop */
 /* USER CODE BEGIN WHILE */
 while (1)
 {
 /* USER CODE END WHILE */
 
 /* USER CODE BEGIN 3 */
	 if(HAL_GetTick() >= pre_count+100)
	 {
		 pre_count = HAL_GetTick();
		 HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_9); /* PB8 updating */
//		 HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_8); /* no working */
	 }
 }
 /* USER CODE END 3 */
}