搜索
查看: 732|回复: 2

[求助] 求救!! 使用STVD仿真程式會卡在EnableInt中

[复制链接]

该用户从未签到

1

主题

2

帖子

0

蝴蝶豆

新手上路

最后登录
2019-7-16
发表于 2019-7-14 17:33:45 | 显示全部楼层 |阅读模式
板上的各位前輩,小弟使用STVD開發STM8S103F3,使用C語言,使用仿真模式單步執行的時候發現卡在stm_interrupt_vector.c中的一個中斷function,

@far @interrupt void NonHandledInterrupt (void)
{
        /* in order to detect unexpected events during development,
           it is recommended to set a breakpoint on the following instruction
        */
        return;
}


主程式:
main()
{
        EnableInt;
        srand(0);
        delay(10000);
        GPIO_init();
        CLK_ini();
        TIM4_ini();
        uart_ini(4800);


        for(i=0;i<=10;i++)
                        {
                                PC_ODR |= BIT7; //blink yellow LED
                                delay(50000);
                                PC_ODR &= ~BIT7;
                                delay(50000);
                        }
                                PC_ODR |= BIT7;

}

始終卡在中斷retuen;裡,導致我無法進行之後的動作,有版上的前輩們有遇過這種狀況或是處理方式嗎。

回复

使用道具 举报

该用户从未签到

3

主题

1306

帖子

929

蝴蝶豆

版主

最后登录
2021-3-31
发表于 2019-7-15 21:16:12 | 显示全部楼层
检查一下你的中断配置,是不是每个中断向量入口都与对应的中断服务函数对应起来
回复 支持 反对

使用道具 举报

该用户从未签到

1

主题

2

帖子

0

蝴蝶豆

新手上路

最后登录
2019-7-16
 楼主| 发表于 2019-7-16 14:05:42 | 显示全部楼层
butterflyspring 发表于 2019-7-15 21:16
检查一下你的中断配置,是不是每个中断向量入口都与对应的中断服务函数对应起来 ...

前輩您好  我有確認我的中斷配置

struct interrupt_vector const _vectab[] = {
        {0x82, (interrupt_handler_t)_stext}, /* reset */
        {0x82, trap_int}, /* trap  Software interrupt*/
        {0x82, NonHandledInterrupt}, /* irq0  TLI External top level interrupt*/
        {0x82, NonHandledInterrupt}, /* irq1  AWU Auto wake up from halt*/
        {0x82, NonHandledInterrupt}, /* irq2  CLK Clock controller*/
        {0x82, NonHandledInterrupt}, /* irq3  EXTI0 Port A external interrupts*/
        {0x82, NonHandledInterrupt}, /* irq4  EXTI1 Port B external interrupts*/
        {0x82, NonHandledInterrupt}, /* irq5  EXTI2 Port C external interrupts*/
        {0x82, NonHandledInterrupt}, /* irq6  EXTI3 Port D external interrupts*/
        {0x82, NonHandledInterrupt}, /* irq7  EXTI4 Port E external interrupts*/
        {0x82, NonHandledInterrupt}, /* irq8  */
        {0x82, NonHandledInterrupt}, /* irq9  */
        {0x82, NonHandledInterrupt}, /* irq10 SPI End of transfer*/
        {0x82, NonHandledInterrupt}, /* irq11 TIM1 update/ overflow/underflow/ trigger/ break*/
        {0x82, NonHandledInterrupt}, /* irq12 TIM1 capture/ compare*/
        {0x82, NonHandledInterrupt}, /* irq13 TIM update/ overflow*/
        {0x82, NonHandledInterrupt}, /* irq14 TIM capture/ compare*/
        {0x82, NonHandledInterrupt}, /* irq15 TIM3 Update/ overflow*/
        {0x82, NonHandledInterrupt}, /* irq16 TIM3 Capture/ compare*/
        {0x82, NonHandledInterrupt}, /* irq17 */
        {0x82, uart1_int}, /* irq18 UART1*/
        {0x82, NonHandledInterrupt}, /* irq19 I2C I2C interrupt*/
        {0x82, NonHandledInterrupt}, /* irq20 UART2 Tx complete*/
        {0x82, NonHandledInterrupt}, /* irq21 UART2 Receive register DATA FULL*/
        {0x82, NonHandledInterrupt}, /* irq22 ADC1 end of conversion/analog watchdog interrupt*/
        {0x82, NonHandledInterrupt}, /* irq23 TIM update/ overflow*/
        {0x82, NonHandledInterrupt}, /* irq24 Flash EOP/ WR_PG_DIS*/
        {0x82, NonHandledInterrupt}, /* irq25 */
        {0x82, NonHandledInterrupt}, /* irq26 */
        {0x82, NonHandledInterrupt}, /* irq27 */
        {0x82, NonHandledInterrupt}, /* irq28 */
        {0x82, NonHandledInterrupt}, /* irq29 */
};

extern @far @interrupt void trap_int(void);
extern @far @interrupt void uart1_int(void);

我所宣告的中段都有對應到,可是一樣在仿真的時候還是會卡住
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条

Archiver|手机版|小黑屋|论坛-意法半导体STM32/STM8技术社区

GMT+8, 2024-4-20 13:20 , Processed in 1.147756 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表