Skip to content
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

Small overhaul #1

Merged
merged 3 commits into from
Dec 1, 2021
Merged

Conversation

KarlK90
Copy link
Collaborator

@KarlK90 KarlK90 commented Nov 30, 2021

Hi @bstiq I have made some minor corrections to the schematics, mostly style stuff and added some explanations why things are needed. I have also added the schematics of the OG blackpill under docs. For reference these are the pin mappings that are DMA channel conflict free.

Pin No. Pin Function
11 PA1 TIM2_CH2 (RGB)
14 PA4 SPI1_NSS
15 PA5 SPI1_SCK
16 PA6 SPI1_MISO
17 PA7 SPI1_MOSI
30 PA9 USART1_TX (SERIAL)
32 PA11 USB_OTG_FS_DM
33 PA12 USB_OTG_FS_DP
42 PB6 I2C1_SCL
43 PB7 I2C1_SDA

image

DMA capabilities are needed for the WS2812 RGB LED driver in PWM mode. I have to check if this is also true for SPI and I2C (which is unused).

For reference the DMA channels used in this config:

Event channel / stream
I2C1_RX DMA1 Stream 0 (not needed atm)
I2C1_TX DMA1 Stream 6 (not needed atm)
SPI1_RX DMA2 Stream 0 (needed?)
SPI1_TX DMA2 Stream 3 (needed?)
TIM2_UP DMA1 Stream 1 (needed for WS2812 PWM driver)
USART1_RX DMA2 Stream 2 (not needed QMK uses non-DMA driver)
USART1_TX DMA2 Stream 7 (not needed QMK uses non-DMA driver)

Please note that the update event DMA channel is needed for the TIM2 timmer i.e. TIM2_UP not the channel events like TIM2_CH2.

Support for the SOIC-8 EEPROM is a good thing as QMK currently has no EEPROM emulation for the STM32F4 series.

On the support of Full-duplex, the transfer speed gains differences to Half-duplex are rather minor in practice so I wouldn't bother to much, also the the STM32F4 doesn't support TX/RX pin swapping in hardware so this would have to be done with solder jumpers which is a bit cumbersome.

@KarlK90
Copy link
Collaborator Author

KarlK90 commented Dec 1, 2021

I just pushed another update as I had forgotten that the Serial comms and Split Hand should be pulled up to 3.3V and only the RGB PWM pin has to be pulled up to 5V. I also included the datasheets and reference manuals for the MCUs that are used on the 2 versions of the blackpill. The pinout should be the same nevertheless.

@bstiq bstiq merged commit 77805a1 into Bastardkb:main Dec 1, 2021
@KarlK90 KarlK90 deleted the routing-without-conflicts branch December 1, 2021 10:43
@drashna
Copy link
Collaborator

drashna commented Dec 1, 2021

Support for the SOIC-8 EEPROM is a good thing as QMK currently has no EEPROM emulation for the STM32F4 series.

That should no longer be true. F411 eeprom emulation should have been in develop and merged into master on the 27th.

qmk/qmk_firmware#14195

However, it's a bit of a mess, in the flash layout. So an SPI EEPROM chip is absolutely the way to go, here. Even with wear leveling in the fake eeprom, 4m writes vs 10-40k ....

DMA2 Stream 0 (needed?)

For the SPI stuff, yes, it's needed.

Also, I did need the DMA stream for full duplex serial.

@KarlK90
Copy link
Collaborator Author

KarlK90 commented Dec 2, 2021

Support for the SOIC-8 EEPROM is a good thing as QMK currently has no EEPROM emulation for the STM32F4 series.

That should no longer be true. F411 eeprom emulation should have been in develop and merged into master on the 27th.

qmk/qmk_firmware#14195

However, it's a bit of a mess, in the flash layout. So an SPI EEPROM chip is absolutely the way to go, here. Even with wear leveling in the fake eeprom, 4m writes vs 10-40k ....

Cool! Didn't follow that to closely.

DMA2 Stream 0 (needed?)

For the SPI stuff, yes, it's needed.

That is good to know, thanks! I'll add a readme to the repo.

Also, I did need the DMA stream for full duplex serial.

I know, but not anymore since qmk/qmk_firmware#13081 when I converted the full duplex back to the Chibios Serial driver.

@drashna
Copy link
Collaborator

drashna commented Dec 2, 2021

I know, but not anymore since qmk/qmk_firmware#13081 when I converted the full duplex back to the Chibios Serial driver.

Even with that change, I had issues gettng it working on my blackpill till the dma channels were moved. But that may not have been the case, as there was a list of conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants