Skip to content

Commit

Permalink
chore(c0): enable usb
Browse files Browse the repository at this point in the history
Enable the HSI48 for USB (not done thanks CubeMX code generation).
Add GenC0 USB menu.
Moved G0 one in alphabetical order.

Fixes #2582.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
  • Loading branch information
fpistm committed Nov 27, 2024
1 parent f2dc382 commit ae5a515
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
24 changes: 16 additions & 8 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14013,6 +14013,14 @@ Eval.menu.xusb.HS.build.usb_speed=-DUSE_USB_HS
Eval.menu.xusb.HSFS=High Speed in Full Speed mode
Eval.menu.xusb.HSFS.build.usb_speed=-DUSE_USB_HS -DUSE_USB_HS_IN_FS

GenC0.menu.usb.none=None
GenC0.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
GenC0.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC
GenC0.menu.usb.CDC=CDC (no generic 'Serial')
GenC0.menu.usb.CDC.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB
GenC0.menu.usb.HID=HID (keyboard and mouse)
GenC0.menu.usb.HID.build.enable_usb={build.usb_flags} -DUSBD_USE_HID_COMPOSITE

GenF0.menu.usb.none=None
GenF0.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
GenF0.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC
Expand Down Expand Up @@ -14086,6 +14094,14 @@ GenF7.menu.xusb.HS.build.usb_speed=-DUSE_USB_HS
GenF7.menu.xusb.HSFS=High Speed in Full Speed mode
GenF7.menu.xusb.HSFS.build.usb_speed=-DUSE_USB_HS -DUSE_USB_HS_IN_FS

GenG0.menu.usb.none=None
GenG0.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
GenG0.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC
GenG0.menu.usb.CDC=CDC (no generic 'Serial')
GenG0.menu.usb.CDC.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB
GenG0.menu.usb.HID=HID (keyboard and mouse)
GenG0.menu.usb.HID.build.enable_usb={build.usb_flags} -DUSBD_USE_HID_COMPOSITE

GenG4.menu.usb.none=None
GenG4.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
GenG4.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC
Expand All @@ -14099,14 +14115,6 @@ GenG4.menu.xusb.HS.build.usb_speed=-DUSE_USB_HS
GenG4.menu.xusb.HSFS=High Speed in Full Speed mode
GenG4.menu.xusb.HSFS.build.usb_speed=-DUSE_USB_HS -DUSE_USB_HS_IN_FS

GenG0.menu.usb.none=None
GenG0.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
GenG0.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC
GenG0.menu.usb.CDC=CDC (no generic 'Serial')
GenG0.menu.usb.CDC.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB
GenG0.menu.usb.HID=HID (keyboard and mouse)
GenG0.menu.usb.HID.build.enable_usb={build.usb_flags} -DUSBD_USE_HID_COMPOSITE

GenH5.menu.usb.none=None
GenH5.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
GenH5.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC
Expand Down
3 changes: 3 additions & 0 deletions variants/STM32C0xx/C071R(8-B)T/generic_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ WEAK void SystemClock_Config(void)
LL_RCC_HSI_Enable();
while (LL_RCC_HSI_IsReady() != 1) {
}
LL_RCC_HSI48_Enable();
while (LL_RCC_HSI48_IsReady() != 1) {
}

LL_RCC_HSI_SetCalibTrimming(64);
LL_RCC_SetHSIDiv(LL_RCC_HSI_DIV_1);
Expand Down
3 changes: 3 additions & 0 deletions variants/STM32C0xx/C071R(8-B)T/variant_NUCLEO_C071RB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ WEAK void SystemClock_Config(void)
LL_RCC_HSI_Enable();
while (LL_RCC_HSI_IsReady() != 1) {
}
LL_RCC_HSI48_Enable();
while (LL_RCC_HSI48_IsReady() != 1) {
}

LL_RCC_HSI_SetCalibTrimming(64);
LL_RCC_SetHSIDiv(LL_RCC_HSI_DIV_1);
Expand Down

0 comments on commit ae5a515

Please sign in to comment.