Skip to content

Update ODIN drivers to v3.0.0 RC1 #7579

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

Merged
merged 1 commit into from
Sep 3, 2018

Conversation

asifrizwanubx
Copy link
Contributor

Description

This release contains the following new features.

  • Access Point functionality
  • Bridge functionality
  • Robustness

This release contains the following fixes.

Known limitations

  • Only possible to use either Wi-Fi AP or Wi-Fi Station

Test Results

The following tests have been performed

  • mbed-os test for GCC_ARM, ARM and IAR
  • mbed-os WiFi tests (target for Robustness)

iar_network_wifi_logs.txt
arm_mbed_logs.txt
arm_network_wifi_logs.txt
gcc_mbed_logs.txt
gcc_network_wifi_logs.txt
iar_mbed_logs.txt

Other

  • To enable the bridge add the below macro and increase the lwIP pbuf pool size in mbed_app.json, for example:
    "macros": ["MBED_EMAC_LWIP_L2_BRIDGE=1"],
    "lwip-pbuf-pool-size":
    { "help": "Number of pbuf pool buffers", "value": "80" }
  • To enable the AP add the below macro in mbed_app.json, for example:
    "macros": ["DEVICE_WIFI_AP=1"],

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[x] Feature
[ ] Breaking change

@mlubinsky
Copy link

How to get this patch #7579
into my project, which is a fork of
https://github.com/armmbed/ref-wem-firmware
?
I am using mbed-cli. I need to test it ASAP.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 24, 2018

@mlubinsky Fetch this via remote. One of the approaches could be

git checkout -b u-blox-ublox_odin_driver_os_5_v3.0.0_rc1 master
git pull https://github.com/u-blox/mbed-os.git ublox_odin_driver_os_5_v3.0.0_rc1

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 25, 2018

I can see now why this was marked as feature. First two commits : one is fixing tests, another one is adding new feature. I believe this 2 shall be sent separately (odin update driver would depend on them).

Can you split this PR please

@asifrizwanubx
Copy link
Contributor Author

revert the changes related to wifi tests, will be push in a seperate PR. @0xc0170

@asifrizwanubx
Copy link
Contributor Author

@AmmadRehmat could you please create a new PR for fix of WiFi tests?

@SeppoTakalo
Copy link
Contributor

@asifrizwanubx
Consider enabling all network tests.

Building project tcp (UBLOX_EVK_ODIN_W2, GCC_ARM)
Scan: GCC_ARM
Scan: tcp
Compile [  8.3%]: main.cpp
[Error] main.cpp@19,2: #error [NOT_SUPPORTED] No network configuration found for this target.
[Error] main.cpp@59,25: 'MBED_CONF_APP_CONNECT_STATEMENT' was not declared in this scope
[Error] main.cpp@72,36: 'MBED_CONF_APP_ECHO_SERVER_ADDR' was not declared in this scope
[Error] main.cpp@73,23: 'MBED_CONF_APP_ECHO_SERVER_PORT' was not declared in this scope
[Error] main.cpp@82,36: 'MBED_CONF_APP_ECHO_SERVER_ADDR' was not declared in this scope
Building project stats_heap (UBLOX_EVK_ODIN_W2, GCC_ARM)

In order to run TCP and UDP tests you need to provide test configs in mbed_app.json or as a test config.json. Look for samples in mbed-os/tools/test-configs

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 26, 2018

revert the changes related to wifi tests, will be push in a seperate PR. @0xc0170

Thanks, is adding WiFiSoftAPInterface.h is part of this PR as it relates to the driver update ?

@SeppoTakalo
Copy link
Contributor

I don't see where this flag DEVICE_WIFI_AP is defined or documented.

Also, I don't much like this #ifdeffing that changes the class totally.

Why would you not have separate class that implements the AP functions on top of UbloxOdinInterface?

So instead of

#ifdef DEVICE_WIFI_AP
+class OdinWiFiInterface : public WiFiInterface, public WiFiSoftAPInterface, public EMACInterface
#else
class OdinWiFiInterface : public WiFiInterface, public EMACInterface
#endif

You would do:

class OdinWiFiInterface : public WiFiInterface, public EMACInterface {
...
};
class OdinSoftAPInterface: public OdinWifiInterface, public WifiSoftAPInterface {
 // Soft AP functions here
}

Would allow you to get rid of #ifdef and still allows linker to drop unused AP functions. (Unless there is some runtime checks in your .cpp code that are disabled by #ifndef DEVICE_WIFI_AP)

@asifrizwanubx
Copy link
Contributor Author

@0xc0170

is adding WiFiSoftAPInterface.h is part of this PR as it relates to the driver update ?

yes it is part of this PR without it driver with AP functionality didn't work.

@asifrizwanubx
Copy link
Contributor Author

asifrizwanubx commented Jul 27, 2018

@SeppoTakalo

I don't see where this flag DEVICE_WIFI_AP is defined or documented.

We have added the description of DEVICE_WIFI_AP in PR and by this macro we will restrict the application use of station and AP at a time. Otherwise it will not work.

We will deliver soon a public example for AP with proper documentation.

Could you please point out where will I add description of DEVICE_WIFI_AP?

@screamerbg
Copy link
Contributor

@SeppoTakalo do you have further requests/suggestions?

@SeppoTakalo
Copy link
Contributor

I need @kjbracey-arm and @mikaleppanen to review this, but Kevin is still on vacation.

This PR adds WifiSoftAPInterface as part of public Mbed OS API so it needs more eyes and thoughts. We need to decide how to document and support this after it becomes part of Mbed OS.

@AmmadRehmatCUS
Copy link

@SeppoTakalo
Attaching test reports for tcp and udp tests.
tcp.log
udp.log

Consider enabling all network tests.

Building project tcp (UBLOX_EVK_ODIN_W2, GCC_ARM)
Scan: GCC_ARM
Scan: tcp
Compile [ 8.3%]: main.cpp
[Error] main.cpp@19,2: #error [NOT_SUPPORTED] No network configuration found for this target.
[Error] main.cpp@59,25: 'MBED_CONF_APP_CONNECT_STATEMENT' was not declared in this scope
[Error] main.cpp@72,36: 'MBED_CONF_APP_ECHO_SERVER_ADDR' was not declared in this scope
[Error] main.cpp@73,23: 'MBED_CONF_APP_ECHO_SERVER_PORT' was not declared in this scope
[Error] main.cpp@82,36: 'MBED_CONF_APP_ECHO_SERVER_ADDR' was not declared in this scope
Building project stats_heap (UBLOX_EVK_ODIN_W2, GCC_ARM)

In order to run TCP and UDP tests you need to provide test configs in mbed_app.json or as a test config.json. Look for samples in mbed-os/tools/test-configs

@SeppoTakalo
Copy link
Contributor

@AmmadRehmat Thanks.

Please note that you can enable full set of TCP+UDP tests by enabling macro MBED_EXTENDED_TESTS

https://github.com/ARMmbed/mbed-os/blob/master/TESTS/netsocket/tcp/main.cpp#L137
https://github.com/ARMmbed/mbed-os/blob/master/TESTS/netsocket/udp/main.cpp#L94

@AmmadRehmatCUS
Copy link

Attaching extended testing reports.
udp_extended_log.txt
tcp_extended_log.txt

Please note that you can enable full set of TCP+UDP tests by enabling macro MBED_EXTENDED_TESTS

https://github.com/ARMmbed/mbed-os/blob/master/TESTS/netsocket/tcp/main.cpp#L137
https://github.com/ARMmbed/mbed-os/blob/master/TESTS/netsocket/udp/main.cpp#L94

@SeppoTakalo
Copy link
Contributor

Looks good.

0xc0170
0xc0170 previously requested changes Aug 7, 2018
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cosmetic changes only


#include "emac_lwip_l2_bridge.h"
#include "string.h"
#include "mbed.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be replaced by header files that are required here? Rather than one header file mbed.h

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,413 @@
/* mbed Microcontroller Library
* Copyright (c) 2016 ARM Limited
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2018 year for new files

void LWIPMemoryManager::ref(emac_mem_buf_t *buf)
{
pbuf_ref(static_cast<struct pbuf *>(buf));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasnt there a new line at the end of this line? Github shows there is none now, this results in warning in some toolchains

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are working on cosmetic changes, I have noticed that in release 5.9.0, feature_lwip folder contains files which have been moved to lwipstack folder. In 5.9.3 we only have 2 files in folder feature_lwip, emac_lwip_l2_bridge.h and emac_lwip_l2_bridge.c. Should these files be moved to lwipstack folder as well?

err_t res;
bool free_msg = true;

_mem.ref(buf);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference counting has not been added to general EMAC memory manager interface (EMACMemoryManager.h), but since it is needed only for this lwip specific brigde, I'm not against implementing it only to lwip memory manager for now.

* @param ssid Name of the network to connect to
* @param pass Security passphrase to connect to the network
* @param security Type of encryption for connection (Default: NSAPI_SECURITY_NONE)
* @param channel Channel on which the connection is to be made, or 0 for any (Default: 0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there support for "0" setting? Seems to fail in is_valid_AP_channel() with channel set to zero.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description is a little bit misleading, we will fix the description. Channel zero is not allowed but error handling for non supporting channels is available. Will fix the description soon.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also similar descriptions about channel 0 in OdinWiFiInterface.h and in set_ap_channel() function call. They should be updated too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@cmonr
Copy link
Contributor

cmonr commented Aug 9, 2018

@0xc0170 @mikaleppanen Mind re-reviewing?

@asifrizwanubx
Copy link
Contributor Author

asifrizwanubx commented Aug 9, 2018

@mikaleppanen @0xc0170 please review it again. I made the changes according to your feedback.

nsapi_error_t error_code = _stack.add_ethernet_interface(_emac, true, &_interface);
if (error_code != NSAPI_ERROR_OK) {
_interface = NULL;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like in EMACInterface::connect(), there needs to be call here to "_interface->attach(_connection_status_cb);" in else branch to add the callback to interface. Otherwise callbacks attached between the construct and connect() do not work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is #6562 issue due to this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that #7310 could be caused by this.

@AmmadRehmatCUS AmmadRehmatCUS force-pushed the ublox_odin_driver_os_5_v3.0.0_rc1 branch from ce8ac8f to b934632 Compare August 31, 2018 06:40
@AmmadRehmatCUS
Copy link

@kjbracey-arm commit squashed and cleaned.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 1, 2018

needs: review again. Needs @kjbracey-arm approval

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 2, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Sep 2, 2018

Build : SUCCESS

Build number : 2989
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7579/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@cmonr
Copy link
Contributor

cmonr commented Sep 2, 2018

@kjbracey-arm @mikaleppanen #7579 (comment)

Re-requesting that this PR be re-reviewewed. Comments look to be addressed.

@mbed-ci
Copy link

mbed-ci commented Sep 2, 2018

@mbed-ci
Copy link

mbed-ci commented Sep 2, 2018

@cmonr
Copy link
Contributor

cmonr commented Sep 3, 2018

Interesting. Test failures don't look related to PR.
/morph test

@mbed-ci
Copy link

mbed-ci commented Sep 3, 2018

@0xc0170 0xc0170 merged commit 44925d8 into ARMmbed:master Sep 3, 2018
@0xc0170 0xc0170 changed the title Updated ODIN drivers to v3.0.0 RC1 Update ODIN drivers to v3.0.0 RC1 Sep 3, 2018
@mbed-ci
Copy link

mbed-ci commented Sep 3, 2018

Exporter Build : FAILURE

Build number : 2601
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/exporter/7579/

@flipflop22
Copy link

I have been trying to use this AP feature. It does not work well.
I can see the Network is there, however I can't connect a station (another ODIN-W2) to the AP

@asifrizwanubx
Copy link
Contributor Author

asifrizwanubx commented Oct 1, 2018

@flipflop22

Could you please share the error or issue?

Or try this example.
https://os.mbed.com/teams/ublox/code/mbed-os-example-odinw2-wifi-ap/

If still you face some issue please report it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.