/tmp

Sijichun's Blog

Get Time

1
2
3
4
5
6
7
8
float getTime() {
register unsigned long f, t;
// Get the current counter frequency
asm volatile("mrs %0, cntfrq_el0" : "=r"(f));
// Read the current counter
asm volatile("mrs %0, cntpct_el0" : "=r"(t));
return (float)t / f;
}
Read more »

MMIO

rpi3透過MMIO(memory mapped io)方式存取周邊裝置的暫存器
在ARM CPU和pheripheral bus間坐落VideoCore/ARM MMU,MMU將周邊裝置映射到0x3f000000-0x7e000000

GPIO

GPIO可設置為給LED或按鈕使用的input-output或UART、SPI使用的alternate functions兩種模式。使用alternate function時需額外設置pull up/down register來禁用GPIO pull up/down,透過設置GPPUDGPPUDCLKn
GPIO 14, 15腳位可用做於mini UART或PL011 UART。設置GPFSELnALT5來使用mini UART或ALT0來使用PL011 UART。

Read more »

Requirement:

  1. Let only one core proceed, and let others enter a busy loop.
  2. Initialize the BSS segment.
  3. Set the stack pointer to an appropriate position.
Read more »
0%