bit-band test

Dependencies:   mbed

Fork of bit-band by vics66@...

main.cpp

Committer:
moo
Date:
2014-06-03
Revision:
1:95cec43280f9
Parent:
0:cd40794dcbe8

File content as of revision 1:95cec43280f9:

/*
* bit-band test
*/

#include "mbed.h"

DigitalOut  led1(LED1);

extern "C" void HardFault_Handler() 
{
    __nop();
}

int main() 
{
    volatile int *a1 = (int*)(0x10000000);  // SRAM先頭アドレス
    *a1 = 0x1;      // Memory windowにて0x1 → 0x0になることを確認した
    *a1 = 0x0;

    volatile int *a2 = (int*)(0x22000000);  // SRAM先頭アドレスをbit-band-aliasで指定
    *a2 = 0x1;      // Memory windowにて0x10000000を見ても0x1になることを確認出来ない

    __nop();    // この行を実行するとHardFault_Handler()に飛ぶ
    __nop();
    while (1);
}