2014-06-13 08:43 AM
Hi,
I copy \STM32Cube_FW_F4_V1.1.0\Projects\STM32F429I-Discovery\Examples\ADC\ADC_RegularConversion_DMA to following location: \STM32Cube_FW_F4_V1.1.0\Projects\STM32F429I-Discovery\Demonstrations\Modules The ADC is not working. Then I change ADC3 channel 8 to ADC2 channel 13, PF10 to PC3, by change the main.h: ~~~~~~~~~~~~~~~~~~~~~~~ /* Definition for ADCx clock resources */ &sharpdefine ADCx ADC3 &sharpdefine ADCx_CLK_ENABLE() __ADC3_CLK_ENABLE() &sharpdefine DMAx_CLK_ENABLE() __DMA2_CLK_ENABLE() &sharpdefine ADCx_CHANNEL_GPIO_CLK_ENABLE() __GPIOF_CLK_ENABLE() &sharpdefine ADCx_FORCE_RESET() __ADC_FORCE_RESET() &sharpdefine ADCx_RELEASE_RESET() __ADC_RELEASE_RESET() /* Definition for ADCx Channel Pin */ &sharpdefine ADCx_CHANNEL_PIN GPIO_PIN_10 &sharpdefine ADCx_CHANNEL_GPIO_PORT GPIOF /* Definition for ADCx's Channel */ &sharpdefine ADCx_CHANNEL ADC_CHANNEL_8 /* Definition for ADCx's DMA */ &sharpdefine ADCx_DMA_CHANNEL DMA_CHANNEL_2 &sharpdefine ADCx_DMA_STREAM DMA2_Stream0 /* Definition for ADCx's NVIC */ &sharpdefine ADCx_DMA_IRQn DMA2_Stream0_IRQn &sharpdefine ADCx_DMA_IRQHandler DMA2_Stream0_IRQHandler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change to: ~~~~~~~~~~~~~~~~~~~ /* Definition for ADCx clock resources */ &sharpdefine ADCx ADC2 &sharpdefine ADCx_CLK_ENABLE() __ADC2_CLK_ENABLE() &sharpdefine DMAx_CLK_ENABLE() __DMA2_CLK_ENABLE() &sharpdefine ADCx_CHANNEL_GPIO_CLK_ENABLE() __GPIOC_CLK_ENABLE() &sharpdefine ADCx_FORCE_RESET() __ADC_FORCE_RESET() &sharpdefine ADCx_RELEASE_RESET() __ADC_RELEASE_RESET() /* Definition for ADCx Channel Pin */ &sharpdefine ADCx_CHANNEL_PIN GPIO_PIN_3 &sharpdefine ADCx_CHANNEL_GPIO_PORT GPIOC /* Definition for ADCx's Channel */ &sharpdefine ADCx_CHANNEL ADC_CHANNEL_13 /* Definition for ADCx's DMA */ &sharpdefine ADCx_DMA_CHANNEL DMA_CHANNEL_2 &sharpdefine ADCx_DMA_STREAM DMA2_Stream0 /* Definition for ADCx's NVIC */ &sharpdefine ADCx_DMA_IRQn DMA2_Stream0_IRQn &sharpdefine ADCx_DMA_IRQHandler DMA2_Stream0_IRQHandler ~~~~~~~~~~~~~~~~~~~~~~~~ It is still not working, Please help. Thanks a lot #lmgtfy:-stm32-resources #whiskey-tango-foxtrot2014-06-16 04:21 PM
Dear Clive 1 ,
It only work in the folder , but once I copy to STM32Cube_FW_F4_V1.1.0\Projects\STM32F429I-Discovery\Demonstrations\Modules, then it crash.2014-06-16 04:41 PM
My guess is that the startup file and possibly configuration files that are associated with your IDE were not properly included in the new build.
Cheers, Hal2014-06-16 05:42 PM
I guess you're going to have to get your head around the IDE you are using, the project settings and options within it, and get a better grasp on why it's crashing.
If the simple act of copying the project fails, then you need to look at the directories, where it's pulling the include files, and what it's using for the start up file. You might want to compare and contrast the .MAP files and see if you can find any differences in the code that is being built.2014-06-16 07:07 PM
Might be ADCx_DMA have too high priority, how can I lower its priority?
Thanks2014-06-17 02:49 AM
After I debug by step, it crash in this function:
if(HAL_TIM_OC_Start_IT(&TimHandle, TIM_CHANNEL_2) != HAL_OK) { /* Initialization Error */ Error_Handler(); } This one is part of PWM, when the ADC couldn't convert anything, this portion work fine, but after ADC do its job, then PWM does not work properly.2014-06-17 06:07 AM
There is no Timer function in the ADC_RegularConversion_DMA example.
2014-06-17 07:12 AM
I am rapidly losing interest. Get your story straight and present the entire project as an attachment. Specify what tool chain you are using.
2014-06-17 11:29 AM
Dear Baird Hal,
I copy 2 projects to my project, one is PWM, the other one is Examples\ADC\ADC_RegularConversion_DMA.the timer is in PWM. Now, the ADC works, but PWM doesn't work.2014-06-20 04:49 AM
Dear Clive1,
I am using Keil and I try to attachment the whole project, but system fail, the file might too big. How can I send to you? Thanks.2014-06-20 10:30 AM
Yeah, I don't like big files, you should be able to zip up and quantify the size of the file. It shouldn't exceed a few hundred KB for what you're describing. But I'm really not interested in CUBE/HAL code, or merging barely functional examples. I've posted a LOT of example code for the Standard Library that's a lot clearer and functional.