11.5.2 Use Case 2: SRAM Test Mode
In addition to the test modes described in the Test Modes section, the CAN controller can be put into SRAM test mode. The CAN controller has a built-in RAM, which is protected by EDAC that is used to store the receive and transmit messages.
To support software based memory testing, the CAN controller is put into SRAM test mode. When this SRAM test mode is active, the CAN controller operation is disabled and transparent access from the host APB interface to all SRAM memory locations is available. SRAM test mode gets enabled or disabled by setting the CAN command bit[3] of the CAN_COMMAND register. For more information, see 11.6.4 Command Register. SRAM test mode and CAN controller operation are mutually exclusive. Thus, SRAM test mode gets enabled when CAN controller is stopped and the CAN controller gets started when the SRAM test mode is stopped. In the SRAM test mode:
- Transparent read and write access to all SRAM memory locations is supported
- All message buffer write protect features are disabled
- Access to receive and transmit message buffer control registers is disabled
In SRAM test mode, the APB interface is used to access different SRAM address directly for test or initialization purposes. At power-up, SRAM is not initialized and any READ action to the memory locations would result in an ECC error if EDAC is enabled. Hence, putting the CAN controller into SRAM test mode enables initialization of the SRAM so ECC errors at power-up do not occur if EDAC is enabled.
The following table provides address mapping between the APB and SRAM addresses.
APB Address | SRAM Address | Description |
---|---|---|
0x020 | 0x000 | TxObject0:Control Bits |
0x024 | 0x001 | TxObject0:Identifier Bits |
0x028 | 0x002 | TxObject0:Data High Bits |
0x02C | 0x003 | TxObject0:Data Low Bits |
0x030-0x03C | 0x004-0x007 | TxObject1 |
0x040-0x04C | 0x008-0x00B | TxObject2 |
0x050-0x05C | 0x00C-0x00F | TxObject3 |
0x060-0x06C | 0x010-0x013 | TxObject4 |
0x070-0x07C | 0x014-0x017 | TxObject5 |
0x080-0x08C | 0x018-0x01B | TxObject6 |
0x090-0x09C | 0x01C-0x01F | TxObject7 |
0x0A0-0x0AC | 0x020-0x023 | TxObject8 |
0x0B0-0x0BC | 0x024-0x027 | TxObject9 |
0x0C0-0x0CC | 0x028-0x02B | TxObject10 |
0x0D0-0x0DC | 0x02C-0x02F | TxObject11 |
0x0E0-0x0EC | 0x030-0x033 | TxObject12 |
0x0F0-0x0FC | 0x034-0x037 | TxObject13 |
0x100-0x10C | 0x038-0x03B | TxObject14 |
0x110-0x11C | 0x03C-0x03F | TxObject15 |
0x120-0x12C | 0x040-0x043 | TxObject16 |
0x130-0x13C | 0x044-0x047 | TxObject17 |
0x140-0x14C | 0x048-0x04B | TxObject18 |
0x150-0x15C | 0x04C-0x04F | TxObject19 |
0x160-0x16C | 0x050-0x053 | TxObject20 |
0x170-0x17C | 0x054-0x057 | TxObject21 |
0x180-0x18C | 0x058-0x05B | TxObject22 |
0x190-0x19C | 0x05C-0x05F | TxObject23 |
0x1A0-0x1AC | 0x060-0x063 | TxObject24 |
0x1B0-0x1BC | 0x064-0x067 | TxObject25 |
0x1C0-0x1CC | 0x068-0x06B | TxObject26 |
0x1D0-0x1DC | 0x06C-0x06F | TxObject27 |
0x1E0-0x1EC | 0x070-0x073 | TxObject28 |
0x1F0-0x1FC | 0x074-0x077 | TxObject29 |
0x200-0x20C | 0x078-0x07B | TxObject30 |
0x210-0x21C | 0x07C-0x07F | TxObject31 |
0x220 | 0x080 | RxObject0:Control Bits |
0x224 | 0x081 | RxObject0:Identifier Bits |
0x228 | 0x082 | RxObject0:Data High Bits |
0x22C | 0x083 | RxObject0:Data Low Bits |
0x230 | 0x084 | RxObject0:AMR - ID |
0x234 | 0x085 | RxObject0:ACR - ID |
0x238 | 0x086 | RxObject0:AMR - Data |
0x23C | 0x087 | RxObject0:ACR - Data |
0x240-0x25C | 0x088-0x08F | Receive Message Object 1 |
0x260-0x27C | 0x090-0x097 | Receive Message Object 2 |
0x280-0x29C | 0x098-0x09F | Receive Message Object 3 |
0x2A0-0x2BC | 0x0A0-0x0A7 | Receive Message Object 4 |
0x2C0-0x2DC | 0x0A8-0x0AF | Receive Message Object 5 |
0x2E0-0x2FC | 0x0B0-0x0B7 | Receive Message Object 6 |
0x300-0x31C | 0x0B8-0x0BF | Receive Message Object 7 |
0x320-0x33C | 0x0C0-0x0C7 | Receive Message Object 8 |
0x340-0x35C | 0x0C8-0x0CF | Receive Message Object 9 |
0x360-0x37C | 0x0D0-0x0D7 | Receive Message Object 10 |
0x380-0x39C | 0x0D8-0x0DF | Receive Message Object 11 |
0x3A0-0x3BC | 0x0E0-0x0E7 | Receive Message Object 12 |
0x3C0-0x3DC | 0x0E8-0x0EF | Receive Message Object 13 |
0x3E0-0x3FC | 0x0F0-0x0F7 | Receive Message Object 14 |
0x400-0x41C | 0x0F8-0x0FF | Receive Message Object 15 |
0x420-0x43C | 0x100-0x107 | Receive Message Object 16 |
0x440-0x45C | 0x108-0x10F | Receive Message Object 17 |
0x460-0x47C | 0x110-0x117 | Receive Message Object 18 |
0x480-0x49C | 0x118-0x11F | Receive Message Object 19 |
0x4A0-0x4BC | 0x120-0x127 | Receive Message Object 20 |
0x4C0-0x4DC | 0x128-0x12F | Receive Message Object 21 |
0x4E0-0x4FC | 0x130-0x137 | Receive Message Object 22 |
0x500-0x51C | 0x138-0x13F | Receive Message Object 23 |
0x520-0x53C | 0x140-0x147 | Receive Message Object 24 |
0x540-0x55C | 0x148-0x14F | Receive Message Object 25 |
0x560-0x57C | 0x150-0x157 | Receive Message Object 26 |
0x580-0x59C | 0x158-0x15F | Receive Message Object 27 |
0x5A0-0x5BC | 0x160-0x167 | Receive Message Object 28 |
0x5C0-0x5DC | 0x168-0x16F | Receive Message Object 29 |
0x5E0-0x5FC | 0x170-0x177 | Receive Message Object 30 |
0x600-0x61C | 0x178-0x17F | Receive Message Object 31 |