Skip to content

Add support for the WISE1530 and integration framework for WICED SDK #5758

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 7 commits into from
Feb 8, 2018

Conversation

geky
Copy link
Contributor

@geky geky commented Dec 21, 2017

Add support for the WISE1530 and integration framework for WICED SDK

This is a squash of a long series of work that introduces the WICED SDK into Mbed OS. Allowing the use of the WISE1530Interface in Mbed OS.

The WICED SDK requires additional steps to integrate into Mbed OS before it can be used. For more information see WICED.md.

cc @pan-, @SeppoTakalo, @SenRamakri, @sg-, @AnotherButler

@geky geky changed the base branch from master to feature-wiced December 21, 2017 23:15
@@ -0,0 +1,208 @@
#include "mbed_assert.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

license header here please

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 updated


/* notify link is up or down
*/
wiced_result_t wiced_network_notify_link_up(void) {
Copy link
Contributor

Choose a reason for hiding this comment

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

{ new line

* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if defined (IAR_TOOLCHAIN)
Copy link
Contributor

Choose a reason for hiding this comment

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

should use IAR identifier rather here

why a header file inclusion is based on the toolchain?

Copy link
Contributor Author

@geky geky Dec 22, 2017

Choose a reason for hiding this comment

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

This file had a lot of revisions, I'll see if I can remove it when I can.

* limitations under the License.
*/
#pragma once
#if 0
Copy link
Contributor

Choose a reason for hiding this comment

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

this is external file and imported as is (so this deadcode is in there) ? same for typedef below

Copy link
Contributor Author

@geky geky Dec 22, 2017

Choose a reason for hiding this comment

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

Oh good catch, will remove

#include "wwd_assert.h"
#include "wwd_rtos_interface.h"
#include "wiced_utilities.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.

should not include this , pull in what is needed rather

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Above comment got hidden by changes, but question still stands:

Is this a problem in cpp files? There's no risk of namespace polution since it's self contained in the cpp file. If anything this would help protect against filename changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Including only header files that you need will greatly reduce the rebuild time.

On the first build, dependency files are created. Then on the following builds, if there has not been any changes to those headers that you include, your file is not needed to rebuild.

But if everyone includes "mbed.h" this leads every small change to lead to full rebuild of the whole Mbed OS tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough, will update

#include "ticker_api.h"


/**
Copy link
Contributor

Choose a reason for hiding this comment

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

are these docs needed here? Not done in the header file? If they are, this is duplicate and pollutes code file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They're copied from the header file, but the header file is hard to track down. I can remove them if we'd like.


#include "WISE1530Interface.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.

dont include this header file outside of user space

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, is this a problem in cpp files? There's no risk of namespace polution since it's self contained in the cpp file. If anything this would help protect against filename changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand it, a name.cpp file should only ever include its name.h file, for stylistic reasons, not technical.

@adbridge
Copy link
Contributor

@0xc0170 Could you re-review please?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 2, 2018

Please review travis, docs and tools report related errors.

@geky
Copy link
Contributor Author

geky commented Jan 2, 2018

I may need help, @theotherjimmy:

Bad Assembler file name found: ./targets/TARGET_STM/TARGET_STM32F4/TARGET_Advantech_F412RE/device/TOOLCHAIN_GCC_ARM/startup_stm32f412rx.s
Bad Assembler file name found: ./targets/TARGET_STM/TARGET_STM32F4/TARGET_Advantech_F412RE/device/TOOLCHAIN_ARM_MICRO/startup_stm32f412rx.s
Bad Assembler file name found: ./targets/TARGET_STM/TARGET_STM32F4/TARGET_Advantech_F412RE/device/TOOLCHAIN_ARM_STD/startup_stm32f412rx.s
Bad Assembler file name found: ./targets/TARGET_STM/TARGET_STM32F4/TARGET_Advantech_F412RE/device/TOOLCHAIN_IAR/startup_stm32f412rx.s

What are valid assembly names?

AssertionError: Target WISE1530_F412RE contains invalid device_name Advantech_F412RE
E           assert 'Advantech_F412RE' in {'AC30M1332': {'algorithm': {'AC30M1x64/Flashloader/AC30M1x64_64.FLM': {'default': '1', 'ramsize': None, 'ramstart': N...header': 'AC30M1x64/Core/include/AC30M1x64.h'}, 'core': 'Cortex-M0', 'debug': 'AC30M1x64/SVD/AC30M1x64.svd', ...}, ...}
E            +  where 'Advantech_F412RE' = Target(name='WISE1530_F412RE', json_data={'WISE1530_F412RE': OrderedDict([('in...et', 2)], resolution_order_names=['WISE1530_F412RE', 'FAMILY_STM32', 'Target']).device_name
E            +  and   {'AC30M1332': {'algorithm': {'AC30M1x64/Flashloader/AC30M1x64_64.FLM': {'default': '1', 'ramsize': None, 'ramstart': N...header': 'AC30M1x64/Core/include/AC30M1x64.h'}, 'core': 'Cortex-M0', 'debug': 'AC30M1x64/SVD/AC30M1x64.svd', ...}, ...} = <tools.arm_pack_manager.Cache instance at 0x7fc444886f38>.index

This means I don't have a pack for the target I think? I'm not entirely sure what this response to this assertion should be.

@geky
Copy link
Contributor Author

geky commented Jan 2, 2018

Ah, sorry @AnotherButler I should have clarified. The WICED.md file is probably the only document worth editing:
https://github.com/geky/mbed/blob/3d44874f24460c23782d194b259d6efdfc776da7/targets/TARGET_WICED/WICED.md

The code you're editing predates me, I don't know if it's valuable to edit and I can't vouch that the edits are keeping the documentation's meaning correct, sorry.

@AnotherButler
Copy link
Contributor

@geky Thanks for the clarification.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 3, 2018

  1. .s - suffix should be upper case to be portable, thus please rename them to have .S

  2. Advantech_F412RE - does it have cmsis-pack? If yes, then is this a correct name?

@geky
Copy link
Contributor Author

geky commented Jan 3, 2018

Thanks, will update the assembly file.

I'll have to look into the cmsis pack thing more. Where does one normally find cmsis packs? Do they need to be generated?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 3, 2018

I'll have to look into the cmsis pack thing more. Where does one normally find cmsis packs? Do they need to be generated?

Yes, a vendor generates a pack and publishes it (device support as it is called there). You can use the arm pack manager that is part of this repo, or check in the uVision for instance (it has the pack installer to check if target is there). If there is not, we shall remove device_name. @theotherjimmy can provide more info in this area

@KariHaapalehto
Copy link
Contributor

Should we rename folder mbed-os\targets\TARGET_WICED\TARGET_WISE1530_F412RE\ and files under that folder? Those files are not hw specifig files just for wise1530, they are more like wiced adaptation to mbed and can be used with other variants too.

Copy link
Contributor

@KariHaapalehto KariHaapalehto left a comment

Choose a reason for hiding this comment

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

Here are my comments to WICED.mk

- mbed_lib.json

## Download the WICED SDK

Copy link
Contributor

Choose a reason for hiding this comment

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

Here are two different instructions, so I would add comment:
"Both WICED SDK and patch from Advantech is needed"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added to section header

on Advantech's Wiki:
http://ess-wiki.advantech.com.tw/view/WISE-1530_SDK

To get the WICED SDK, download WICED-Studio-5.2.0 for your platform:
Copy link
Contributor

Choose a reason for hiding this comment

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

Or WICED SDK WICED-Studio-5.2.0 for your platform can be get here:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @KariHaapalehto, I'm not exactly sure what the suggestion is for this line. Does the studio need to be named "WICED SDK WICED-Studio-5.2.0"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, that's not right, the studio is WICED-Studio-5.2.0. Inside the studio you get the WICED SDK.

To get the WICED SDK, download WICED-Studio-5.2.0 for your platform:
https://community.cypress.com/community/wiced-wifi/wiced-wifi-documentation

Once downloaded, move the WICED SDK folder into `targets/TARGET_WICED`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Once downloaded, move the SDK's targets/TARGET_WICED/43xxx_Wi-Fi-folder into targets/TARGET_WICED.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also added note about rename to WICED

For the WISE1530, download the patch from Advantech:
`WM-BN-BM-22_SDK_5.1.x_platform_patch.zip`

Once downloaded, copy the contents into `targets/TARGET_WICED/WICED`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Once downloaded, copy the contents into targets/TARGET_WICED.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It really should be targets/TARGET_WICED/WICED (after rename). Otherwise the libraries/platforms folders don't line up with their destinations. Note there are multiple nested WICED folders.


1. Remove these files because they are unnecessary and large:
- `targets/TARGET_WICED/WICED/tools`
- `targets/TARGET_WICED/WICED/build`
Copy link
Contributor

Choose a reason for hiding this comment

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

There isn't build-directory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The build directory is generated if you compile using the WICED studio. I can go ahead and remove this if we want.

Note this is required for the WISE1530 but may not be needed for other
platforms.

1. Remove the includes of `w_core_cm4.h` and `w_core_cmFunc.h`, and replace the
Copy link
Contributor

Choose a reason for hiding this comment

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

+ #include "core_cm4.h"
```

1. Remove the padding of SDPCM data packets. This requires modifications in two
Copy link
Contributor

Choose a reason for hiding this comment

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

} sdpcm_data_header_t;
```

In `targets/TARGET_WICED/WICED/WWD/internal/w_wwd_sdpcm.c` line 1282:
Copy link
Contributor

Choose a reason for hiding this comment

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

line 1441:

Note this is required for the WISE1530 but may not be needed for other
platforms.

1. Set up SDIO_ENUMERATION_TIMEOUT_MS to be configurable. Mbed OS will override this,
Copy link
Contributor

Choose a reason for hiding this comment

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

12

#define SDIO_ENUMERATION_TIMEOUT_MS (500)
+ #endif
```

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. 12 Rename ./mbed-os/targets/TARGET_WICED/TARGET_WISE1530_F412RE/wise1530_emac.c to ./mbed-os/targets/TARGET_WICED/TARGET_WISE1530_F412RE/wise1530_emac.cpp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is this needed? wise1530_emac.c is in Mbed OS, so we can change it here if need be.

But why does it need to be changed to cpp, was there a compilation issue?

@SeppoTakalo
Copy link
Contributor

As this is only going for the feature branch and is a work in progress, I'm OK if this gets merged in as it is currently.

We will anyway continue on working to improve the instructions but at least we won't be blocking others to study it.

@geky geky force-pushed the feature-wiced branch 3 times, most recently from acc7539 to 5e135e4 Compare January 9, 2018 23:50
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.

LGTM, just one comment

#include <stdio.h>
#include "CordioBLE.h"
#include "CordioHCIDriver.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.

what is needed here from mbed.h ? DigitalInout and PinNames ?

missing license header file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like it was not used

@0xc0170 0xc0170 dismissed their stale review January 10, 2018 11:57

new one done

@geky geky force-pushed the feature-wiced branch 2 times, most recently from d3f9aef to 516fd7b Compare January 11, 2018 15:45
@cmonr
Copy link
Contributor

cmonr commented Jan 11, 2018

@0xc0170 @SeppoTakalo @KariHaapalehto Are you all happy with @geky's updates?

@SeppoTakalo
Copy link
Contributor

I'm still in a process of going though the steps... I have not yet successfully build it.

@SeppoTakalo
Copy link
Contributor

Final problem that I cannot get past

./mbed-os/targets/TARGET_WICED/WICED/libraries/drivers/gspi/gspi_slave/w_gspi_slave.c:38:28: fatal error: platform_cache.h: No such file or directory
 #include "platform_cache.h"

This platform_cache.h file was one that was excluded from the build because of .mbedignore lists its folder WICED/WICED/platform/ARM_CR4/

@SeppoTakalo
Copy link
Contributor

Also, lots of files seems to be relying that #pragma once which is not working on GCC. Causing lots of warnings and some errors.

@cmonr cmonr added the needs: CI label Feb 1, 2018
@geky
Copy link
Contributor Author

geky commented Feb 1, 2018

Looks like it's almost good to go. @SeppoTakalo thanks for fixing that 👍

@geky
Copy link
Contributor Author

geky commented Feb 1, 2018

@0xc0170, @cmonr, tests already failing for NUCLEO_F746ZG:

tests-mbed_drivers-lp_ticker
:170::FAIL: Values Not Within Delta 2000 Expected 10000 Was 12546

Is there something on master that makes lp-ticker more stable? or is this just a case of rerun?

@mbed-ci
Copy link

mbed-ci commented Feb 1, 2018

@cmonr
Copy link
Contributor

cmonr commented Feb 1, 2018

I'll restart it. @geky, the only thing that I could really think of is if the CI machine running the test is being hit hard, and having issues keeping up with all of the communication with the Device Under Test.

/morph uvisor-test

@cmonr
Copy link
Contributor

cmonr commented Feb 1, 2018

/morph test

@cmonr
Copy link
Contributor

cmonr commented Feb 1, 2018

Sorry, but it looks like this PR is doing something to lp_ticker test with the NUCLEO_F746ZG. The device is working fine, as evidenced by its previous build (#5022 (comment)).

Results are about to be reported.

@mbed-ci
Copy link

mbed-ci commented Feb 1, 2018

@kjbracey
Copy link
Contributor

kjbracey commented Feb 8, 2018

Please rebase and resubmit - hopefully the cause of the failures should have been cleared on master.

geky and others added 7 commits February 8, 2018 10:57
This is a squash of a long series of work that introduces the WICED SDK
into Mbed OS. Allowing the use of the WISE1530Interface in Mbed OS.

The WICED SDK requires additional steps to integrate into Mbed OS before
it can be used. For more information see WICED.md.
Copy edit for active voice, grammar and precise language.
@geky geky changed the base branch from feature-wiced to master February 8, 2018 17:03
@geky geky changed the base branch from master to feature-wiced February 8, 2018 17:04
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 8, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Feb 8, 2018

Build : SUCCESS

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

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Feb 8, 2018

@mbed-ci
Copy link

mbed-ci commented Feb 8, 2018

@mbed-ci
Copy link

mbed-ci commented Feb 8, 2018

@cmonr cmonr removed the needs: work label Feb 8, 2018
@cmonr cmonr merged commit 4de3f2f into ARMmbed:feature-wiced Feb 8, 2018
@geky
Copy link
Contributor Author

geky commented Feb 9, 2018

🎉

@0xc0170 0xc0170 mentioned this pull request Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.