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

CUST-CKFLIGHTF4 Custom Design config #431

Merged
merged 7 commits into from
May 22, 2024
Merged

Conversation

ckflight
Copy link
Contributor

@ckflight ckflight commented May 21, 2024

I have created config.h file after completing the CUST-CKFLIGHTF4.config file.
reference: betaflight/unified-targets#1326

However, I do not fully understand the timer mapping and ADC_DMA_OPT line:

B5, B6, B7 and A2 are motor dshot pins which requires timer and dma.
C8 is RGB Led strip pin which requires dshot like protocol so timer and dma is needed as well.
B0 is buzzer pin which requires timer for 4KHz pwm but dma might not be needed (i did not add dma line for this)

# timer
timer B05 AF2
# pin B05: TIM3 CH2 (AF2)
timer B06 AF2
# pin B06: TIM4 CH1 (AF2)
timer B07 AF2
# pin B07: TIM4 CH2 (AF2)
timer A02 AF1
# pin A02: TIM2 CH3 (AF1)
timer C08 AF3
# pin C08: TIM8 CH3 (AF3)
timer B00 AF1
# pin B00: TIM1 CH2N (AF1)

# dma
dma ADC 1 1
# ADC 1: DMA2 Stream 4 Channel 0
dma ADC 2 1
# ADC 2: DMA2 Stream 3 Channel 1

dma pin A02 0
# pin A02: DMA1 Stream 1 Channel 3
dma pin B05 0
# pin B05: DMA1 Stream 5 Channel 5
dma pin B06 0
# pin B06: DMA1 Stream 0 Channel 2
dma pin B07 0
# pin B07: DMA1 Stream 3 Channel 2
dma pin C08 0
# pin C08: DMA2 Stream 2 Channel 0

As a result how should i set timer mapping lines for config.h file. 4th is the same number of dma pin "pin number" "number". 2nd column is the pin numbe and 1st is for indexing. 3rd column is the part i do not understand.

#define TIMER_PIN_MAPPING \
    TIMER_PIN_MAP( 0, PA2, 1,  0) \
    TIMER_PIN_MAP( 1, PB5, 1,  0) \
    TIMER_PIN_MAP( 2, PB6, 1,  0) \
    TIMER_PIN_MAP( 3, PB7, 1,  0) \
    TIMER_PIN_MAP( 4, PC8, 2,  0)

Also Battery and Current adc is available on board how should i set this line:

#define ADC1_DMA_OPT        1

@nerdCopter
Copy link
Member

recommend inspecting some other config.h files.
someone with deeper understanding will have to reply with more specifics, as i do not know all the technicals.

@haslinghuis
Copy link
Member

@haslinghuis
Copy link
Member

make CKFLIGHF4 EXTRA_FLAGS="-DUSE_TIMER_MAP_PRINT"

Copy link
Contributor Author

@ckflight ckflight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is working. I have build for CKFLIGHTF4 and tested on drone. Everything works like a charm :)

ckflight

This comment was marked as duplicate.

@ckflight
Copy link
Contributor Author

Thank you so much for your help, contributions and corrections.

@haslinghuis haslinghuis merged commit 651a162 into betaflight:master May 22, 2024
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.

4 participants