cancel
Showing results for 
Search instead for 
Did you mean: 

ADC regular conversion samples only the first channel when running application from QSPI FLASH

KKjel.1
Associate III

Hi

I have a project running for the last 2 years: STM32H7, CubeMX for setup.

I have 6 ADC channels on ADC3, running in "Regular, non-continous conversion". This works.

But now I want to run the application from the external QSPI FLASH. This works almost OK, but the ADC sampling fails: It only samples the first channel in the sequence of 6 channels. The next is never started.

I have made no changes to the GPIO setup, except some unused pins, which are configured as analog inputs pr. default in the HAL init. This does not work with the QSPI FLASH interface, because it somehow changes the memory mapping setup in the (bbot)loader. So I just remove the init of the unused pins like this in gpio.c:

/*Configure GPIO pins : PA0 PA3 PA4 PA5
PA6 PA8 */
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5
|GPIO_PIN_6|GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
// HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

/*Configure GPIO pins : PB0 PB1 PB2 PB10
PB11 PB12 */
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_10
|GPIO_PIN_11|GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
// HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

I have double checked the CubeMX setup and registers during runtime, and everything looks fine, and exactly the same as when running from internal FLASH (see screenshots below).

The question is: Why does the ADC conversion suddenly not continue after sampling the first channel in the sequence, when running from external QSPI FLASH?

 

KKjel1_0-1691667816696.pngKKjel1_1-1691667931580.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

I have know implemented a "manual" ADC sequence, because the Errata tells that ADC3 does not work properly with sequences.

And this works OK. It requires more coding of course, but seems to be an easy workaround.

Why the problem is only present when running from external FLASH is still a mystery, though.

br, Kaare

View solution in original post

5 REPLIES 5
KDJEM.1
ST Employee

Hello @KKjel.1 ,

Could you please precise :

  • Which STM32H7 device are you using?
  • Is the QUADSPI configured in Indirect mode?

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.

Hi Kaouthar

- STM32H730

- We are running memory mapped QSPI

br

Kaare

KDJEM.1
ST Employee

Hi @KKjel.1 ,

Please, firstly, try to check if you are able to read/write data correctly from/on the external memory.

Also, I advise you to take a look to the errata sheet and precisely 2.7 OCTOSPI section.

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.

Hi Kaouthar

I will ask the developers of the QSPI interface/External FLASH integration to look at the read/write to/from QSPI FLASH, and the Errata.

It looks OK though, as all other software runs OK, and all ADC registers are setup correctly.

But in the Errata I can see that the ADC3 only runs stable in continous mode if more than 1 channel in the sequence. I have 6 channels in the sequence, and runs non-continous. I just start the sequence once every 100 ms. This works when running from internal FLASH. I have no clue why this is different when running from external FLASH, but I will try to change it friday, and see if this makes any changes.

Thanks, Kaare

I have know implemented a "manual" ADC sequence, because the Errata tells that ADC3 does not work properly with sequences.

And this works OK. It requires more coding of course, but seems to be an easy workaround.

Why the problem is only present when running from external FLASH is still a mystery, though.

br, Kaare