Fix channel selection for DMA2 Stream6. #10029
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For TIM1_CH3 the wrong Channel gets selected during timer definition/configuration.
![Screenshot from 2024-05-05 14-09-52](https://private-user-images.githubusercontent.com/29724064/328016276-36e5a769-292e-45f6-aa4e-f7aa43eb0e27.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MDA3MDIsIm5iZiI6MTczOTUwMDQwMiwicGF0aCI6Ii8yOTcyNDA2NC8zMjgwMTYyNzYtMzZlNWE3NjktMjkyZS00NWY2LWFhNGUtZjdhYTQzZWIwZTI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDAyMzMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMwMzkzYmE4MGU5NTkxODZkNzE5Y2Q2OTE0YmZlZTE3ZDNlYmQ4ZTg5NzdkMzcxMDM0Y2RhY2VhNzdmODQ5ZjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JNXylqmm2TmIxbVzKWIDUtgvQZx8EGvGhv-ponbthh4)
Correct is to use Channel6 which is only for TIM1_CH3 instead of the Channel0 which is for TIM1_CH1, TIM1_CH2 and TIM1_CH3.
See also https://github.com/iNavFlight/inav/blob/release_7.1.1/src/main/drivers/timer_def_stm32f4xx.h#L35
and table below
At start up, when only the DSHOT command 0 is send, everything is ok.
![Screenshot from 2024-05-05 14-04-39](https://private-user-images.githubusercontent.com/29724064/328016027-87ec1dbf-0a18-4721-aa61-c145b8f3e85d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MDA3MDIsIm5iZiI6MTczOTUwMDQwMiwicGF0aCI6Ii8yOTcyNDA2NC8zMjgwMTYwMjctODdlYzFkYmYtMGExOC00NzIxLWFhNjEtYzE0NWI4ZjNlODVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDAyMzMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZmMTVkNDExNTE3OTM1YWI4M2Q0OGQ0MDBiYTQzNjM0YjdmMGZlNzFlZGRkNjYyZGU5NzU5NTA3MGFkMmFhMTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NV4czyd9vBw2sO6zctQZwiLFrok2vP4RV09rhqyUtAQ)
But as soon as other commands/values are send then this happens:
Additional Infos:
Tested on Target: FLYWOOF411
But the other controllers (F405 and F722) have the same DMA request mapping.
ESC protocol: DSHOT300