Raspberry Pi: Difference between revisions

Added FPU info.
[unchecked revision][unchecked revision]
m (Reformat)
(Added FPU info.)
Line 110:
 
When configuring some peripheral to send an interrupt it is a usefull thing to have interrupts disabled in the CPSR, enable the interrupt you are interested in (or all) in the 3 interrupt enable registers and then poll the 3 pending registers in a tight loop and output changes. This allows you to see if the peripheral raises an interrupt and (if in doubt) which one. After that the real interrupt handler can be configured and tested. Gives you a nice half way point to test what you have so far.
 
==Floating point support - VFP==
 
To be able to use any floating point operations, such as storing or loading floating point numbers, you need to enable the FPU before using it. To do this, you have to enable access to the coprocessor to whoever should be able to use it, and you have to enable the FPU itself.
 
# enable FPU in coprocessor enable register - this gives everybody access to both locations of coprocessor.
ldr r0, =(0xF << 20)
mcr p15, 0, r0, c1, c0, 2
 
And then enable the FPU itself:
 
# enable FPU in FP exception register
MOV r3, #0x40000000
# VMSR FPEXC, r3 # assembler bug
.long 0xeee83a10
 
The third line is the actual instruction that you'd want to use, but due to a bug in Binutils 2.23 it does not assemble. The line below it is what it should assemble to, and replaces the opcode. After doing these two, it's possible to use the FPU.
 
==USB==
26

edits