Skip to content

Conversation

@jlpoltrack
Copy link
Collaborator

Title. Now can have reasonable buffers. Few other tidies as well.

@jlpoltrack jlpoltrack changed the title USB Flow Control for STM32 USB Flow Control for STM32 2 Jan 13, 2026
@olliw42
Copy link
Owner

olliw42 commented Jan 14, 2026

do we have evidence that this would work also on other SMT32 than G4?
(I assume you only have tested on G4?)
we had the F072 with usb, could be worth a test

@jlpoltrack
Copy link
Collaborator Author

(I assume you only have tested on G4?)
we had the F072 with usb, could be worth a test

Yes, I only tested on G4. Re: F0 Is this a funny joke :)? I wouldn't be able to anyways as I swapped the MCU on my FRM303 to use STM32F1...

@olliw42
Copy link
Owner

olliw42 commented Jan 15, 2026

ok, so only G4
all this stm lib stuff comes actually from my STorM32 project, so I could test this - at some point in time - for F1 and H7. For now, I guess, we should add a #if def checking for G4 and throwing a warning otherwise.
It's a bit confusing otherwise since in usbd_conf.h we do have ifs for F1 and F0, and thus the lib pretends to work (be tested) for these cases

@jlpoltrack
Copy link
Collaborator Author

all this stm lib stuff comes actually from my STorM32 project, so I could test this - at some point in time - for F1 and H7. For now, I guess, we should add a #if def checking for G4 and throwing a warning otherwise.

Warning added.

@olliw42
Copy link
Owner

olliw42 commented Jan 15, 2026

very nice! many thx.
you've tested that this till works as expected?

@jlpoltrack
Copy link
Collaborator Author

jlpoltrack commented Jan 15, 2026

you've tested that this till works as expected?

Yea, I used your latest DB30 branch to flash ESP32 with these changes. Worked fine flashing at 921600 baud.

RAM usage with this branch, 39 KB:
image

RAM usage previously, 59 KB:
image

Note - you can also cut these buffers back to 2 KB as well:

image

https://github.com/olliw42/mLRS/blob/dev-matek-mtx/mLRS/Common/hal/matek/tx-hal-matek-mtx-db30-g474ce.h#L43-L49

That saves another 12 KB of RAM, so 28 KB used / 32 KB saved.

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.

2 participants