r2axz / bluepill-serial-monster

USB to 3 Port Serial (UART) adapter firmware for STM32 Blue Pill.
MIT License
323 stars 76 forks source link

Windows compilation #56

Closed Kabron287 closed 2 years ago

Kabron287 commented 2 years ago

All this of course is very good, but is there a way to compile it in Windows, preferable with known instruments: Cube, Keil, IAR...?

Kabron287 commented 2 years ago

Well, I tryed to compile With CubeIDE as MakeFileProject and got sevral errors: usb_descriptors.c:96:27: error: initializer element is not constant .bMaxPacketSize = usb_endpoints[usb_endpoint_address_control].rx_size,

Kabron287 commented 2 years ago

When I changed: // .wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_0_data].tx_size, to .wMaxPacketSize = USB_CONTROL_ENDPOINT_SIZE,

Compilation was success

r2axz commented 2 years ago

Hi,

Thanks for this issue. My bad. I used non-const initializes in a few places in the code. Although recent versions of gcc and clang can live with that, this violates the C standard. Older versions of gcc (which you probably use with you installation of CubeIDE) consider this an error. Anyhow, fixed in #57, please test it should work with CubeIDE now.

As for Keil and IAR, I don't think I care for those at this point.