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
LPC1114: baremetal profile support #12623
Conversation
@toyowata, thank you for your changes. |
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.
@evedon please review
@jamesbeyond can we do something smart about these test cases? I don't want to accumulate list of exceptions like that
All Mbed 2 board should set "target.c_lib": "small" in targets.json instead of And we need to do something about IAR not supporting small library. The new tools will revert to standard library. The issue is what to do with Mbed OS 5 tools. |
I have had tested also a LPC824 with mbed5 bare-metal. This works well, and had also raised an issue about the default_lib, which is actually an indicator that this target needs to be tested with mbed5. But therefore targets.json has to be changed. |
ad71d67
to
dae80ab
Compare
Applied review feedback from @evedon and rebased. |
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.
Minor comment - looks good - thanks!
You need to add ["5"] to "release_versions" in targets.json. |
We will look into addressing this request in the migration guide for Mbed 2 targets. If a target "release_versions" only lists ["2"] then it is an indication that it was not tested with Mbed OS 5.
What change are you proposing for "LPCTarget"? |
I can create a PR, I have added this config section to the LPCTarget, but I think this config should be in "Target", there is already the setting for "console-uart".
Actually, the LPC targets do not know about stdio_uart_tx/rx settings. When it is not used in PinNames.h, it does not break compatibility. |
e0a1414
to
f642a0b
Compare
Done. Pushed commit and rebased to master. |
Which command did you use to run the greentea tests? I was expecting to see some tests skipped (those which are skipped in bare metal mode). |
The command is:
|
CI started |
@toyowata There's an error in the logs: |
@@ -23,6 +23,11 @@ | |||
|
|||
using namespace utest::v1; | |||
|
|||
// TODO HACK, replace with available ram/heap property | |||
#if defined(TARGET_LPC1114) |
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.
This does not seem right. Replace TARGET_LPC1114
by what is preventing the target from running the test.
Do the same everywhere you have prevented a test from running.
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.
@hugueskamba Thanks for your comment. How do you think about this?
#define TEST_BLOCK_SIZE 128
#define TEST_BLOCK_DEVICE_SIZE 32*TEST_BLOCK_SIZE
#define TEST_BLOCK_COUNT 10
#define TEST_ERROR_MASK 16
#if (MBED_RAM_SIZE <= TEST_BLOCK_DEVICE_SIZE)
#error [NOT_SUPPORTED] Insufficient heap for heap block device tests
#endif
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.
I am not sure why this test needs to be excluded for that board.
Here is a question, why do you need to exclude this test for that board?
If the reason is that the size of the block device is greater than the available RAM then it is fine.
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.
Because the LPC1114 RAM size is 4kB which is not suitable to run this test case.
#define TEST_BLOCK_SIZE 128
#define TEST_BLOCK_DEVICE_SIZE 32*TEST_BLOCK_SIZE
(snip)
void test_read_write()
{
uint8_t *dummy = new (std::nothrow) uint8_t[TEST_BLOCK_DEVICE_SIZE];
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.
Because the LPC1114 RAM size is 4kB which is not suitable to run this test case.
Then have that in your pre-processor macro.
fa59351
to
c3614dc
Compare
@hugueskamba I added a commit for some test cases to add memory check for RAM constraint device here, please can you review. |
d104e70
to
8037647
Compare
rebased. @0xc0170 @hugueskamba Any more work to do for this PR? |
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
@@ -28,6 +28,10 @@ using namespace utest::v1; | |||
#define TEST_BLOCK_COUNT 10 | |||
#define TEST_ERROR_MASK 16 | |||
|
|||
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= TEST_BLOCK_DEVICE_SIZE) |
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.
Why is this condition different than the other two files but the comment the same?
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.
Because the heap_block_device
test case allocates memory using TEST_BLOCK_DEVICE_SIZE.
uint8_t *dummy = new (std::nothrow) uint8_t[TEST_BLOCK_DEVICE_SIZE]; |
And other test cases use different symbols.
uint8_t *dummy = new (std::nothrow) uint8_t[BLOCK_COUNT * BLOCK_SIZE]; |
targets/targets.json
Outdated
] | ||
}, | ||
"c_lib": "small", | ||
"supported_application_modes": ["bare-metal"], |
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.
You still haven’t modified this.
df10ab7
to
2f37066
Compare
2f37066
to
58acc4e
Compare
@hugueskamba @0xc0170 |
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.
Approved assuming you successfully ran mbed-os-example-blinky-baremetal
on this target after the latest changes.
@hugueskamba Yes, the |
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
Summary of changes
LPC1114FN28: Flash 32kB, RAM 4kB
This PR add baremetal profile support for LPC1114.
supprorted_c_libs
with small lib in targets.jsonus_ticker_init
(detected by tests-mbed_hal-common_tickers test case)Note that IAR toolchain is not tested, because it does not support small library.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
ARM test result (Arm compiler 6.13)
lpc1114-arm.txt
GCC_ARM test result (GCC compiler 9.2.1)
lpc1114-gcc_arm.txt
Reviewers
@0xc0170 @MarceloSalazar