-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add WIFI support for RDA target UNO_91H #9501
Conversation
@caixue1102, 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.
Looks fine, just that I would run astyle for implementation files of Mbed OS functionality (like emac port , or wifi interface - RdaWiFiInterface).
+1 for providing licenses for libs
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.
Driver looks OK, but I'm requesting changes for couple of things.
- License header copy&pasted from other files and not updated to reflect this work. Now headers don't reflect the original author of these files, but instead say
Copyright Arm
- Small code style changes requested.
- Usage of
mbed_mac_address()
without providing implementation for it. - Copied LwIP headers without clear explanation of why
- tab used as indentation marker in
targets.json
file.
} | ||
} | ||
} else | ||
find = true; |
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.
Our style guide requires one line if-else clauses to have brackets as well.
find = true; | ||
|
||
if (find == false) { | ||
printf("can not find the ap.\r\n"); |
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.
Use mbed_trace or other loggers.
I don't think using printf()
inside driver is acceptable, as you cannot disable the output from build time.
_blocking); | ||
|
||
if (ret == NSAPI_ERROR_DHCP_FAILURE) | ||
ret = NSAPI_ERROR_CONNECTION_TIMEOUT; |
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 do you translate DHCP_FAILURE to CONNECTION_TIMEOUT?
|
||
|
||
nsapi_error_t RDAWiFiInterface::connect() | ||
{ |
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 don't see the point why this cannot call RDAWiFiInterface::connect(const char *ssid, const char *paswd, nsapi_security_t security, uint8_t channel)
if(sta_state < 2) | ||
return NSAPI_ERROR_NO_CONNECTION; | ||
|
||
init(); |
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 do you call init()
here?
I would have assumed you to call power_down()
or equivalent.
@@ -0,0 +1,135 @@ | |||
/* LWIP implementation of NetworkInterfaceAPI | |||
* Copyright (c) 2019 ARM Limited |
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.
Same here, as previous.. You should not copy&paste the license section.
*/ | ||
|
||
#ifndef __DHCPS_H__ | ||
#define __DHCPS_H__ |
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 this file is copied from LwIP?
|
||
|
||
#ifndef LWIPOPTS_CONF_H | ||
#define LWIPOPTS_CONF_H |
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 this file is copied from LwIP?
|
||
bool RDA5981x_EMAC::get_hwaddr(uint8_t *addr) const | ||
{ | ||
mbed_mac_address((char *)addr); |
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 don't see this function used anywhere else in the driver, are you sure that it actually provides the MAC address that this hardware uses?
If you don't provide implementation of mbed_mac_address()
it gives you pseudo MAC address that is generated in build time.
targets/targets.json
Outdated
"ANALOGIN", | ||
"FLASH", | ||
"TRNG" | ||
"USTICKER", |
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.
Tabulator used as indentation here.. Use spaces as the rest of the file.
Also, I would like to see test results as instructed in https://os.mbed.com/docs/mbed-os/v5.11/porting/wifi-port.html#testing So provide log file from See the Socket test plan what kind of |
3c82a00
to
c0cad4e
Compare
thank you for the suggestions。
|
The test report pasted in the description is runned on the newest TEST case (netsocket and network)with 'mbed test' command , is there anything wrong with my operation? could you please give me some pointers? |
@SeppoTakalo please help to review the new changes, thank you very much~ |
@caixue1102 Sorry, I did not spot the attached log files. Those are fine and look OK. |
{ | ||
#if 1 | ||
return connect(_ssid, _pass, _security, _channel); | ||
#else |
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.
In the future, you might want to remove the dead code from the driver.
When left there, it soon gets outdated, and might be misleading for the next developer who tries to understand this driver.
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 are right, and I have remove the dead code just now.
c0cad4e
to
a55c96c
Compare
} | ||
|
||
} | ||
else |
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.
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.
2 requests, the rest looks fine
- SPDX identifier addition
- fixing coding style in the implementation files (emac/wifiinterface)
@@ -0,0 +1,160 @@ | |||
/* Copyright (c) 2019 Unisoc Communications Inc. | |||
* |
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.
can you add SPDX identifier to new files please?
* SPDX-License-Identifier: Apache-2.0
a55c96c
to
3c6079e
Compare
@0xc0170 @VeijoPesonen Thank you, now coding style is fixed and SPDX identifier is added. |
CI started |
c8c8d92
to
ef6d7e1
Compare
@0xc0170 thank you, this has been modified |
CI restarted |
Test run: FAILEDSummary: 6 of 8 test jobs failed Failed test jobs:
|
Please review build artifacts, there are failures:
|
ef6d7e1
to
88888db
Compare
@0xc0170 Thank you,I have modified target.json and now it can be compiled successfully using -m RDA5981X, I didn't find the failed reason before, because I used -m UNO_91H for all tests in the past.and now using -m RDA5981X can not get a emac.bin. |
CI started |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
targets/targets.json
Outdated
"ANALOGIN", | ||
"FLASH", | ||
"TRNG" | ||
"USTICKER", |
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've noticed this should be aligned as it was previously (4 spaces more to the right) ?
@caixue1102 Please send a new PR fixing the alignment or amend it here, let us know (will start CI) |
88888db
to
d92e33d
Compare
@0xc0170 thank you and it's modified. |
CI started |
Test run: FAILEDSummary: 3 of 8 test jobs failed Failed test jobs:
|
Restarted CI after #9677 |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
Description
Add support wifi for RDA target UNO_91H.
Tested with GCC_ARM, IAR and ARMCC.
Test report here:
RDA_UNO_91H_test_report.zip
Pull request type
Reviewers