|
Programming Embedded Systems in C and C++If no overlapping is found, repeat the procedure for each of the remaining offsets. The function memTestAddressBus shows how this can be done in practice. The function accepts two parameters. The first parameter is the base address of the memory block to be tested, and the second is its size, in bytes. The size is used to determine which address bits should be tested. For best results, the base address should contain a in each of those bits. If the address bus test fails, the address at which the first error was detected will be returned. Otherwise, the function returns NULL to indicate success. /********************************************************************** * Function: memTestAddressBus() * * Description: Test the address bus wiring in a memory region by * performing a walking 1's test on the relevant bits * of the address and checking for aliasing. The test * will find single-bit address failures such as stuck * -high, stuck-low, and shorted pins. ...» | Код для вставки книги в блог HTML
phpBB
текст
|
|