Skip to content
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

Enable sdram usage of REALTEK_RTL8195AM #4665

Merged
merged 15 commits into from
Sep 6, 2017

Conversation

Archcady
Copy link
Contributor

To further resolve small user code size issue, this PR enable and put most of the text code to sdram of REALTEK_RTL8195AM

@AnotherButler
Copy link
Contributor

@Archcady Thanks for the PR.

Also, we recommend our contributors follow Chris Beam’s seven rules of great commit messages to keep the commit history clear. We find the commit.template feature particularly helpful. To match this format, please capitalize the first word of your subject line ("Enable").

Thanks for your contributions.

@theotherjimmy
Copy link
Contributor

@Archcady We use recent versions of the tools to compile older versions of mbed OS on the website. Are the changes to the postbuild script backwards compatible with the prior linker scirpts?

@Archcady Archcady changed the title enable sdram usage of REALTEK_RTL8195AM Enable sdram usage of REALTEK_RTL8195AM Jun 30, 2017
@Archcady
Copy link
Contributor Author

Hi @theotherjimmy , yes, this postbuild script is backward compatible. I've tested it before I submit this PR :)

@JanneKiiskila
Copy link
Contributor

This enables the compilation now of of the mbed-os-example-client. Didn't try it out yet, as I have no board right now.

Link: mbed-os-example-client
Elf2Bin: mbed-os-example-client
+-----------------------------+-------+-------+-------+
| Module                      | .text | .data |  .bss |
+-----------------------------+-------+-------+-------+
| Fill                        |   134 |     9 |    98 |
| Misc                        | 23298 |  2633 |  3280 |
| drivers                     |   184 |     0 |     0 |
| features/FEATURE_COMMON_PAL |   601 |    61 |  9093 |
| features/FEATURE_LWIP       |  2750 |    77 | 37638 |
| features/mbedtls            |  6426 |    51 |  8755 |
| features/netsocket          |   397 |    85 |    60 |
| hal                         |    77 |     0 |    24 |
| platform                    |   212 |    20 |   324 |
| rtos                        |   299 |     4 |  4360 |
| rtos/rtx5                   |   784 |   176 |  1368 |
| targets/TARGET_Realtek      |  3057 |     4 |  2080 |
| Subtotals                   | 38219 |  3120 | 67080 |
+-----------------------------+-------+-------+-------+
Allocated Heap: unknown
Allocated Stack: unknown
Total Static RAM memory (data + bss): 70200 bytes
Total RAM memory (data + bss + heap + stack): 70200 bytes
Total Flash memory (text + data + misc): 41339 bytes

Image: ./BUILD/REALTEK_RTL8195AM/GCC_ARM/mbed-os-example-client.bin

I would recommend merging that in ASAP, I would also want this to the next upcoming mbed-os 5.5.x patch release. @adbridge @0xc0170

@JanneKiiskila
Copy link
Contributor

JanneKiiskila commented Jun 30, 2017

Well, we do have a board in RaaS - tried it via there and unfortunately I found a new issue. New issue raised - #4673. => which can and should be ignored - my bad,

Ho-huh, should be doing these tests by having the board AT HAND, not in a remote RaaS. I now remember that these boards DO NOT have an physical ethernet connection! So, this issue is NOT valid and can be closed. I need to use these over WLAN.

Sorry about that. I can't see the RaaS HWs, as they are physically elsewhere.

@JanneKiiskila
Copy link
Contributor

Although this does raise the question that have we ever done the easy-connect integration to the Realtek WiFi yet? I bet that is missing.

@adbridge
Copy link
Contributor

@JanneKiiskila If you can get test results posted here in the next couple of hours then we can try and get this in for 5.5.2, which we will be producing the candidate for later...

@JanneKiiskila
Copy link
Contributor

@adbridge - next to impossible to get done in the next few hours, unless I get REALLY quickly some help with the wifi interface in RTL, how is one supposed to use it? We seem to have a separate wifi class for every Wifi implementation, what's the class to use with REALTEK_RTL8195AM?

@JanneKiiskila
Copy link
Contributor

Anyways, the image produced with GCC was anyway functional, it linked and the app started. This PR is not about networking, so I don't think the merge should be blocked in any way.

@JanneKiiskila
Copy link
Contributor

Ok, got it sorted out. WiFi connects and works to some extent, but it still fails to register.

=========================================================

ROM Version: 0.3

Build ToolChain Version: gcc version 4.8.3 (Realtek ASDK-4.8.3p1 Build 2003)

=========================================================
Check boot type form eFuse
SPI Initial
Image1 length: 0x2d64, Image Addr: 0x10000bc8
Image1 Validate OK, Going jump to Image1

Initializing WIFI ...
WIFI initialized
[EasyConnect] Connected to Network successfully
[EasyConnect] MAC address f0:03:8c:3c:1f:e5
[EasyConnect] IP address 192.168.64.248

SOCKET_MODE : TCP
Connecting to coap://api.connector.mbed.com:5684
simulate button_click, device not registered
simulate button_click, device not registered

@adbridge
Copy link
Contributor

@bulislaw are you able to help @JanneKiiskila at all ?

@bulislaw
Copy link
Member

@adbridge @JanneKiiskila worth talking to @marcuschangarm I think they got it up and running.

@JanneKiiskila
Copy link
Contributor

JanneKiiskila commented Jun 30, 2017

Yep, the WiFi seems to be acting up a bit now. On the 2nd trial it fails differently.

=========================================================
Check boot type form eFuse
SPI Initial
Image1 length: 0x2d64, Image Addr: 0x10000bc8
Image1 Validate OK, Going jump to Image1

Initializing WIFI ...
WIFI initialized
K
K
K
K

KIFI is already running

Starting mbed Client example
[EasyConnect] IPv4 mode
[EasyConnect] Using WiFi (REALTEK)
[EasyConnect] Connecting to WiFi systest

RTL8195A[Driver]: set ssid [systest]

RTL8195A[Driver]: start auth to 80:2a:a8:8a:e9:13

RTL8195A[Driver]: auth success, start assoc

RTL8195A[Driver]: association success(res=15)

RTL8195A[Driver]: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4)

RTL8195A[Driver]: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
RTL8195A[Driver]: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
[EasyConnect] MAC address f0:03:8c:3c:1f:e5
[EasyConnect] Connection to Network Failed -3010!

Connection to Network Failed - exiting application...

I'll anyways do the easy-connect PR, so that others can try to the mbed-os-example-client, as well.

@JanneKiiskila
Copy link
Contributor

ARMmbed/easy-connect#27

@JanneKiiskila
Copy link
Contributor

JanneKiiskila commented Jun 30, 2017

There were some temporary WiFi issues apparently, K64F failed too -> now they work, WiFi gets address etc., but the actual client connection is still failing. Tried to enable more logs, but when uploading that image to the Ameba board -> they die in our CI. Need to see what's actually happening there, does the image get too large?

@JanneKiiskila
Copy link
Contributor

Are we sure the async network APIs have been implemented to the Realtek WiFi?
@Archcady - can you confirm?

@adbridge
Copy link
Contributor

@JanneKiiskila looks to me like this is not ready for 5.5.2 , I think we will have to target it for 5.5.3 in 2 weeks time...

@JanneKiiskila
Copy link
Contributor

I would claim the issues we're now seeing are NOT things with this PR, they are the NEXT issues we'll see after this is merged in. So, I'd rather take this in now, rather than later. It's always a bit of a hassle to work with the forks.

@Archcady
Copy link
Contributor Author

Hi @marcuschangarm , just upload our fixes for debug profile. We still have one bug found during the call to TCPSocket::connect() with GCC/debug, we are trying to locating the bug and will patch in next commit. THX.
By the time of this commit, I test Windows ARMCC/debug and IAR/debug and result is successful.

@Archcady
Copy link
Contributor Author

Archcady commented Sep 4, 2017

I think maybe the issue of debug profile should not block the present PR since it is about mbed client. I'll submit another PR to resolve the issue of debug profile.

@samchuarm
Copy link

Hi @Archcady Do you wish to merge in the commits that you've currently submitted in this PR and you'll create another PR to address the remaining stability issues?

@Archcady
Copy link
Contributor Author

Archcady commented Sep 4, 2017

Hi @samchuarm. Yes I hope so. Thanks.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 4, 2017

I think maybe the issue of debug profile should not block the present PR since it is about mbed client. I'll submit another PR to resolve the issue of debug profile.

👍 As we understand, this is ready for integration? We will trigger CI then

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 4, 2017

/morph test

@tung7970
Copy link
Contributor

tung7970 commented Sep 4, 2017

mbed cloud client works with @Archcady's patches.

<RTL8195A>
Check boot type form eFuse
SPI Initial
Image1 length: 0x3308, Image Addr: 0x10000bc8
Image1 Validate OK, Going jump to Image1
SPI calibration
Start simple mbed Cloud Client
Start developer flow
Developer credentials already exists
[EasyConnect] IPv4 mode
[EasyConnect] Using WiFi (RTW)
[EasyConnect] Connecting to WiFi Lightsaber
[EasyConnect] Connected to Network successfully
[EasyConnect] MAC address 28:c2:dd:dd:xx:xx
[EasyConnect] IP address 172.20.10.12

Client registered

Endpoint Name: 0xxxxxx8xxxx000000000000100100106
Device Id: 0xxxxxx8xxxx000000000000100100106
increment resource value, new value of resource is 1

@mbed-bot
Copy link

mbed-bot commented Sep 5, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1214

Build failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 5, 2017

@Archcady Can you please look at the failure from the latest CI? Linker error for GCC_ARM.

@Archcady
Copy link
Contributor Author

Archcady commented Sep 5, 2017

Hi @0xc0170 the error message says unable to find rtl8195a_rom.h: No such file or directory. The directory in .ld file starts from mbed-os and cause this

@bulislaw
Copy link
Member

bulislaw commented Sep 5, 2017

https://github.com/ARMmbed/mbed-os/pull/4665/files#diff-afd3ff400ff25734614a1eb758a85386R17
+INCLUDE "mbed-os/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/device/TOOLCHAIN_GCC_ARM/rtl8195a_rom.h"

this line in the linker script is the issue, it's path assuming you have 'mbed-os' directory in main directory of your project. This assumption is wrong, you can execute tests from inside the mbed-os or you can add main inside mbed-os. You used to have the same solution first when you initially submitted Ameba support to mbed-os then you fixed it.

Should not make assumption of specific directory when include .h from
linker script
@Archcady
Copy link
Contributor Author

Archcady commented Sep 5, 2017

Hi @bulislaw , I change the line to "INCLUDE "rtl8195a_rom.h"", test it on my side and it works ok. Will this also works with CI? Thanks.

@bulislaw
Copy link
Member

bulislaw commented Sep 5, 2017

I think so, let's see.

/morph test

@mbed-bot
Copy link

mbed-bot commented Sep 5, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1220

All builds and test passed!

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 6, 2017

This is now ready for integration

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.

None yet