小编edg*_*epi的帖子

i2c中断处理程序stm32

我有一些I2C2中断的问题,我启用了中断,但处理程序中断从不执行.

这是i2c2的初始化:

void i2c2InitSlave(void)
{
    I2C_DeInit(I2C2);
    GPIO_InitTypeDef GPIO_InitStructure;
    I2C_InitTypeDef I2C_InitStructure;

    /*I2C2 Peripheral clock enable */
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C2, ENABLE);

    /* Enable GPIO clock */
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOH, ENABLE);

    // I2C2 SCL and SDA Pin configuration
    GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
    GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOH, &GPIO_InitStructure);

    GPIO_PinAFConfig(GPIOH, GPIO_PinSource4, GPIO_AF_I2C2);
        GPIO_PinAFConfig(GPIOH, GPIO_PinSource5, GPIO_AF_I2C2);

    /* Initialize I2C peripheral */
    /* I2C Init */
    I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
    I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;
    I2C_InitStructure.I2C_OwnAddress1 = SLAVE_ADDRESS;
    I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
    I2C_InitStructure.I2C_ClockSpeed = 100000; …
Run Code Online (Sandbox Code Playgroud)

stm32 i2c

9
推荐指数
1
解决办法
2万
查看次数

带有autoconf的ARM编译器

我正在尝试使用autoconf为ARM体系结构编译一些文件.我正在Ubuntu 12.04中编译它们,目标系统是BeagleBoard XM.我运行以下命令:

./configure --host=arm-linux-gnueabi -prefix=${CSTOOL_DIR}/linux_arm_tool
Run Code Online (Sandbox Code Playgroud)

得到这个结果:

configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-gnueabi-strip... arm-linux-gnueabi-strip   
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for arm-linux-gnueabi-gcc... arm-linux-gnueabi-gcc
checking whether the …
Run Code Online (Sandbox Code Playgroud)

arm autotools cross-compiling

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

arm ×1

autotools ×1

cross-compiling ×1

i2c ×1

stm32 ×1