wjandsq 发表于 2015-2-1 19:59:25

发现bug, STM32CubeMX V4.6.0不能生成PC2外部中断代码!

本帖最后由 wjandsq 于 2015-3-16 13:37 编辑

/**
******************************************************************************
* @file    stm32f1xx_it.c
* @date    01/02/2015 19:56:17
* @brief   Interrupt Service Routines.
******************************************************************************
*
* COPYRIGHT(c) 2015 STMicroelectronics
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*   1. Redistributions of source code must retain the above copyright notice,
*      this list of conditions and the following disclaimer.
*   2. Redistributions in binary form must reproduce the above copyright notice,
*      this list of conditions and the following disclaimer in the documentation
*      and/or other materials provided with the distribution.
*   3. Neither the name of STMicroelectronics nor the names of its contributors
*      may be used to endorse or promote products derived from this software
*      without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
#include "stm32f1xx.h"
#include "stm32f1xx_it.h"
/* USER CODE BEGIN 0 */

/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/


extern TIM_HandleTypeDef htim2;
extern DMA_HandleTypeDef hdma_usart1_tx;
extern UART_HandleTypeDef huart1;
#n/******************************************************************************/
/*            Cortex-M3 Processor Interruption and Exception Handlers         */
/******************************************************************************/


/**
* @brief This function handles DMA1 channel4 global interrupt.
*/
void DMA1_Channel4_IRQHandler(void)
{
#t/* USER CODE BEGIN DMA1_Channel4_IRQn 0 */
#n#t/* USER CODE END DMA1_Channel4_IRQn 0 */
#tHAL_DMA_IRQHandler(&hdma_usart1_tx);
#t/* USER CODE BEGIN DMA1_Channel4_IRQn 1 */
#n#t/* USER CODE END DMA1_Channel4_IRQn 1 */
}#n
/**
* @brief This function handles EXTI line2 interrupt.
*/
void EXTI2_IRQHandler(void)
{
#t/* USER CODE BEGIN EXTI2_IRQn 0 */
#n#t/* USER CODE END EXTI2_IRQn 0 */
#t
get(halHandler) failed on instance of com.st.microxplorer.mcu.NvicVector
The problematic instruction:
----------
==> ${vector.halHandler}
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateModelException: get(halHandler) failed on instance of com.st.microxplorer.mcu.NvicVector
at freemarker.ext.beans.BeanModel.get(BeanModel.java:223)
at freemarker.core.Dot._getAsTemplateModel(Dot.java:76)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.IfBlock.accept(IfBlock.java:82)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
at freemarker.core.Environment.visit(Environment.java:351)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.visit(Environment.java:233)
at freemarker.core.CompressedBlock.accept(CompressedBlock.java:73)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
at com.st.microxplorer.codegenerator.CodeEngine.freemarkerDo(CodeEngine.java:223)
at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:162)
at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:1293)
at com.st.microxplorer.codegenerator.CodeGenerator.generatePeriphConfigCode(CodeGenerator.java:805)
at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:596)
at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:406)
at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:606)
at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:532)
at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:323)
at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:32)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:825)
at freemarker.ext.beans.BeanModel.invokeThroughDescriptor(BeanModel.java:272)
at freemarker.ext.beans.BeanModel.get(BeanModel.java:183)
... 34 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at com.st.microxplorer.mcu.NvicVector.GenericGeneratorExtiTsc(NvicVector.java:789)
at com.st.microxplorer.mcu.NvicVector.getHalHandler(NvicVector.java:203)
... 40 more

wjandsq 发表于 2015-2-1 20:26:43

代码生成故障,使用PC3可以生成,使用PC2无法生成中断代码。

安姆虫 发表于 2015-3-15 00:44:54

wjandsq 发表于 2015-2-1 20:26
代码生成故障,使用PC3可以生成,使用PC2无法生成中断代码。

楼上的问题怎么没有人回答一下,我也碰到相同问题!

wjandsq 发表于 2015-3-16 13:38:09

希望官方给予解决,或者哪位大侠出手。

foxglove 发表于 2015-3-16 13:55:43

测试一下看看

wjandsq 发表于 2015-3-16 14:26:15

PC3正常,设定PC2为外部下降沿中断,就乱套了。

wjandsq 发表于 2015-4-8 15:12:13

4.7.0 版本已解决了这个问题,可以正确地生成PC2的外部GPIO中断代码。
页: [1]
查看完整版本: 发现bug, STM32CubeMX V4.6.0不能生成PC2外部中断代码!