打印
[开发工具]

〔请教〕IAR编译STM32的时候遇到了问题

[复制链接]
4125|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
skywalkzf|  楼主 | 2008-12-3 20:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我在将demo中的例子拷贝到新建的工程中的时候,在linker的时候出现了如下的错误
Error[Li005]: no definition for "NMIException" [referenced from D:CodeIARSTM32F103VCppDebugObjstm32f10x_vector.o] 
。。。。。
Error[Li005]: no definition for "DMA2_Channel4_5_IRQHandler" [referenced from D:CodeIARSTM32F103VCppDebugObjstm32f10x_vector.o] 

我查看了下这些定义都是在stm32f10x_vector.c中出现了?希望可以给我解答。
我使用的编译环境为IAR5.20,所用的文件也是针对IAR5.20的。
沙发
skywalkzf|  楼主 | 2008-12-4 15:13 | 只看该作者

发现原因

是由于我的粗心导致的,我没有包含这些中断的声明导致的错误。

我现在出现了新的问题:
我用IAR+wriger配合HJTAG进行debug可以实现,但是单独用HJTAG进行下载hex文件提示flash地址越界。
谁碰到过这个问题呢?

使用特权

评论回复
板凳
skywalkzf|  楼主 | 2008-12-4 17:21 | 只看该作者

3楼

我在H-Flasher中的操作是先进行Flash-select,选择使用的STM32的芯片,然后在Programming中点选check,选择下载hex文件。

使用特权

评论回复
地板
skywalkzf|  楼主 | 2008-12-5 09:33 | 只看该作者

FSMC USART

1、在使用库函数的时候,我对其的调用为:
    FSMC_SRAM_Init();
    FSMC_SRAM_WriteBuffer(TestStr,0,2);
    FSMC_SRAM_ReadBuffer(ReadStr,0,10);
对其的读写好像不能同时调用进去,同时调用Write和Read的时候,在调试的时候出现了硬件错误的毛病,进入HardFaultException()这个函数中;

2、在调试USART中的时候,有数据发送出来,但是串口调试终端接收到的数据不对,我的波特率还有相关配置都是按照demo来做的。
我的USART的配置为:

/* PLLCLK = 12MHz * 6 = 72 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_6);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB |RCC_APB2Periph_GPIOC 
     | RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE | RCC_APB2Periph_AFIO | RCC_APB2Periph_USART1, ENABLE);
void USART_Config( void )
{
    GPIO_InitTypeDef GPIO_InitStructure;
    USART_InitTypeDef USART_InitStructure;

    /* Configure the GPIO ports( USART1 Transmit and Receive Lines) */
    /* Configure the USART1_Tx as Alternate function Push-Pull */
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
    GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_9;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOA, &GPIO_InitStructure);

    /* Configure the USART1_Rx as input floating */
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 ;
//    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOA, &GPIO_InitStructure);

    /* USART1 configuration ------------------------------------------------------*/
    /* USART1 configured as follow:
    - BaudRate = 9600 baud  
    - Word Length = 8 Bits
    - One Stop Bit
    - No parity
    - Hardware flow control disabled (RTS and CTS signals)
    - Receive and transmit enabled
    */
  
    USART_InitStructure.USART_BaudRate = 9600;
    USART_InitStructure.USART_WordLength = USART_WordLength_8b;
    USART_InitStructure.USART_StopBits = USART_StopBits_1;
    USART_InitStructure.USART_Parity = USART_Parity_No;
    USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
    USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;

    /* Configure the USART1 */
    USART_Init(USART1, &USART_InitStructure);

    /* Enable the USART1 */
    USART_Cmd(USART1, ENABLE);
}
  希望高手可以给予解答。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

7

主题

23

帖子

0

粉丝