本帖主要通过外部中断实验来学习S5PV210的中断体系。
S5PV210的中断体系结构
在官方datasheet --
S5PV210_UM_REV1.1 中的sections 04_interrupt 有对整个体系的详细介绍。
S5PV210的中断控制器是由4个向量中断控制器(VIC)、ARM PrimeCell PL192 和 4个 TrustZone Interrupt Controller (TZIC)共同组成。
S5PV210共支持93个中断源,datasheet中有详细的表格:![](https://i-blog.csdnimg.cn/blog_migrate/1110381b241e4505b3d69c41124d57cf.png)
![](https://i-blog.csdnimg.cn/blog_migrate/3431797893929486a349756f6ee21de9.png)
![](https://i-blog.csdnimg.cn/blog_migrate/7bf22a77560b13192fee7495736674bb.png)
![](https://i-blog.csdnimg.cn/blog_migrate/1110381b241e4505b3d69c41124d57cf.png)
![](https://i-blog.csdnimg.cn/blog_migrate/3431797893929486a349756f6ee21de9.png)
![](https://i-blog.csdnimg.cn/blog_migrate/7bf22a77560b13192fee7495736674bb.png)
![](https://i-blog.csdnimg.cn/blog_migrate/bd55943efc1e8ebc5df68f395cbb79e0.png)
S5PV210中的四个VIC对应的寄存器很多,但很多都是重复意义的。
OK210的按键外设
本次实验是用外部中断来实现,所以需要用到开发板的复位按键。通过OK210的核心板和底板的原理图,可以知道按键是接在哪个GPIO上:![](https://i-blog.csdnimg.cn/blog_migrate/44a9e3d277ae298cd594858a9cc86304.png)
![](https://i-blog.csdnimg.cn/blog_migrate/44a9e3d277ae298cd594858a9cc86304.png)
![](https://i-blog.csdnimg.cn/blog_migrate/238acd360b55c70a8717da998ec87949.png)
相对应有用的寄存器:
![](https://i-blog.csdnimg.cn/blog_migrate/af2fdfbf4f8d21300c550dfa11ba5cd9.png)
程序编写思路
本次实验的很多程序文件还是沿用之前的,时钟、串口的初始化直接照搬,Makefile只需做稍微的修改,main函数不用说,测试部分基本在里面,所以新增的中断int.c文件是主要的。
在S5PV210的启动流程中,可以知道如下模块地址映射图:
其中一块是异常向量表,这个地址对于本次实验相当重要。
![](https://i-blog.csdnimg.cn/blog_migrate/4e5004f452ce1187f05f656c4013b40c.png)
对于start.S的启动,需要增加中断服务程序: