Open hanetzer opened 2 years ago
Sounds like a good idea. I need to learn more about the blackpill peripherals and I guess order one, since I don't have any :)
I do own a few, so if you could point out key bits I could perhaps do the code and PR it to ya
That sounds even better :) Not only a great idea, but also a willingness to do the coding. Awesome! Of course I am open to answer any questions. What do you think would be the best way to start? I don't know if you've tried to get familiar with the codebase yet. Do you have any specific questions already? Or maybe we can meet on Zoom sometime and I'll try to show you the project, explain how it works, and what should be ported so that you have an idea on the scope of work.
well, git grep is showing me things. btw, where does stm32f1xx.h come from? its not in the repository.
Hrm. Building it for stm32f1xx gives the following error:
mkdir -p build
arm-none-eabi-gcc -MT build/usb_descriptors.o -MMD -MP -MF build/usb_descriptors.d -DSTM32F103xB -DHSE_VALUE=8000000U -I/home/hanetzer/Firmware/stm32/STM32CubeF1/Drivers/CMSIS/Core/Include -I/home/hanetzer/Firmware/stm32/STM32CubeF1/Drivers/CMSIS/Core_A/Include -I/home/hanetzer/Firmware/stm32/STM32CubeF1/Drivers/CMSIS/Device/ST/STM32F1xx/Include -mthumb -mcpu=cortex-m3 -Wall -O3 -ggdb -DDEVICE_VERSION_MAJOR=latest -c usb_descriptors.c -o build/usb_descriptors.o
In file included from usb_core.h:13,
from usb_descriptors.c:7:
<command-line>: error: ‘latest’ undeclared here (not in a function)
usb_std.h:67:44: note: in definition of macro ‘USB_BCD_VERSION’
67 | #define USB_BCD_VERSION(maj, min, rev) (((maj & 0xFF) << 8) | ((min & 0x0F) << 4) | (rev & 0x0F))
| ^~~
usb_descriptors.c:99:43: note: in expansion of macro ‘DEVICE_VERSION_MAJOR’
99 | .bcdDevice = USB_BCD_VERSION(DEVICE_VERSION_MAJOR, DEVICE_VERSION_MINOR, DEVICE_VERSION_REVISION),
| ^~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:78: build/usb_descriptors.o] Error 1
Ahh. Its a problem with the GIT_VERSION macro or the like. make GIT_VERSION=1
works (well, it builds at least)
Hmm. The code could be refactored in a manner similar to https://github.com/blackmagic-debug/blackmagic and handle the platform specifics in some subdirs.
btw, where does stm32f1xx.h come from?
This comes from CMSIS, I use https://github.com/STMicroelectronics/STM32CubeF1.git, but it looks like you've figured that out already.
Hrm. Building it for stm32f1xx gives the following error:
mkdir -p build ...
That's a bug. I didn't take into account the "latest" case. Will fix that.
Hmm. The code could be refactored in a manner similar to https://github.com/blackmagic-debug/blackmagic and handle the platform specifics in some subdirs.
Well, probably yes. Another possibility is to use ifdefs, which may be easier if we are only interested in two platforms at the moment. However, if someday we need to support more platforms in addition to black/bluepill, it'll come to this anyways.
Its my understanding that the two chips are pretty close together in features and capabilities. Would be fun to extend this to support both, if possible.