cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with interrupt vectors for standard STM32F108 project.

JGaby.1
Associate II

I was having a problem getting the ADC to work in DMA mode on a STM32F103C8 using the default project created by your STM32CubeIDE. As soon as I called HAL_ADC_Start_DMA to start the conversion, the program would crash. The DMA1_Channel1_IRQHandler interrupt handler was never called and it seemed to be vectoring off to some invalid place.

Fortunately I had an example project which did work (created by an older version) and by comparing the two I was finally able to isolate the problem. In the project that worked, the SystemInit function in the file system_stm32f1xx.c contained the line:

 SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */

whereas that line was missing from the same file in my newly created project. Adding this line fixed the problem.

I am assuming that this missing line caused the interrupt vector table to not be set up properly. The mystery to me is how other interrupt vectors seemed to work fine, just not the DMA interrupt.

Was I doing something wrong when creating the project or is this a bug?

1 REPLY 1
Amel NASRI
ST Employee

Hi @JGaby.1​ ,

Sharing an ioc file will be helpful to investigate the issue.

Please precise the version of the tool you are using as well.

-Amel

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.