10 Commits

1353 changed files with 134615 additions and 171366 deletions

4
modules/FC/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
FC-backups/
*.bak
.kiri/
gerbers/

Binary file not shown.

1075
modules/FC/Camera.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

70468
modules/FC/FC.kicad_pcb Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"board": { "board": {
"active_layer": 37, "active_layer": 0,
"active_layer_preset": "", "active_layer_preset": "",
"auto_track_width": false, "auto_track_width": false,
"hidden_nets": [], "hidden_nets": [],
@ -62,11 +62,11 @@
35, 35,
36 36
], ],
"visible_layers": "ffcffff_ffffffff", "visible_layers": "000fdf0_80000001",
"zone_display_mode": 0 "zone_display_mode": 0
}, },
"meta": { "meta": {
"filename": "Sun_sensor.kicad_prl", "filename": "FC.kicad_prl",
"version": 3 "version": 3
}, },
"project": { "project": {

View File

@ -33,9 +33,9 @@
"other_text_thickness": 0.15, "other_text_thickness": 0.15,
"other_text_upright": false, "other_text_upright": false,
"pads": { "pads": {
"drill": 0.762, "drill": 0.0,
"height": 1.524, "height": 0.3,
"width": 1.524 "width": 0.625
}, },
"silk_line_width": 0.15, "silk_line_width": 0.15,
"silk_text_italic": false, "silk_text_italic": false,
@ -45,7 +45,7 @@
"silk_text_upright": false, "silk_text_upright": false,
"zones": { "zones": {
"45_degree_only": false, "45_degree_only": false,
"min_clearance": 0.254 "min_clearance": 0.19999999999999998
} }
}, },
"diff_pair_dimensions": [ "diff_pair_dimensions": [
@ -352,24 +352,24 @@
"pinned_symbol_libs": [] "pinned_symbol_libs": []
}, },
"meta": { "meta": {
"filename": "Sun_sensor.kicad_pro", "filename": "FC.kicad_pro",
"version": 1 "version": 1
}, },
"net_settings": { "net_settings": {
"classes": [ "classes": [
{ {
"bus_width": 12.0, "bus_width": 12.0,
"clearance": 0.15, "clearance": 0.2,
"diff_pair_gap": 0.25, "diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25, "diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2, "diff_pair_width": 0.2,
"line_style": 0, "line_style": 0,
"microvia_diameter": 0.45, "microvia_diameter": 0.3,
"microvia_drill": 0.2, "microvia_drill": 0.1,
"name": "Default", "name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)", "pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)", "schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.15, "track_width": 0.25,
"via_diameter": 0.45, "via_diameter": 0.45,
"via_drill": 0.2, "via_drill": 0.2,
"wire_width": 6.0 "wire_width": 6.0
@ -386,7 +386,7 @@
"idf": "", "idf": "",
"netlist": "", "netlist": "",
"specctra_dsn": "", "specctra_dsn": "",
"step": "Sun_sensor.step", "step": "",
"vrml": "" "vrml": ""
}, },
"page_layout_descr_file": "/home/petr/work/butcube/resources/kicad_page_layout.kicad_wks" "page_layout_descr_file": "/home/petr/work/butcube/resources/kicad_page_layout.kicad_wks"
@ -431,8 +431,36 @@
}, },
"sheets": [ "sheets": [
[ [
"b4fcae78-0ce7-4618-9b55-3d67c0b38940", "e63e39d7-6ac0-4ffd-8aa3-1841a4541b55",
"" ""
],
[
"89c18b9c-1cb9-45ef-bf7e-879d882b206b",
"MCU"
],
[
"24115169-fbaf-42f8-8ea2-50b53559acae",
"Camera"
],
[
"e4664c1b-a4cd-4eed-8c0f-efff7b6d7960",
"External_sensors"
],
[
"5f4fd338-1c9e-4638-abf9-b24cce2a1173",
"IMU"
],
[
"2505c719-4f81-44f4-a7a9-014d02ea119f",
"Memory"
],
[
"edeb4030-7f14-49fb-9462-99707ceae37e",
"Power"
],
[
"2db60271-e8e5-4def-ae3d-d6e19678f4e1",
"Flash"
] ]
], ],
"text_variables": {} "text_variables": {}

1681
modules/FC/FC.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

898
modules/FC/Flash.kicad_sch Normal file
View File

@ -0,0 +1,898 @@
(kicad_sch (version 20211123) (generator eeschema)
(uuid 2545c40d-c5a0-44b7-87db-18f60adb5bad)
(paper "A4")
(title_block
(title "BUTCube - Flight controller")
(date "2022-03-11")
(rev "v1.0")
(comment 1 "Author: Petr Malaník")
)
(lib_symbols
(symbol "Device:C" (pin_numbers hide) (pin_names (offset 0.254)) (in_bom yes) (on_board yes)
(property "Reference" "C" (id 0) (at 0.635 2.54 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "C" (id 1) (at 0.635 -2.54 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "" (id 2) (at 0.9652 -3.81 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "cap capacitor" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Unpolarized capacitor" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_fp_filters" "C_*" (id 6) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "C_0_1"
(polyline
(pts
(xy -2.032 -0.762)
(xy 2.032 -0.762)
)
(stroke (width 0.508) (type default) (color 0 0 0 0))
(fill (type none))
)
(polyline
(pts
(xy -2.032 0.762)
(xy 2.032 0.762)
)
(stroke (width 0.508) (type default) (color 0 0 0 0))
(fill (type none))
)
)
(symbol "C_1_1"
(pin passive line (at 0 3.81 270) (length 2.794)
(name "~" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin passive line (at 0 -3.81 90) (length 2.794)
(name "~" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "Device:R" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "R" (id 0) (at 2.032 0 90)
(effects (font (size 1.27 1.27)))
)
(property "Value" "R" (id 1) (at 0 0 90)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at -1.778 0 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "R res resistor" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Resistor" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_fp_filters" "R_*" (id 6) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "R_0_1"
(rectangle (start -1.016 -2.54) (end 1.016 2.54)
(stroke (width 0.254) (type default) (color 0 0 0 0))
(fill (type none))
)
)
(symbol "R_1_1"
(pin passive line (at 0 3.81 270) (length 1.27)
(name "~" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin passive line (at 0 -3.81 90) (length 1.27)
(name "~" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "MT29F1G01ABAFDSF_1" (in_bom yes) (on_board yes)
(property "Reference" "U" (id 0) (at -10.16 15.24 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "MT29F1G01ABAFDSF_1" (id 1) (at 12.7 15.24 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "TCY_IC:DFN-8_8x6mm_P1.27mm" (id 2) (at 0 -30.48 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "https://www.micron.com/-/media/client/global/documents/products/data-sheet/nand-flash/70-series/m78a_1gb_3v_nand_spi.pdf?rev=7270128474b44126bb737f0f07976723" (id 3) (at 0 -27.94 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "SPI 32Mbit 1.65V-3.6V" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "32-Mbit, Wide Range Voltage SPI Serial Flash Memory, SOP-8" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_fp_filters" "SOP*5.28x5.23mm*P1.27mm*" (id 6) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "MT29F1G01ABAFDSF_1_1_1"
(rectangle (start -10.16 10.16) (end 10.16 -10.16)
(stroke (width 0.254) (type default) (color 0 0 0 0))
(fill (type background))
)
(pin input line (at -12.7 -7.62 0) (length 2.54)
(name "~{CS}" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin bidirectional line (at -12.7 2.54 0) (length 2.54)
(name "SO/IO1" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
(pin bidirectional line (at 12.7 2.54 180) (length 2.54)
(name "~{WP}/IO2" (effects (font (size 1.27 1.27))))
(number "3" (effects (font (size 1.27 1.27))))
)
(pin power_in line (at 0 -12.7 90) (length 2.54)
(name "GND" (effects (font (size 1.27 1.27))))
(number "4" (effects (font (size 1.27 1.27))))
)
(pin bidirectional line (at -12.7 7.62 0) (length 2.54)
(name "SI/IO0" (effects (font (size 1.27 1.27))))
(number "5" (effects (font (size 1.27 1.27))))
)
(pin input line (at -12.7 -2.54 0) (length 2.54)
(name "SCLK" (effects (font (size 1.27 1.27))))
(number "6" (effects (font (size 1.27 1.27))))
)
(pin bidirectional line (at 12.7 -2.54 180) (length 2.54)
(name "~{HOLD}/IO3" (effects (font (size 1.27 1.27))))
(number "7" (effects (font (size 1.27 1.27))))
)
(pin power_in line (at 0 12.7 270) (length 2.54)
(name "VCC" (effects (font (size 1.27 1.27))))
(number "8" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "TCY_memory:MT29F1G01ABAFDSF" (in_bom yes) (on_board yes)
(property "Reference" "U" (id 0) (at -10.16 15.24 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "MT29F1G01ABAFDSF" (id 1) (at 12.7 15.24 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "TCY_IC:DFN-8_8x6mm_P1.27mm" (id 2) (at 0 -30.48 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "https://www.micron.com/-/media/client/global/documents/products/data-sheet/nand-flash/70-series/m78a_1gb_3v_nand_spi.pdf?rev=7270128474b44126bb737f0f07976723" (id 3) (at 0 -27.94 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "SPI 32Mbit 1.65V-3.6V" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "32-Mbit, Wide Range Voltage SPI Serial Flash Memory, SOP-8" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_fp_filters" "SOP*5.28x5.23mm*P1.27mm*" (id 6) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "MT29F1G01ABAFDSF_1_1"
(rectangle (start -10.16 10.16) (end 10.16 -10.16)
(stroke (width 0.254) (type default) (color 0 0 0 0))
(fill (type background))
)
(pin input line (at -12.7 -7.62 0) (length 2.54)
(name "~{CS}" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin bidirectional line (at -12.7 2.54 0) (length 2.54)
(name "SO/IO1" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
(pin bidirectional line (at 12.7 2.54 180) (length 2.54)
(name "~{WP}/IO2" (effects (font (size 1.27 1.27))))
(number "3" (effects (font (size 1.27 1.27))))
)
(pin power_in line (at 0 -12.7 90) (length 2.54)
(name "GND" (effects (font (size 1.27 1.27))))
(number "4" (effects (font (size 1.27 1.27))))
)
(pin bidirectional line (at -12.7 7.62 0) (length 2.54)
(name "SI/IO0" (effects (font (size 1.27 1.27))))
(number "5" (effects (font (size 1.27 1.27))))
)
(pin input line (at -12.7 -2.54 0) (length 2.54)
(name "SCLK" (effects (font (size 1.27 1.27))))
(number "6" (effects (font (size 1.27 1.27))))
)
(pin bidirectional line (at 12.7 -2.54 180) (length 2.54)
(name "~{HOLD}/IO3" (effects (font (size 1.27 1.27))))
(number "7" (effects (font (size 1.27 1.27))))
)
(pin power_in line (at 0 12.7 270) (length 2.54)
(name "VCC" (effects (font (size 1.27 1.27))))
(number "8" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "power:+3.3V" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "#PWR" (id 0) (at 0 -3.81 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3.3V" (id 1) (at 0 3.556 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "power-flag" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Power symbol creates a global label with name \"+3.3V\"" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "+3.3V_0_1"
(polyline
(pts
(xy -0.762 1.27)
(xy 0 2.54)
)
(stroke (width 0) (type default) (color 0 0 0 0))
(fill (type none))
)
(polyline
(pts
(xy 0 0)
(xy 0 2.54)
)
(stroke (width 0) (type default) (color 0 0 0 0))
(fill (type none))
)
(polyline
(pts
(xy 0 2.54)
(xy 0.762 1.27)
)
(stroke (width 0) (type default) (color 0 0 0 0))
(fill (type none))
)
)
(symbol "+3.3V_1_1"
(pin power_in line (at 0 0 90) (length 0) hide
(name "+3V3" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "power:+3V3" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "#PWR" (id 0) (at 0 -3.81 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3V3" (id 1) (at 0 3.556 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "power-flag" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Power symbol creates a global label with name \"+3V3\"" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "+3V3_0_1"
(polyline
(pts
(xy -0.762 1.27)
(xy 0 2.54)
)
(stroke (width 0) (type default) (color 0 0 0 0))
(fill (type none))
)
(polyline
(pts
(xy 0 0)
(xy 0 2.54)
)
(stroke (width 0) (type default) (color 0 0 0 0))
(fill (type none))
)
(polyline
(pts
(xy 0 2.54)
(xy 0.762 1.27)
)
(stroke (width 0) (type default) (color 0 0 0 0))
(fill (type none))
)
)
(symbol "+3V3_1_1"
(pin power_in line (at 0 0 90) (length 0) hide
(name "+3V3" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "power:GND" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "#PWR" (id 0) (at 0 -6.35 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (id 1) (at 0 -3.81 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "power-flag" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Power symbol creates a global label with name \"GND\" , ground" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "GND_0_1"
(polyline
(pts
(xy 0 0)
(xy 0 -1.27)
(xy 1.27 -1.27)
(xy 0 -2.54)
(xy -1.27 -1.27)
(xy 0 -1.27)
)
(stroke (width 0) (type default) (color 0 0 0 0))
(fill (type none))
)
)
(symbol "GND_1_1"
(pin power_in line (at 0 0 270) (length 0) hide
(name "GND" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
)
)
)
(junction (at 129.54 78.74) (diameter 0) (color 0 0 0 0)
(uuid 3f1d7446-1899-4571-9fce-3d77f5b9adaa)
)
(junction (at 125.73 88.9) (diameter 0) (color 0 0 0 0)
(uuid 45bf8be3-f9ed-44e5-9a12-ef5835e8d9cb)
)
(junction (at 133.35 83.82) (diameter 0) (color 0 0 0 0)
(uuid 97bdbcb4-ab8e-44a7-aea5-e7e48220827a)
)
(bus_entry (at 127 60.96) (size 2.54 2.54)
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 0dfa9be6-3d47-46c6-b4ea-1d19f007b026)
)
(bus_entry (at 123.19 60.96) (size 2.54 2.54)
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 3551af07-6011-4122-9520-63b091fab687)
)
(bus_entry (at 130.81 60.96) (size 2.54 2.54)
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid c7d5b86b-37f7-4be8-9c6d-f24337192088)
)
(wire (pts (xy 166.37 83.82) (xy 168.91 83.82))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 118be321-218d-4a0b-a038-db654fcf6032)
)
(wire (pts (xy 176.53 88.9) (xy 179.07 88.9))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 17e0dbf4-8f97-44ef-904b-302fc3b7f556)
)
(wire (pts (xy 133.35 121.92) (xy 140.97 121.92))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 216dc44c-ceef-4d91-9cc5-f60b3122b7c2)
)
(wire (pts (xy 129.54 63.5) (xy 129.54 78.74))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 3f359ce4-9700-4ef3-8893-4237e856b67d)
)
(wire (pts (xy 123.19 93.98) (xy 140.97 93.98))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 4963f3bb-d724-4411-b5e1-fb95a751d717)
)
(wire (pts (xy 125.73 63.5) (xy 125.73 88.9))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 67a4c257-a2d6-4738-96d3-46761fb3cf21)
)
(bus (pts (xy 127 60.96) (xy 130.81 60.96))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 71b2e27f-ffa1-4030-b749-cfbc08746372)
)
(wire (pts (xy 184.15 64.77) (xy 184.15 67.31))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 82dc1468-1f4c-4e27-b820-1979bd25b96b)
)
(wire (pts (xy 129.54 78.74) (xy 129.54 116.84))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 969b8f3a-063c-429d-b737-5a43b4c317a2)
)
(wire (pts (xy 140.97 88.9) (xy 125.73 88.9))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 97e476bf-9bac-4bab-92eb-3b355303cb30)
)
(wire (pts (xy 129.54 78.74) (xy 140.97 78.74))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 9b3f73dd-006b-4254-8515-50a22eaf2ab1)
)
(bus (pts (xy 123.19 60.96) (xy 127 60.96))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid b1c0ca22-a1f4-47c7-8546-c1cdc9cf421f)
)
(wire (pts (xy 176.53 83.82) (xy 179.07 83.82))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid b30c52fc-9ba7-41b1-93e4-4a9f154df05e)
)
(wire (pts (xy 176.53 127) (xy 179.07 127))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid b48c85ab-4896-4b01-a9be-8fdc7a3bdaf5)
)
(wire (pts (xy 133.35 63.5) (xy 133.35 83.82))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid b6536e9e-f88c-4d8a-9e05-6e5ada68005e)
)
(wire (pts (xy 133.35 83.82) (xy 133.35 121.92))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid c1c7e22b-a9cc-4902-a876-fb1745ecc2fe)
)
(bus (pts (xy 101.6 60.96) (xy 123.19 60.96))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid c4d35355-2773-45be-a90c-e147d0dfed12)
)
(wire (pts (xy 166.37 127) (xy 168.91 127))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid c5af75f5-7399-48fb-ac6f-e9bb559ee9dc)
)
(wire (pts (xy 176.53 121.92) (xy 179.07 121.92))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid c70d69f1-3b7a-4a76-82e5-ec681cb6cf38)
)
(wire (pts (xy 166.37 121.92) (xy 168.91 121.92))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid c72f7200-3451-497e-8edd-a14219d1b134)
)
(wire (pts (xy 123.19 132.08) (xy 140.97 132.08))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid c7db8adf-3d05-416e-8f90-ce9add900935)
)
(wire (pts (xy 184.15 102.87) (xy 184.15 105.41))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid cabc8a3a-9343-4628-80f3-b84ac4a515fd)
)
(wire (pts (xy 140.97 127) (xy 125.73 127))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid cee1ed4e-a053-4e56-ad4a-f0bedff6c9e9)
)
(wire (pts (xy 140.97 116.84) (xy 129.54 116.84))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid cf758c50-061d-443a-a5da-e82229d0ad3e)
)
(wire (pts (xy 166.37 88.9) (xy 168.91 88.9))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid d2cf0bb5-d43f-49b2-84ee-760b00fda0a3)
)
(wire (pts (xy 133.35 83.82) (xy 140.97 83.82))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid f2071bac-7d0a-4aaf-b652-0fb9d8dc04db)
)
(wire (pts (xy 125.73 127) (xy 125.73 88.9))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid f2d64d22-0ba7-4e5d-8132-67b9ef8e45ad)
)
(text "Decoupling" (at 181.61 76.2 90)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 53bbb41a-1c98-4f59-925a-7091705c5b2e)
)
(text "Decoupling" (at 181.61 114.3 90)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 72af2a2b-fe7e-46b4-a8dd-682563695b3c)
)
(label "SPI_MEM.SCK" (at 125.73 76.2 90)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 10669c58-1676-467f-a8b9-e4f609420323)
)
(label "SPI_MEM.MISO" (at 133.35 76.2 90)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 1503c24a-56a9-46e1-903e-caef72cd56b5)
)
(label "SPI_MEM.MOSI" (at 129.54 76.2 90)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 8dcb70d1-0e8f-4d4f-8e75-d63ba0eb7283)
)
(hierarchical_label "SPI_MEM{MISO,MOSI,SCK}" (shape input) (at 101.6 60.96 180)
(effects (font (size 1.27 1.27)) (justify right))
(uuid 1a3b789f-b0ff-415d-be3f-2616c7e31449)
)
(hierarchical_label "BANK_2_~{CS}" (shape input) (at 123.19 132.08 180)
(effects (font (size 1.27 1.27)) (justify right))
(uuid 359abbf2-054f-4436-b577-0d74439eced3)
)
(hierarchical_label "BANK_1_~{CS}" (shape input) (at 123.19 93.98 180)
(effects (font (size 1.27 1.27)) (justify right))
(uuid 7f81a0e1-0950-40d5-9288-69c74d0b5cc1)
)
(symbol (lib_id "power:+3V3") (at 179.07 121.92 270) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 0ab84bb4-fb9e-4037-abb2-05ad3e5a7f68)
(property "Reference" "#PWR0152" (id 0) (at 175.26 121.92 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3V3" (id 1) (at 182.245 122.3538 90)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "" (id 2) (at 179.07 121.92 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 179.07 121.92 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 2f3eb9c3-e92c-4076-adcd-bb03b8b168bd))
)
(symbol (lib_id "power:GND") (at 184.15 113.03 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 0cdc071b-80d3-45e3-b772-b3a3ee7db92e)
(property "Reference" "#PWR0157" (id 0) (at 184.15 119.38 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (id 1) (at 184.15 117.5926 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Footprint" "" (id 2) (at 184.15 113.03 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 184.15 113.03 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid f1f3d503-c692-4751-8c4b-fa767445d80b))
)
(symbol (lib_id "power:GND") (at 153.67 137.16 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 10b5f89e-99c3-46d5-9391-6afd1a310295)
(property "Reference" "#PWR0149" (id 0) (at 153.67 143.51 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (id 1) (at 153.67 141.6034 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Footprint" "" (id 2) (at 153.67 137.16 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 153.67 137.16 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 87c8c607-9307-4315-ae63-34aa772517d2))
)
(symbol (lib_name "MT29F1G01ABAFDSF_1") (lib_id "TCY_memory:MT29F1G01ABAFDSF") (at 153.67 86.36 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 33a53d3b-ff2f-4382-9da7-886c44c6babf)
(property "Reference" "U20" (id 0) (at 155.6894 72.5002 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "MT29F1G01ABAFDSF" (id 1) (at 155.6894 75.0371 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "TCY_IC:DFN-8_8x6mm_P1.27mm" (id 2) (at 153.67 116.84 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "https://www.micron.com/-/media/client/global/documents/products/data-sheet/nand-flash/70-series/m78a_1gb_3v_nand_spi.pdf?rev=7270128474b44126bb737f0f07976723" (id 3) (at 153.67 114.3 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 049500a4-f03d-4889-99f9-7de493410cb0))
(pin "2" (uuid d4985372-2271-4382-ab5f-57123202a983))
(pin "3" (uuid cfd9449d-7074-4682-b3f8-ca7b594c991f))
(pin "4" (uuid b7a814ec-19f0-42dd-b6c0-5a0a09d6da19))
(pin "5" (uuid 44ab5ff6-f9d6-489b-b3f2-180c492c7ccc))
(pin "6" (uuid 1ba23e72-ff83-40ff-810a-00eb6037fec8))
(pin "7" (uuid 21aa46c9-d094-49fb-b1f6-98ed60f97e19))
(pin "8" (uuid b2e33e73-9039-425f-beba-25a1b9f14c52))
)
(symbol (lib_id "Device:C") (at 184.15 109.22 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 37d36d0d-3ceb-4a21-a8dd-7dc60e7ddee0)
(property "Reference" "C37" (id 0) (at 187.0711 108.3115 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "100nF" (id 1) (at 187.0711 111.0866 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "TCY_passives:C_0603_1608Metric" (id 2) (at 185.1152 113.03 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 184.15 109.22 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 1b88e297-b89d-47b2-a512-524e1aa98dae))
(pin "2" (uuid cf86d761-01ac-4ea9-a193-ecc37b6def96))
)
(symbol (lib_id "power:+3.3V") (at 184.15 64.77 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 3ed76fcc-bce1-457f-a5d6-efb42ce04110)
(property "Reference" "#PWR0154" (id 0) (at 184.15 68.58 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3.3V" (id 1) (at 184.15 61.1655 0))
(property "Footprint" "" (id 2) (at 184.15 64.77 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 184.15 64.77 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 49edce68-cca0-473a-9f15-91f28d8ea3ab))
)
(symbol (lib_id "power:+3.3V") (at 184.15 102.87 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 43c7e56d-a203-4b6b-a9d6-6c03f5575d6d)
(property "Reference" "#PWR0156" (id 0) (at 184.15 106.68 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3.3V" (id 1) (at 184.15 99.2655 0))
(property "Footprint" "" (id 2) (at 184.15 102.87 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 184.15 102.87 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid ab420eff-c0a3-4e1f-a28a-e20823670513))
)
(symbol (lib_id "power:GND") (at 184.15 74.93 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 4918732b-1fe9-451f-a468-33950d0821c2)
(property "Reference" "#PWR0155" (id 0) (at 184.15 81.28 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (id 1) (at 184.15 79.4926 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Footprint" "" (id 2) (at 184.15 74.93 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 184.15 74.93 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 471ba557-4d1c-4a07-86cf-86a47b2b85e3))
)
(symbol (lib_id "power:+3V3") (at 153.67 73.66 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 4d21504f-3827-43b3-8eeb-7ad1cd213a20)
(property "Reference" "#PWR0146" (id 0) (at 153.67 77.47 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3V3" (id 1) (at 153.67 70.0842 0))
(property "Footprint" "" (id 2) (at 153.67 73.66 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 153.67 73.66 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 1520224b-19e9-46b3-a85b-4dfb511ada02))
)
(symbol (lib_id "Device:R") (at 172.72 127 90) (unit 1)
(in_bom yes) (on_board yes)
(uuid 504e70ec-15ab-463e-adc4-d377a2d11ac9)
(property "Reference" "R34" (id 0) (at 170.18 124.46 90))
(property "Value" "0R" (id 1) (at 175.26 124.46 90))
(property "Footprint" "TCY_passives:R_0603_1608Metric" (id 2) (at 172.72 128.778 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 172.72 127 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid e48b80b5-7f9c-49e3-b747-9efd3217d314))
(pin "2" (uuid c014afb9-87ea-4242-861a-b3e0590ea68b))
)
(symbol (lib_id "power:+3V3") (at 153.67 111.76 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 71deb0e4-e8a7-4cb3-b7a5-f3eb9ac99e5c)
(property "Reference" "#PWR0148" (id 0) (at 153.67 115.57 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3V3" (id 1) (at 153.67 108.1842 0))
(property "Footprint" "" (id 2) (at 153.67 111.76 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 153.67 111.76 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 70e5fa6f-d198-4932-9e06-2f82e3c627d9))
)
(symbol (lib_id "power:+3V3") (at 179.07 83.82 270) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 73dc1946-7990-44c9-b595-a9540cae5f13)
(property "Reference" "#PWR0150" (id 0) (at 175.26 83.82 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3V3" (id 1) (at 182.245 84.2538 90)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "" (id 2) (at 179.07 83.82 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 179.07 83.82 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 087232cb-fc7d-40fb-9764-c9e4abafc914))
)
(symbol (lib_id "Device:R") (at 172.72 88.9 90) (unit 1)
(in_bom yes) (on_board yes)
(uuid 96f42c2b-3faf-4f52-bb9f-cdc6bbb29d56)
(property "Reference" "R32" (id 0) (at 170.18 86.36 90))
(property "Value" "0R" (id 1) (at 175.26 86.36 90))
(property "Footprint" "TCY_passives:R_0603_1608Metric" (id 2) (at 172.72 90.678 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 172.72 88.9 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 0670e08e-520f-4d32-8352-529e47fe6db9))
(pin "2" (uuid 3318874f-a19f-4ac8-95a3-5cb572fdaab4))
)
(symbol (lib_id "power:+3V3") (at 179.07 88.9 270) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 9b875d9a-bdc9-41a7-a632-fa3cdb8998b9)
(property "Reference" "#PWR0151" (id 0) (at 175.26 88.9 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3V3" (id 1) (at 182.245 89.3338 90)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "" (id 2) (at 179.07 88.9 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 179.07 88.9 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid b89c3b0d-f3b8-4118-b900-e4b450517240))
)
(symbol (lib_id "Device:R") (at 172.72 121.92 90) (unit 1)
(in_bom yes) (on_board yes)
(uuid a45808ca-e5e1-4425-8e91-11a1b8468ecd)
(property "Reference" "R33" (id 0) (at 170.18 119.38 90))
(property "Value" "0R" (id 1) (at 175.26 119.38 90))
(property "Footprint" "TCY_passives:R_0603_1608Metric" (id 2) (at 172.72 123.698 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 172.72 121.92 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid f3b03709-9ae9-4693-8e5c-2d033cc6438d))
(pin "2" (uuid 22c40849-526f-41a8-8491-f80b6ea00a70))
)
(symbol (lib_id "Device:R") (at 172.72 83.82 90) (unit 1)
(in_bom yes) (on_board yes)
(uuid e0b66169-5029-402b-9b16-8ec4f0cff19b)
(property "Reference" "R31" (id 0) (at 170.18 81.28 90))
(property "Value" "0R" (id 1) (at 175.26 81.28 90))
(property "Footprint" "TCY_passives:R_0603_1608Metric" (id 2) (at 172.72 85.598 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 172.72 83.82 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid c859d017-10c1-40ed-93bf-e12b3ef17052))
(pin "2" (uuid 32293d93-b56b-4021-8658-40534f1a6130))
)
(symbol (lib_id "power:+3V3") (at 179.07 127 270) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid e6d7e1bd-4b19-45dd-97c8-dd3d180ade81)
(property "Reference" "#PWR0153" (id 0) (at 175.26 127 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+3V3" (id 1) (at 182.245 127.4338 90)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "" (id 2) (at 179.07 127 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 179.07 127 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid ef666c94-1f02-4b1c-959c-4e9c65899f81))
)
(symbol (lib_id "TCY_memory:MT29F1G01ABAFDSF") (at 153.67 124.46 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid f7d84e3f-f667-4649-b074-3c85ea256b8a)
(property "Reference" "U21" (id 0) (at 155.6894 110.6002 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "MT29F1G01ABAFDSF" (id 1) (at 155.6894 113.1371 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "TCY_IC:DFN-8_8x6mm_P1.27mm" (id 2) (at 153.67 154.94 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "https://www.micron.com/-/media/client/global/documents/products/data-sheet/nand-flash/70-series/m78a_1gb_3v_nand_spi.pdf?rev=7270128474b44126bb737f0f07976723" (id 3) (at 153.67 152.4 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid e753b840-67f3-489e-9f9e-9f24a613e978))
(pin "2" (uuid c00c3d16-ff1b-4667-8c1a-e89564548068))
(pin "3" (uuid c1a5108b-f59e-4cb8-bdc5-c79b8f1be77b))
(pin "4" (uuid f18d308d-be58-4128-890c-3df0044b44fa))
(pin "5" (uuid 67e65f34-630f-4ece-8177-851864edb272))
(pin "6" (uuid 6f8a0e94-501d-4fdf-8e73-cfcb70c37432))
(pin "7" (uuid 52c52128-60ce-4bdd-a458-759388b98e0f))
(pin "8" (uuid 8a6f90f7-1fba-4c82-8672-2a1150026469))
)
(symbol (lib_id "power:GND") (at 153.67 99.06 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid f7ded48a-3462-4eed-9700-a9900ab3fb3b)
(property "Reference" "#PWR0147" (id 0) (at 153.67 105.41 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (id 1) (at 153.67 103.5034 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Footprint" "" (id 2) (at 153.67 99.06 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (id 3) (at 153.67 99.06 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 8e1420c9-3be0-4faf-b09b-0ae88e1e1d10))
)
(symbol (lib_id "Device:C") (at 184.15 71.12 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid ff7520c4-64bd-4f84-9461-bde3e199c7fe)
(property "Reference" "C36" (id 0) (at 187.0711 70.2115 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "100nF" (id 1) (at 187.0711 72.9866 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "TCY_passives:C_0603_1608Metric" (id 2) (at 185.1152 74.93 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 184.15 71.12 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid adbd4734-30c7-4b53-a21a-efcd65b6f6b3))
(pin "2" (uuid 4730dbc3-3b5e-4c61-994f-a147f57c1af8))
)
)

1204
modules/FC/IMU.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
(kicad_sch (version 20211123) (generator eeschema)
(uuid 2545c40d-c5a0-44b7-87db-18f60adb5bad)
(paper "A4")
(lib_symbols
)
)

4990
modules/FC/MCU.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

1060
modules/FC/Memory.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

1691
modules/FC/Power.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

10
modules/FC/RAM.kicad_sch Normal file
View File

@ -0,0 +1,10 @@
(kicad_sch (version 20211123) (generator eeschema)
(uuid 2545c40d-c5a0-44b7-87db-18f60adb5bad)
(paper "A4")
(lib_symbols
)
)

View File

@ -0,0 +1,10 @@
(kicad_sch (version 20211123) (generator eeschema)
(uuid 2545c40d-c5a0-44b7-87db-18f60adb5bad)
(paper "A4")
(lib_symbols
)
)

File diff suppressed because one or more lines are too long

1
modules/FC/fp-info-cache Normal file
View File

@ -0,0 +1 @@
0

1
modules/FC/fw/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build/

42
modules/FC/fw/.mxproject Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,129 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.h
* @brief : Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
* Copyright (c) 2023 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32l4xx_hal.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
/* USER CODE END ET */
/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
/* USER CODE END EC */
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
/* USER CODE END EM */
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/
#define WDG_RESET_Pin GPIO_PIN_13
#define WDG_RESET_GPIO_Port GPIOC
#define LSE_Pin GPIO_PIN_14
#define LSE_GPIO_Port GPIOC
#define I2C_MUX_2_Pin GPIO_PIN_15
#define I2C_MUX_2_GPIO_Port GPIOC
#define HSE_Pin GPIO_PIN_0
#define HSE_GPIO_Port GPIOH
#define I2C_MUX_1_Pin GPIO_PIN_1
#define I2C_MUX_1_GPIO_Port GPIOH
#define EEPROM_CS_Pin GPIO_PIN_0
#define EEPROM_CS_GPIO_Port GPIOA
#define MRAM_CS_Pin GPIO_PIN_1
#define MRAM_CS_GPIO_Port GPIOA
#define FRAM_CS_Pin GPIO_PIN_2
#define FRAM_CS_GPIO_Port GPIOA
#define I2C_FAULT_Pin GPIO_PIN_3
#define I2C_FAULT_GPIO_Port GPIOA
#define CAMERA_EN_Pin GPIO_PIN_4
#define CAMERA_EN_GPIO_Port GPIOA
#define SPI_PER_SCK_Pin GPIO_PIN_5
#define SPI_PER_SCK_GPIO_Port GPIOA
#define SPI_PER_MISO_Pin GPIO_PIN_6
#define SPI_PER_MISO_GPIO_Port GPIOA
#define SPI_PER_MOSI_Pin GPIO_PIN_7
#define SPI_PER_MOSI_GPIO_Port GPIOA
#define CAMERA_CS_Pin GPIO_PIN_0
#define CAMERA_CS_GPIO_Port GPIOB
#define RS_485_T_EN_Pin GPIO_PIN_1
#define RS_485_T_EN_GPIO_Port GPIOB
#define RS_485_R_EN_Pin GPIO_PIN_2
#define RS_485_R_EN_GPIO_Port GPIOB
#define UART_RS_485_R_Pin GPIO_PIN_10
#define UART_RS_485_R_GPIO_Port GPIOB
#define UART_RS_485_T_Pin GPIO_PIN_11
#define UART_RS_485_T_GPIO_Port GPIOB
#define CAN1_RS_Pin GPIO_PIN_14
#define CAN1_RS_GPIO_Port GPIOB
#define LED1_Pin GPIO_PIN_15
#define LED1_GPIO_Port GPIOB
#define LED2_Pin GPIO_PIN_8
#define LED2_GPIO_Port GPIOA
#define UART_DBG_Pin GPIO_PIN_9
#define UART_DBG_GPIO_Port GPIOA
#define UART_DBGA10_Pin GPIO_PIN_10
#define UART_DBGA10_GPIO_Port GPIOA
#define GYRO_ACC_CS_Pin GPIO_PIN_15
#define GYRO_ACC_CS_GPIO_Port GPIOA
#define SPI_MEM_SCK_Pin GPIO_PIN_3
#define SPI_MEM_SCK_GPIO_Port GPIOB
#define SPI_MEM_MISO_Pin GPIO_PIN_4
#define SPI_MEM_MISO_GPIO_Port GPIOB
#define SPI_MEM_MOSI_Pin GPIO_PIN_5
#define SPI_MEM_MOSI_GPIO_Port GPIOB
#define BANK_1_CS_Pin GPIO_PIN_6
#define BANK_1_CS_GPIO_Port GPIOB
#define BANK_2_CS_Pin GPIO_PIN_7
#define BANK_2_CS_GPIO_Port GPIOB
#define MAGNETO_CS_Pin GPIO_PIN_3
#define MAGNETO_CS_GPIO_Port GPIOH
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */

View File

@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file stm32l4xx_hal_conf.h * @file stm32l4xx_hal_conf.h
@ -8,16 +9,16 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics. * Copyright (c) 2017 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/ /* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32L4xx_HAL_CONF_H #ifndef STM32L4xx_HAL_CONF_H
@ -62,7 +63,7 @@
/*#define HAL_OPAMP_MODULE_ENABLED */ /*#define HAL_OPAMP_MODULE_ENABLED */
/*#define HAL_OSPI_MODULE_ENABLED */ /*#define HAL_OSPI_MODULE_ENABLED */
/*#define HAL_OSPI_MODULE_ENABLED */ /*#define HAL_OSPI_MODULE_ENABLED */
/*#define HAL_PCD_MODULE_ENABLED */ #define HAL_PCD_MODULE_ENABLED
/*#define HAL_PKA_MODULE_ENABLED */ /*#define HAL_PKA_MODULE_ENABLED */
/*#define HAL_QSPI_MODULE_ENABLED */ /*#define HAL_QSPI_MODULE_ENABLED */
/*#define HAL_QSPI_MODULE_ENABLED */ /*#define HAL_QSPI_MODULE_ENABLED */
@ -479,5 +480,3 @@
#endif #endif
#endif /* STM32L4xx_HAL_CONF_H */ #endif /* STM32L4xx_HAL_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -6,13 +6,12 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics. * Copyright (c) 2023 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause
* *
****************************************************************************** ******************************************************************************
*/ */
@ -56,6 +55,7 @@ void SVC_Handler(void);
void DebugMon_Handler(void); void DebugMon_Handler(void);
void PendSV_Handler(void); void PendSV_Handler(void);
void SysTick_Handler(void); void SysTick_Handler(void);
void USB_IRQHandler(void);
/* USER CODE BEGIN EFP */ /* USER CODE BEGIN EFP */
/* USER CODE END EFP */ /* USER CODE END EFP */
@ -65,5 +65,3 @@ void SysTick_Handler(void);
#endif #endif
#endif /* __STM32L4xx_IT_H */ #endif /* __STM32L4xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -6,19 +6,19 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics. * Copyright (c) 2023 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */ /* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "main.h" #include "main.h"
#include "usb_device.h"
/* Private includes ----------------------------------------------------------*/ /* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */ /* USER CODE BEGIN Includes */
@ -42,9 +42,13 @@
/* Private variables ---------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
CAN_HandleTypeDef hcan1; CAN_HandleTypeDef hcan1;
I2C_HandleTypeDef hi2c1;
SPI_HandleTypeDef hspi1; SPI_HandleTypeDef hspi1;
SPI_HandleTypeDef hspi3;
UART_HandleTypeDef huart1; UART_HandleTypeDef huart1;
UART_HandleTypeDef huart3;
/* USER CODE BEGIN PV */ /* USER CODE BEGIN PV */
@ -54,8 +58,11 @@ UART_HandleTypeDef huart1;
void SystemClock_Config(void); void SystemClock_Config(void);
static void MX_GPIO_Init(void); static void MX_GPIO_Init(void);
static void MX_CAN1_Init(void); static void MX_CAN1_Init(void);
static void MX_I2C1_Init(void);
static void MX_SPI1_Init(void); static void MX_SPI1_Init(void);
static void MX_SPI3_Init(void);
static void MX_USART1_UART_Init(void); static void MX_USART1_UART_Init(void);
static void MX_USART3_UART_Init(void);
/* USER CODE BEGIN PFP */ /* USER CODE BEGIN PFP */
/* USER CODE END PFP */ /* USER CODE END PFP */
@ -94,8 +101,12 @@ int main(void)
/* Initialize all configured peripherals */ /* Initialize all configured peripherals */
MX_GPIO_Init(); MX_GPIO_Init();
MX_CAN1_Init(); MX_CAN1_Init();
MX_I2C1_Init();
MX_SPI1_Init(); MX_SPI1_Init();
MX_SPI3_Init();
MX_USART1_UART_Init(); MX_USART1_UART_Init();
MX_USART3_UART_Init();
MX_USB_DEVICE_Init();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
/* USER CODE END 2 */ /* USER CODE END 2 */
@ -105,7 +116,12 @@ int main(void)
while (1) while (1)
{ {
/* USER CODE END WHILE */ /* USER CODE END WHILE */
HAL_Delay(500);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET);
HAL_Delay(500);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET);
/* USER CODE BEGIN 3 */ /* USER CODE BEGIN 3 */
} }
/* USER CODE END 3 */ /* USER CODE END 3 */
@ -119,18 +135,26 @@ void SystemClock_Config(void)
{ {
RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
/** Configure the main internal regulator output voltage
*/
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK)
{
Error_Handler();
}
/** Initializes the RCC Oscillators according to the specified parameters /** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure. * in the RCC_OscInitTypeDef structure.
*/ */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE|RCC_OSCILLATORTYPE_MSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.LSEState = RCC_LSE_BYPASS;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; RCC_OscInitStruct.MSIState = RCC_MSI_ON;
RCC_OscInitStruct.MSICalibrationValue = 0;
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
RCC_OscInitStruct.PLL.PLLM = 1; RCC_OscInitStruct.PLL.PLLM = 1;
RCC_OscInitStruct.PLL.PLLN = 10; RCC_OscInitStruct.PLL.PLLN = 40;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7;
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
@ -138,6 +162,7 @@ void SystemClock_Config(void)
{ {
Error_Handler(); Error_Handler();
} }
/** Initializes the CPU, AHB and APB buses clocks /** Initializes the CPU, AHB and APB buses clocks
*/ */
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
@ -151,18 +176,10 @@ void SystemClock_Config(void)
{ {
Error_Handler(); Error_Handler();
} }
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART1;
PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2; /** Enable MSI Auto calibration
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}
/** Configure the main internal regulator output voltage
*/ */
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK) HAL_RCCEx_EnableMSIPLLMode();
{
Error_Handler();
}
} }
/** /**
@ -181,7 +198,7 @@ static void MX_CAN1_Init(void)
/* USER CODE END CAN1_Init 1 */ /* USER CODE END CAN1_Init 1 */
hcan1.Instance = CAN1; hcan1.Instance = CAN1;
hcan1.Init.Prescaler = 32; hcan1.Init.Prescaler = 80;
hcan1.Init.Mode = CAN_MODE_NORMAL; hcan1.Init.Mode = CAN_MODE_NORMAL;
hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ; hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
hcan1.Init.TimeSeg1 = CAN_BS1_1TQ; hcan1.Init.TimeSeg1 = CAN_BS1_1TQ;
@ -202,6 +219,54 @@ static void MX_CAN1_Init(void)
} }
/**
* @brief I2C1 Initialization Function
* @param None
* @retval None
*/
static void MX_I2C1_Init(void)
{
/* USER CODE BEGIN I2C1_Init 0 */
/* USER CODE END I2C1_Init 0 */
/* USER CODE BEGIN I2C1_Init 1 */
/* USER CODE END I2C1_Init 1 */
hi2c1.Instance = I2C1;
hi2c1.Init.Timing = 0x10909CEC;
hi2c1.Init.OwnAddress1 = 0;
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c1.Init.OwnAddress2 = 0;
hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
if (HAL_I2C_Init(&hi2c1) != HAL_OK)
{
Error_Handler();
}
/** Configure Analogue filter
*/
if (HAL_I2CEx_ConfigAnalogFilter(&hi2c1, I2C_ANALOGFILTER_ENABLE) != HAL_OK)
{
Error_Handler();
}
/** Configure Digital filter
*/
if (HAL_I2CEx_ConfigDigitalFilter(&hi2c1, 0) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN I2C1_Init 2 */
/* USER CODE END I2C1_Init 2 */
}
/** /**
* @brief SPI1 Initialization Function * @brief SPI1 Initialization Function
* @param None * @param None
@ -242,6 +307,46 @@ static void MX_SPI1_Init(void)
} }
/**
* @brief SPI3 Initialization Function
* @param None
* @retval None
*/
static void MX_SPI3_Init(void)
{
/* USER CODE BEGIN SPI3_Init 0 */
/* USER CODE END SPI3_Init 0 */
/* USER CODE BEGIN SPI3_Init 1 */
/* USER CODE END SPI3_Init 1 */
/* SPI3 parameter configuration*/
hspi3.Instance = SPI3;
hspi3.Init.Mode = SPI_MODE_MASTER;
hspi3.Init.Direction = SPI_DIRECTION_2LINES;
hspi3.Init.DataSize = SPI_DATASIZE_4BIT;
hspi3.Init.CLKPolarity = SPI_POLARITY_LOW;
hspi3.Init.CLKPhase = SPI_PHASE_1EDGE;
hspi3.Init.NSS = SPI_NSS_SOFT;
hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi3.Init.TIMode = SPI_TIMODE_DISABLE;
hspi3.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi3.Init.CRCPolynomial = 7;
hspi3.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;
hspi3.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
if (HAL_SPI_Init(&hspi3) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN SPI3_Init 2 */
/* USER CODE END SPI3_Init 2 */
}
/** /**
* @brief USART1 Initialization Function * @brief USART1 Initialization Function
* @param None * @param None
@ -277,6 +382,41 @@ static void MX_USART1_UART_Init(void)
} }
/**
* @brief USART3 Initialization Function
* @param None
* @retval None
*/
static void MX_USART3_UART_Init(void)
{
/* USER CODE BEGIN USART3_Init 0 */
/* USER CODE END USART3_Init 0 */
/* USER CODE BEGIN USART3_Init 1 */
/* USER CODE END USART3_Init 1 */
huart3.Instance = USART3;
huart3.Init.BaudRate = 115200;
huart3.Init.WordLength = UART_WORDLENGTH_8B;
huart3.Init.StopBits = UART_STOPBITS_1;
huart3.Init.Parity = UART_PARITY_NONE;
huart3.Init.Mode = UART_MODE_TX_RX;
huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart3.Init.OverSampling = UART_OVERSAMPLING_16;
huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&huart3) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN USART3_Init 2 */
/* USER CODE END USART3_Init 2 */
}
/** /**
* @brief GPIO Initialization Function * @brief GPIO Initialization Function
* @param None * @param None
@ -284,12 +424,66 @@ static void MX_USART1_UART_Init(void)
*/ */
static void MX_GPIO_Init(void) static void MX_GPIO_Init(void)
{ {
GPIO_InitTypeDef GPIO_InitStruct = {0};
/* GPIO Ports Clock Enable */ /* GPIO Ports Clock Enable */
__HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOH_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOC, WDG_RESET_Pin|I2C_MUX_2_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOH, I2C_MUX_1_Pin|MAGNETO_CS_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, EEPROM_CS_Pin|MRAM_CS_Pin|FRAM_CS_Pin|CAMERA_EN_Pin
|LED2_Pin|GYRO_ACC_CS_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOB, CAMERA_CS_Pin|RS_485_T_EN_Pin|RS_485_R_EN_Pin|CAN1_RS_Pin
|LED1_Pin|BANK_1_CS_Pin|BANK_2_CS_Pin, GPIO_PIN_RESET);
/*Configure GPIO pins : WDG_RESET_Pin I2C_MUX_2_Pin */
GPIO_InitStruct.Pin = WDG_RESET_Pin|I2C_MUX_2_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
/*Configure GPIO pins : I2C_MUX_1_Pin MAGNETO_CS_Pin */
GPIO_InitStruct.Pin = I2C_MUX_1_Pin|MAGNETO_CS_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
/*Configure GPIO pins : EEPROM_CS_Pin MRAM_CS_Pin FRAM_CS_Pin CAMERA_EN_Pin
LED2_Pin GYRO_ACC_CS_Pin */
GPIO_InitStruct.Pin = EEPROM_CS_Pin|MRAM_CS_Pin|FRAM_CS_Pin|CAMERA_EN_Pin
|LED2_Pin|GYRO_ACC_CS_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pin : I2C_FAULT_Pin */
GPIO_InitStruct.Pin = I2C_FAULT_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(I2C_FAULT_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : CAMERA_CS_Pin RS_485_T_EN_Pin RS_485_R_EN_Pin CAN1_RS_Pin
LED1_Pin BANK_1_CS_Pin BANK_2_CS_Pin */
GPIO_InitStruct.Pin = CAMERA_CS_Pin|RS_485_T_EN_Pin|RS_485_R_EN_Pin|CAN1_RS_Pin
|LED1_Pin|BANK_1_CS_Pin|BANK_2_CS_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
} }
/* USER CODE BEGIN 4 */ /* USER CODE BEGIN 4 */
@ -327,5 +521,3 @@ void assert_failed(uint8_t *file, uint32_t line)
/* USER CODE END 6 */ /* USER CODE END 6 */
} }
#endif /* USE_FULL_ASSERT */ #endif /* USE_FULL_ASSERT */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -0,0 +1,462 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32l4xx_hal_msp.c
* @brief This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
* @attention
*
* Copyright (c) 2023 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN TD */
/* USER CODE END TD */
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN Define */
/* USER CODE END Define */
/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN Macro */
/* USER CODE END Macro */
/* Private variables ---------------------------------------------------------*/
/* USER CODE BEGIN PV */
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* External functions --------------------------------------------------------*/
/* USER CODE BEGIN ExternalFunctions */
/* USER CODE END ExternalFunctions */
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/**
* Initializes the Global MSP.
*/
void HAL_MspInit(void)
{
/* USER CODE BEGIN MspInit 0 */
/* USER CODE END MspInit 0 */
__HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_RCC_PWR_CLK_ENABLE();
/* System interrupt init*/
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
}
/**
* @brief CAN MSP Initialization
* This function configures the hardware resources used in this example
* @param hcan: CAN handle pointer
* @retval None
*/
void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hcan->Instance==CAN1)
{
/* USER CODE BEGIN CAN1_MspInit 0 */
/* USER CODE END CAN1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_CAN1_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/**CAN1 GPIO Configuration
PB12 ------> CAN1_RX
PB13 ------> CAN1_TX
*/
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF10_CAN1;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* USER CODE BEGIN CAN1_MspInit 1 */
/* USER CODE END CAN1_MspInit 1 */
}
}
/**
* @brief CAN MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hcan: CAN handle pointer
* @retval None
*/
void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan)
{
if(hcan->Instance==CAN1)
{
/* USER CODE BEGIN CAN1_MspDeInit 0 */
/* USER CODE END CAN1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_CAN1_CLK_DISABLE();
/**CAN1 GPIO Configuration
PB12 ------> CAN1_RX
PB13 ------> CAN1_TX
*/
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_12|GPIO_PIN_13);
/* USER CODE BEGIN CAN1_MspDeInit 1 */
/* USER CODE END CAN1_MspDeInit 1 */
}
}
/**
* @brief I2C MSP Initialization
* This function configures the hardware resources used in this example
* @param hi2c: I2C handle pointer
* @retval None
*/
void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
if(hi2c->Instance==I2C1)
{
/* USER CODE BEGIN I2C1_MspInit 0 */
/* USER CODE END I2C1_MspInit 0 */
/** Initializes the peripherals clock
*/
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_I2C1;
PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_PCLK1;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}
__HAL_RCC_GPIOB_CLK_ENABLE();
/**I2C1 GPIO Configuration
PB8 ------> I2C1_SCL
PB9 ------> I2C1_SDA
*/
GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* Peripheral clock enable */
__HAL_RCC_I2C1_CLK_ENABLE();
/* USER CODE BEGIN I2C1_MspInit 1 */
/* USER CODE END I2C1_MspInit 1 */
}
}
/**
* @brief I2C MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hi2c: I2C handle pointer
* @retval None
*/
void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c)
{
if(hi2c->Instance==I2C1)
{
/* USER CODE BEGIN I2C1_MspDeInit 0 */
/* USER CODE END I2C1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_I2C1_CLK_DISABLE();
/**I2C1 GPIO Configuration
PB8 ------> I2C1_SCL
PB9 ------> I2C1_SDA
*/
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_8);
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_9);
/* USER CODE BEGIN I2C1_MspDeInit 1 */
/* USER CODE END I2C1_MspDeInit 1 */
}
}
/**
* @brief SPI MSP Initialization
* This function configures the hardware resources used in this example
* @param hspi: SPI handle pointer
* @retval None
*/
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hspi->Instance==SPI1)
{
/* USER CODE BEGIN SPI1_MspInit 0 */
/* USER CODE END SPI1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_SPI1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
/**SPI1 GPIO Configuration
PA5 ------> SPI1_SCK
PA6 ------> SPI1_MISO
PA7 ------> SPI1_MOSI
*/
GPIO_InitStruct.Pin = SPI_PER_SCK_Pin|SPI_PER_MISO_Pin|SPI_PER_MOSI_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* USER CODE BEGIN SPI1_MspInit 1 */
/* USER CODE END SPI1_MspInit 1 */
}
else if(hspi->Instance==SPI3)
{
/* USER CODE BEGIN SPI3_MspInit 0 */
/* USER CODE END SPI3_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_SPI3_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/**SPI3 GPIO Configuration
PB3 (JTDO/TRACESWO) ------> SPI3_SCK
PB4 (NJTRST) ------> SPI3_MISO
PB5 ------> SPI3_MOSI
*/
GPIO_InitStruct.Pin = SPI_MEM_SCK_Pin|SPI_MEM_MISO_Pin|SPI_MEM_MOSI_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF6_SPI3;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* USER CODE BEGIN SPI3_MspInit 1 */
/* USER CODE END SPI3_MspInit 1 */
}
}
/**
* @brief SPI MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hspi: SPI handle pointer
* @retval None
*/
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
{
if(hspi->Instance==SPI1)
{
/* USER CODE BEGIN SPI1_MspDeInit 0 */
/* USER CODE END SPI1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_SPI1_CLK_DISABLE();
/**SPI1 GPIO Configuration
PA5 ------> SPI1_SCK
PA6 ------> SPI1_MISO
PA7 ------> SPI1_MOSI
*/
HAL_GPIO_DeInit(GPIOA, SPI_PER_SCK_Pin|SPI_PER_MISO_Pin|SPI_PER_MOSI_Pin);
/* USER CODE BEGIN SPI1_MspDeInit 1 */
/* USER CODE END SPI1_MspDeInit 1 */
}
else if(hspi->Instance==SPI3)
{
/* USER CODE BEGIN SPI3_MspDeInit 0 */
/* USER CODE END SPI3_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_SPI3_CLK_DISABLE();
/**SPI3 GPIO Configuration
PB3 (JTDO/TRACESWO) ------> SPI3_SCK
PB4 (NJTRST) ------> SPI3_MISO
PB5 ------> SPI3_MOSI
*/
HAL_GPIO_DeInit(GPIOB, SPI_MEM_SCK_Pin|SPI_MEM_MISO_Pin|SPI_MEM_MOSI_Pin);
/* USER CODE BEGIN SPI3_MspDeInit 1 */
/* USER CODE END SPI3_MspDeInit 1 */
}
}
/**
* @brief UART MSP Initialization
* This function configures the hardware resources used in this example
* @param huart: UART handle pointer
* @retval None
*/
void HAL_UART_MspInit(UART_HandleTypeDef* huart)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
if(huart->Instance==USART1)
{
/* USER CODE BEGIN USART1_MspInit 0 */
/* USER CODE END USART1_MspInit 0 */
/** Initializes the peripherals clock
*/
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART1;
PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}
/* Peripheral clock enable */
__HAL_RCC_USART1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
/**USART1 GPIO Configuration
PA9 ------> USART1_TX
PA10 ------> USART1_RX
*/
GPIO_InitStruct.Pin = UART_DBG_Pin|UART_DBGA10_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* USER CODE BEGIN USART1_MspInit 1 */
/* USER CODE END USART1_MspInit 1 */
}
else if(huart->Instance==USART3)
{
/* USER CODE BEGIN USART3_MspInit 0 */
/* USER CODE END USART3_MspInit 0 */
/** Initializes the peripherals clock
*/
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART3;
PeriphClkInit.Usart3ClockSelection = RCC_USART3CLKSOURCE_PCLK1;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}
/* Peripheral clock enable */
__HAL_RCC_USART3_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/**USART3 GPIO Configuration
PB10 ------> USART3_TX
PB11 ------> USART3_RX
*/
GPIO_InitStruct.Pin = UART_RS_485_R_Pin|UART_RS_485_T_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* USER CODE BEGIN USART3_MspInit 1 */
/* USER CODE END USART3_MspInit 1 */
}
}
/**
* @brief UART MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param huart: UART handle pointer
* @retval None
*/
void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
{
if(huart->Instance==USART1)
{
/* USER CODE BEGIN USART1_MspDeInit 0 */
/* USER CODE END USART1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_USART1_CLK_DISABLE();
/**USART1 GPIO Configuration
PA9 ------> USART1_TX
PA10 ------> USART1_RX
*/
HAL_GPIO_DeInit(GPIOA, UART_DBG_Pin|UART_DBGA10_Pin);
/* USER CODE BEGIN USART1_MspDeInit 1 */
/* USER CODE END USART1_MspDeInit 1 */
}
else if(huart->Instance==USART3)
{
/* USER CODE BEGIN USART3_MspDeInit 0 */
/* USER CODE END USART3_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_USART3_CLK_DISABLE();
/**USART3 GPIO Configuration
PB10 ------> USART3_TX
PB11 ------> USART3_RX
*/
HAL_GPIO_DeInit(GPIOB, UART_RS_485_R_Pin|UART_RS_485_T_Pin);
/* USER CODE BEGIN USART3_MspDeInit 1 */
/* USER CODE END USART3_MspDeInit 1 */
}
}
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */

View File

@ -6,13 +6,12 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics. * Copyright (c) 2023 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause
* *
****************************************************************************** ******************************************************************************
*/ */
@ -56,7 +55,7 @@
/* USER CODE END 0 */ /* USER CODE END 0 */
/* External variables --------------------------------------------------------*/ /* External variables --------------------------------------------------------*/
extern PCD_HandleTypeDef hpcd_USB_FS;
/* USER CODE BEGIN EV */ /* USER CODE BEGIN EV */
/* USER CODE END EV */ /* USER CODE END EV */
@ -199,7 +198,20 @@ void SysTick_Handler(void)
/* please refer to the startup file (startup_stm32l4xx.s). */ /* please refer to the startup file (startup_stm32l4xx.s). */
/******************************************************************************/ /******************************************************************************/
/**
* @brief This function handles USB event interrupt through EXTI line 17.
*/
void USB_IRQHandler(void)
{
/* USER CODE BEGIN USB_IRQn 0 */
/* USER CODE END USB_IRQn 0 */
HAL_PCD_IRQHandler(&hpcd_USB_FS);
/* USER CODE BEGIN USB_IRQn 1 */
/* USER CODE END USB_IRQn 1 */
}
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
/* USER CODE END 1 */ /* USER CODE END 1 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

Some files were not shown because too many files have changed in this diff Show More