-
Notifications
You must be signed in to change notification settings - Fork 3k
Improve efficiency and formatting of ITM output #7371
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
Conversation
@RobMeades - something for you to test. I don't have any ITM boards handy. |
b88cbca
to
0129895
Compare
Revised a couple of times - now compiles, at least. |
Sweet. Performing
|
I'd be interested to see if you could actually measure a performance boost. Or is the port so fast it doesn't really matter? It may be that it's not really worth the extra code size of doing the 32-bit writes for the block operation. |
Fixed doxygen - no functional change. |
…RMmbed/mbed-os#7371 so that SWD output works _really_ sweetly.
On efficiency, it's possible the C library doesn't end up doing anything more than single-character You could perhaps test theoretical throughtput more directly with some manual |
For pure |
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.
Looks great!
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.
Excited for the changes!
/morph build |
@ARMmbed/mbed-os-maintainers Heads up that this PR adds a new function to HAL. |
Build : SUCCESSBuild number : 2486 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2125 |
Test : SUCCESSBuild number : 2261 |
Sorry - need to correct this. The last commit ca45797 I added was wrong - we do still need the "enabled" checks. Rereading documentation indicates that writing to the stimulus register is safe when disabled, but we will be getting "not ready" indications when we read, causing us to block indefinitely if disabled. Removed that commit, leaving just the commit @RobMeades tested. |
/morph build |
Build : SUCCESSBuild number : 2494 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2138 |
Test : SUCCESSBuild number : 2270 |
Rebase is needed. |
hal/mbed_itm_api.c
Outdated
/* Check if ITM and port is enabled */ | ||
if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ | ||
((ITM->TER & (1UL << port)) != 0UL)) { /* ITM Port enabled */ | ||
{ |
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.
Extra curly brace.
SerialWireOutput was outputting 1 character per 32-bit write to the ITM stimulus port. This is inefficient, and causes processing problems with some viewers due to them receiving 3 NUL bytes between each desired character. Rework to allow us to be more efficient, and eliminate those NUL bytes: * Retain existing mbed_itm_send() and clarify it's a single 32-bit write. * Add new mbed_itm_send_block() that is appropriate for sending character data, and modify SerialWireOutput to use it. * Move "wait for FIFO ready" check to before the write, rather than after. One minor correction - FIFOREADY is a single bit of the register read. Don't interpret reserved bits.
/morph build |
Build : SUCCESSBuild number : 2532 Triggering tests/morph test |
Test : SUCCESSBuild number : 2294 |
Exporter Build : SUCCESSBuild number : 2180 |
Description
SerialWireOutput was outputting 1 character per 32-bit write to the ITM stimulus port. This is inefficient, and causes processing problems with some viewers due to them receiving 3 NUL bytes between each desired character.
Rework to allow us to be more efficient, and eliminate those NUL bytes:
One minor correction - FIFOREADY is a single bit of the register read. Don't interpret reserved bits.
Fixes #7373
Pull request type