-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
arm/tlsr82: ble performance optimize and problems solve. #6334
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RF and system timer interrupt are used for ble. tlsr82_flash.c: 1. BLE will loss packets during flash operation beacause the interrupt is disabled and the operation take too long (especially erasing, about 100ms), so allow RF and system timer interrupt during flash operation; 2. Add sched_lock()/sched_unlock() to avoid the task switch in ble and system timer interrupt; flash_boot_ble.ld: 3. Because of 1, the code executes in RF and system timer interrupt must be in ram to avoid bus error. The sem_post() will be called and const variable g_tasklisttable will be accessed in RF and system timer interrupt handler; 4. To improve the performance, copy some frequently called function to ram as well, such as: sem_take(), sched_lock(), sched_unlock(), some lib functions, some zephyr ble functions and some tinycrypt functions; 5. The RF and system timer interrupt handler will call some libgcc functions, so copy all the libgcc functions to ram exclude _divdi3.o, _udivdi3.o and _umoddi3.o; tlsr82_serial.c 6. Make up_putc() be thread safe, add enter/leave_critical_section() in function uart_send_byte(); tc32_doirq.c 7. Increase the RF and system timer interrupt response priority; Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
pkarashchenko
approved these changes
May 30, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
xiaoxiang781216
approved these changes
May 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
RF and system timer interrupt are used for ble.
tlsr82_flash.c:
is disabled and the operation take too long (especially erasing,
about 100ms), so allow RF and system timer interrupt during flash
operation;
sched_lock()
/sched_unlock()
to avoid the task switch in ble andsystem timer interrupt;
flash_boot_ble.ld:
3. Because of 1, the code executes in RF and system timer interrupt
must be in ram to avoid bus error. The
sem_post()
will be called andconst variable
g_tasklisttable
will be accessed in RF and systemtimer interrupt handler;
4. To improve the performance, copy some frequently called function to
ram as well, such as:
sem_take()
,sched_lock()
,sched_unlock()
,some lib functions, some zephyr ble functions and some tinycrypt
functions;
5. The RF and system timer interrupt handler will call some libgcc
functions, so copy all the libgcc functions to ram exclude _divdi3.o,
_udivdi3.o and _umoddi3.o;
tlsr82_serial.c
6. Make
up_putc()
be thread safe;tc32_doirq.c
7. Increase the RF and system timer interrupt response priority;
Impact
tlsr82 ble
Testing
local test