STM32 USB CAN 学习笔记
扫描二维码
随时随地手机看文章
USB 时钟可以一直使能。
如果CAN时钟没有使能,RAM 能被软件读写。(CANBus 不能发送和接受Message)
如果CAN时钟使能,RAM不能软件被写。 CANBus Core 控制此RAM区域。(CANBus 可以发送和接受Message)
CANBus 占用了 256 字节(地址范围 512 字节)。
开始区域是Filters[14] = (F0R0、F0R1), (F1R0、F1R1), ... (F13R0、F13R1).
紧接着是 Rx0 FiFo[0], Tx0, Tx1, Tx2,Rx0 FiFo[1], Rx0 FiFo[2], Rx1 FiFo[0], Rx1 FiFo[1], Rx1 FiFo[2]。
USB 可以使用后面的 256 字节。
具体分配可以是 : 8 个端点占用 8 * 8 = 64 Bytes (ADDR、CNT : TX、RX)
最好只使用 3 个端点 : (1) 控制端点 0 (2) In 端点 1 (3)Out 端点 2
控制端点 : 64 bytes
In 端点: 64 Bytes
Out 端点: 64 Bytes
000060000000000000000000F8FF0000FFFF0000//Filters[0]000060100800000000000000F8FF0000FFFF0000000060201000000000000000F8FF0000FFFF0000000060301800000000000000F8FF0000FFFF0000000060402000000000000000F8FF0000FFFF0000000060502800000000000000F8FF0000FFFF0000000060603000000000000000F8FF0000FFFF0000000060703800000000000000F8FF0000FFFF0000000060804000000000000000F8FF0000FFFF0000000060904800000000000000F8FF0000FFFF0000000060A05000000000000000F8FF0000FFFF0000000060B05800000000000000F8FF0000FFFF0000000060C06000000000000000F8FF0000FFFF0000000060D06800000000000000F8FF0000FFFF0000//Filters[13]
000060E004000000000000000800000000000000//Rx0FIFO[0]000060F0012300004567000089AB0000CDEF0000
0000610005000000000000000800000000000000//Tx000006110012300004567000089AB0000CDEF0000000061200D000000000000000800000000000000//Tx100006130012300004567000089AB0000CDEF00000000614015000000000000000800000000000000//Tx200006150012300004567000089AB0000CDEF0000
000061600C000000000000000801000000000000//Rx0FIFO[1]00006170012300004567000089AB0000CDEF00000000618014000000000000000802000000000000//Rx0FIFO[2]00006190012300004567000089AB0000CDEF0000000061A01C000000000000000800000000000000//Rx1FIFO[0]000061B0012300004567000089AB0000CDEF0000000061C000000000000000000000000000000000//Rx1FIFO[1]000061D000000000000000000000000000000000000061E000000000000000000000000000000000//Rx1FIFO[2]000061F000000000000000000000000000000000
0000620022220000222200002222000022220000//UnusedEndpoint0000621022220000222200002222000022220000000062202222000022220000222200002222000000006230222200002222000022220000222200000000624022220000222200002222000022220000
0000625040010000000000004001000000840000//EP0--BufferTable@0x0250000062608001000000000000C001000040000000//EP100006270C001000000840000C001000000840000//EP2
0000628000090000000000000000000000000000//EP0Buffer0000629026260000FFFF00000001000000010000000062A002010000650000007200000040000000000062B000070000050200000240000000000000000062C022220000222200002222000022220000000062D022220000222200002222000022220000000062E022220000222200002222000022220000000062F022220000222200002222000022220000
0000630022220000222200002222000022220000//EP1Buffer000063102222000022220000222200002222000000006320222200002222000022220000222200000000633022220000222200002222000022220000000063402222000022220000222200002222000000006350C001000000000000C00100000084000000006360C001000000000000FD6700000A6C0000000063703478000068FD0000C001000000840000
0000638000090000010000000000000000000000//EP2Buffer0000639027270000040000000002000000000000000063A000000000070500008102000040000000000063B000070000050200000240000000000000000063C0898E000082830000C2470000B4690000000063D0EA7C00001629000093C3000079250000000063E04AE10000F9AC000039CB0000473A0000000063F0F1320000C02200007B0300004FA20000