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

F7 optimizations #4263

Merged
merged 23 commits into from
Feb 27, 2019
Merged

F7 optimizations #4263

merged 23 commits into from
Feb 27, 2019

Conversation

DzikuVx
Copy link
Member

@DzikuVx DzikuVx commented Jan 25, 2019

Things that @DieHertz did in betaflight/betaflight#5674 or at least some of them.

So far, after enabling caches, prefetch and ART, load at 8kHz went from 1200% to 900%. Let's say it's a porgress.

As a goal I would like to see 8kHz mode on F7 working.

I'm also considering decoupling some tasks from main loop again but this time without really giving users much options about them

@DzikuVx DzikuVx added this to the Future milestone Jan 25, 2019
@DieHertz
Copy link
Contributor

Main gains came from ensuring critical functions go into fast instruction RAM

@DzikuVx
Copy link
Member Author

DzikuVx commented Jan 25, 2019

@DieHertz yes, this is what I'm expecting. Small steps tho

Copy link
Member

@digitalentity digitalentity left a comment

Choose a reason for hiding this comment

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

Apart from required verification that D-Cache doesn't break DMA - LGTM

src/main/target/stm32f7xx_hal_conf.h Show resolved Hide resolved
@DieHertz
Copy link
Contributor

I recommend placing dma buffers into dTCM ram on F7 to avoid having to think about it

@@ -154,7 +154,7 @@ __IO uint32_t uwTick;
HAL_StatusTypeDef HAL_Init(void)
{
/* Configure Flash prefetch and Instruction cache through ART accelerator */
#if (ART_ACCLERATOR_ENABLE != 0)
#if (ART_ACCLERATOR_ENABLE != 0U)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not necessary, I thought I have removed it to not introduce any changes into lib folder

@teckel12
Copy link
Contributor

👍

@DzikuVx
Copy link
Member Author

DzikuVx commented Feb 2, 2019

image

It still has some space left for speedup, but should be flyable with 8kHz

Todo: RX task, Baro task and maybe OSD

@DzikuVx
Copy link
Member Author

DzikuVx commented Feb 2, 2019

image

@DzikuVx
Copy link
Member Author

DzikuVx commented Feb 3, 2019

Tested LED and DSHOT, both are still working so looks like there is no DMA problems

@digitalentity
Copy link
Member

Cool!

@teckel12
Copy link
Contributor

teckel12 commented Feb 9, 2019

@DzikuVx What's up with your taskbar on the left? Are you some kind of MONSTER? 😉

@DzikuVx
Copy link
Member Author

DzikuVx commented Feb 9, 2019

@teckel12 this is the best place for taskbar on widescreen. It just takes less space than on the bottom

@DzikuVx
Copy link
Member Author

DzikuVx commented Feb 9, 2019

F745 tested on OmnibusF7. Todo:

  • setup all F7 to use ITCM_RAM
  • test F4 and F3 if they are working without any problem
  • flight test with DSHOT

@DzikuVx DzikuVx modified the milestones: Future, 2.2 Feb 13, 2019
@DzikuVx
Copy link
Member Author

DzikuVx commented Feb 16, 2019

By pure coincidence tested on F722-STD with DSHOT600 and 4kHz mode (GPS and mag). All fine

@DzikuVx DzikuVx merged commit cfcfdf0 into development Feb 27, 2019
@DzikuVx DzikuVx deleted the dzikuvx-f7-speedup branch February 27, 2019 12:07
@teckel12
Copy link
Contributor

@DzikuVx Nice work!

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

Successfully merging this pull request may close these issues.

4 participants