-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix failure of building non-RTOS for GR-PEACH, GR-LYCHEE and VK-RZ/A1H #11816
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
Thank you very much for the patch. I tested it and confimred that LED1 blinks as expect timming.
#include "mbed.h"
#define WAIT_TIME 500 //msec
DigitalOut led1(LED1);
int main()
{
int cnt = 0;
printf("hello\n");
while (true)
{
printf("cnt = %d\n", cnt++);
led1 = !led1;
thread_sleep_for(WAIT_TIME);
}
}
Can you check? |
@toyowata I will check about this. |
@toyowata It was because mbed-os/platform/source/mbed_retarget.cpp Lines 181 to 188 in 3254ec3
|
It's better to deal with that issue in |
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.
As requested above, serial change
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
for (int uart = 0; uart < SCIF_COUNT; uart++) { | ||
if ((wk_CPGSTBCR4 & (1 << (7 - uart))) == 0) { // Is the power turned on? | ||
if ((SCIF[uart]->SCSCR & 0x00A0) == 0x00A0) { // Is transmission enabled? (TE = 1, TIE = 1) | ||
while ((SCIF[uart]->SCFSR & 0x0040) == 0); // Waits for the transmission to complete (TEND = 1) |
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.
From my thoughts on #11401, I think it's preferable to have hal_deepsleep
return immediately if it sees any serial port is busy - that way we can respond if some interrupt occurs while waiting for the port to drain. (The system will repeatedly call hal_deepsleep
, so the loop occurs at a higher level).
This form might be bad for interrupt latency if the baud rate is low enough for this loop to take significant time.
Something to consider for a future improvement. Conceivably some HAL test might be upset by that "return immediately" behaviour, even though it would make sense in the real sleep code.
This is a theoretical point of view, though - I've not seen any real problem with this form. I guess if we're going into deep sleep we can assume we're not at a point where interrupt latency really matters...
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.
Thank you for your feedback. I'll make another pull request for this.
Moved waiting UART transmission completion to the out of critical section. This is issued by the following pull request. ARMmbed#11816
Moved waiting UART transmission completion to the out of critical section. This is issued by the following pull request. ARMmbed#11816
Description (required)
Summary of change (What the change is for and why)
Fix for issue ARMmbed/mbed-os-example-blinky-baremetal#20
I confirmed that
mbed-os-example-blinky-baremetal
can be built and blinky works properly.The following is the GR-PEACH build log. GR-LYCHEE and VK-RZ / A1H will build successfully as well.
There was no problem when using RTOS (removed
"requires": ["bare-metal"]
inmbed_app.json
).Documentation (Details of any document updates required)
Pull request type (required)
Test results (required)
Reviewers (optional)
@toyowata