Skip to content

Commit fe91bec

Browse files
authored
Merge pull request embassy-rs#785 from turnaroundfactor/n6-can
N6 CAN Support
2 parents 76e5351 + c369d06 commit fe91bec

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,10 @@ fieldset/RXFS:
964964
description: Rx FIFO X Message Lost
965965
bit_offset: 25
966966
bit_size: 1
967+
- name: DMS
968+
description: Debug message status
969+
bit_offset: 30
970+
bit_size: 2
967971
fieldset/SIDFC:
968972
description: FDCAN Standard ID Filter Configuration Register
969973
fields:

stm32-data-gen/src/generator.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,11 @@ fn create_peripheral_map(chip_name: &str, group: &ChipGroup, defines: &header::D
586586

587587
// The STM32H7S / STM32H7R use the FDCAN v1 peripheral instead of the one used in the rest of the H7 family.
588588
let h7_non_rs_re = Regex::new(r"STM32H7[0-9AB].*").unwrap();
589+
let n6 = Regex::new(r"STM32N6.*").unwrap();
589590

590591
if !fdcans.is_empty() {
591-
if h7_non_rs_re.is_match(chip_name) {
592-
// H7 has one message RAM shared between FDCANs
592+
if h7_non_rs_re.is_match(chip_name) || n6.is_match(chip_name) {
593+
// H7 and N6 have one message RAM shared between FDCANs
593594
peri_kinds
594595
.entry("FDCANRAM".to_string())
595596
.or_insert("unknown".to_string());

stm32-data-gen/src/perimap.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,12 @@ pub static PERIMAP: RegexMap<(&str, &str, &str)> = RegexMap::new(&[
626626
(".*:DMA.*", ("bdma", "v1", "DMA")),
627627
(".*:CAN:bxcan1_v1_1.*", ("can", "bxcan", "CAN")),
628628
("STM32H7[RS].*FDCAN:fdcan1_v1_[01].*", ("can", "fdcan_v1", "FDCAN")),
629-
("STM32H7.*:FDCAN:fdcan1_v1_[01].*", ("can", "fdcan_h7", "FDCAN")),
629+
("STM32H7.*:FDCAN:fdcan1_v1_[01].*", ("can", "fdcan_v2", "FDCAN")),
630630
(".*:FDCAN:fdcan1_v1_[01].*", ("can", "fdcan_v1", "FDCAN")),
631+
(".*:FDCAN:.*fdcan1_v1_2", ("can", "fdcan_v2", "FDCAN")),
631632
("STM32H7[RS].*:FDCANRAM.*", ("fdcanram", "v1", "FDCANRAM")),
632-
("STM32H7.*:FDCANRAM.*", ("fdcanram", "h7", "FDCANRAM")),
633+
("STM32H7.*:FDCANRAM.*", ("fdcanram", "v2", "FDCANRAM")),
634+
("STM32N6.*:FDCANRAM.*", ("fdcanram", "v2", "FDCANRAM")),
633635
(".*:FDCANRAM.*", ("fdcanram", "v1", "FDCANRAM")),
634636
("STM32F[124].*:CRC:.*", ("crc", "v1", "CRC")),
635637
("STM32L1.*:CRC:.*", ("crc", "v1", "CRC")),

0 commit comments

Comments
 (0)