Skip to content

STM32H723ZGx with empty sketch does not compile #1931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ahmadfarisfs opened this issue Jan 26, 2023 · 1 comment · Fixed by #1932
Closed

STM32H723ZGx with empty sketch does not compile #1931

ahmadfarisfs opened this issue Jan 26, 2023 · 1 comment · Fixed by #1932
Labels
bug 🐛 Something isn't working
Milestone

Comments

@ahmadfarisfs
Copy link

ahmadfarisfs commented Jan 26, 2023

Describe the bug
Compilation error using this configuration:
image
And output:

C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_if.c: In function 'USBD_reenumerate':
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_if.c:159:21: error: 'USBD_USB_INSTANCE' undeclared (first use in this function)
  159 |   USB_DevDisconnect(USBD_USB_INSTANCE);
      |                     ^~~~~~~~~~~~~~~~~
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_if.c:159:21: note: each undeclared identifier is reported only once for each function it appears in
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_conf.c: In function 'USBD_LL_Init':
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_conf.c:494:21: error: 'USB' undeclared (first use in this function)
  494 |   g_hpcd.Instance = USB;
      |                     ^~~
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_conf.c:494:21: note: each undeclared identifier is reported only once for each function it appears in
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_ep_conf.c:38:16: error: 'PMA_EP0_OUT_ADDR' undeclared here (not in a function)
   38 |   {0x00,       PMA_EP0_OUT_ADDR, PCD_SNG_BUF},
      |                ^~~~~~~~~~~~~~~~
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_ep_conf.c:38:34: error: 'PCD_SNG_BUF' undeclared here (not in a function)
   38 |   {0x00,       PMA_EP0_OUT_ADDR, PCD_SNG_BUF},
      |                                  ^~~~~~~~~~~
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_ep_conf.c:39:16: error: 'PMA_EP0_IN_ADDR' undeclared here (not in a function)
   39 |   {0x80,       PMA_EP0_IN_ADDR,  PCD_SNG_BUF},
      |                ^~~~~~~~~~~~~~~
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_ep_conf.c:40:16: error: 'PMA_CDC_OUT_ADDR' undeclared here (not in a function)
   40 |   {CDC_OUT_EP, PMA_CDC_OUT_ADDR, PCD_DBL_BUF},
      |                ^~~~~~~~~~~~~~~~
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_ep_conf.c:40:34: error: 'PCD_DBL_BUF' undeclared here (not in a function)
   40 |   {CDC_OUT_EP, PMA_CDC_OUT_ADDR, PCD_DBL_BUF},
      |                                  ^~~~~~~~~~~
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_ep_conf.c:41:16: error: 'PMA_CDC_IN_ADDR' undeclared here (not in a function)
   41 |   {CDC_IN_EP,  PMA_CDC_IN_ADDR,  PCD_SNG_BUF},
      |                ^~~~~~~~~~~~~~~
C:\Users\FarisFachrurrobbiSil\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\cores\arduino\stm32\usb\usbd_ep_conf.c:42:16: error: 'PMA_CDC_CMD_ADDR' undeclared here (not in a function)
   42 |   {CDC_CMD_EP, PMA_CDC_CMD_ADDR, PCD_SNG_BUF}
      |                ^~~~~~~~~~~~~~~~
exit status 1
Error compiling for board Generic STM32H7 Series.

To Reproduce

  1. Create empty sketch
  2. Choose configuration just like in the image
  3. Compile

Expected behavior
Compilation Success

Desktop Env:

  • OS: Windows
  • Arduino IDE version: 1.8.19
  • STM32 core version: 2.4.0
@fpistm fpistm added the bug 🐛 Something isn't working label Jan 26, 2023
@fpistm fpistm added this to the 2.5.0 milestone Jan 26, 2023
fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this issue Jan 26, 2023
generate an explicit #error

ex: STM32H723ZGTx have only USB_OTG_HS

Fixes stm32duino#1931

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@fpistm
Copy link
Member

fpistm commented Jan 26, 2023

Hi @ahmadfarisfs
thanks for the report.
Issue is the H723 have only USB HS peripheral so you have to select USB High Speed in the menu.
I've made a PR (#1932) to raise an explicit error when it is the case (first time I've met it).
I've also fixed the system core clock config to ensure having a good USB clock configuration.

cparata pushed a commit to cparata/Arduino_Core_STM32 that referenced this issue Jan 31, 2023
generate an explicit #error

ex: STM32H723ZGTx have only USB_OTG_HS

Fixes stm32duino#1931

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants